From 204603751340d66dd931fd4bf94d492b212c5665 Mon Sep 17 00:00:00 2001 From: Enrico Olivelli Date: Thu, 20 Jun 2019 20:16:07 +0200 Subject: [PATCH 1/8] Enhance Mavenized Make C client --- zookeeper-client/zookeeper-client-c/pom.xml | 118 ++++++++++---------- 1 file changed, 58 insertions(+), 60 deletions(-) diff --git a/zookeeper-client/zookeeper-client-c/pom.xml b/zookeeper-client/zookeeper-client-c/pom.xml index 82948105d99..d8f98b18f74 100755 --- a/zookeeper-client/zookeeper-client-c/pom.xml +++ b/zookeeper-client/zookeeper-client-c/pom.xml @@ -35,52 +35,13 @@ - - org.apache.maven.plugins - maven-antrun-plugin - - - generate-sources - generate-sources - - - - - - - run - - - - test-cppunit - test - - - ${skipTests} - - - - - - - - - - - - - run - - - - - + org.codehaus.mojo exec-maven-plugin autoreconf - test-compile + process-sources exec @@ -97,7 +58,7 @@ configure - test-compile + process-sources exec @@ -114,30 +75,67 @@ - + ${skipTests} + + + + + + + + + + - + + run + + - \ No newline at end of file + From 44f6ba5d2530d3376e469524df0b946b77a69fcb Mon Sep 17 00:00:00 2001 From: Enrico Olivelli Date: Fri, 21 Jun 2019 13:29:44 +0200 Subject: [PATCH 2/8] Better .gitignore --- .gitignore | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index c3a688e159c..f8b39ded50d 100644 --- a/.gitignore +++ b/.gitignore @@ -68,14 +68,6 @@ tags .cproject .project obj -zookeeper-client/zookeeper-client-c/core.* -zookeeper-client/zookeeper-client-c/TEST-*.txt -zookeeper-client/zookeeper-client-c/*.la -zookeeper-client/zookeeper-client-c/*.lo -zookeeper-client/zookeeper-client-c/*.o -zookeeper-client/zookeeper-client-c/generated/ -zookeeper-server/src/main/resources/lib/ant-eclipse-* -zookeeper-server/src/main/resources/lib/ivy-* zookeeper-client/zookeeper-client-c/Makefile.in zookeeper-client/zookeeper-client-c/aclocal.m4 zookeeper-client/zookeeper-client-c/autom4te.cache/ @@ -88,7 +80,12 @@ zookeeper-client/zookeeper-client-c/depcomp zookeeper-client/zookeeper-client-c/install-sh zookeeper-client/zookeeper-client-c/ltmain.sh zookeeper-client/zookeeper-client-c/missing -zookeeper-server/src/test/resources/ +zookeeper-client/zookeeper-client-c/TEST-*.txt +zookeeper-client/zookeeper-client-c/generated/ +zookeeper-server/src/main/resources/lib/ant-eclipse-* +zookeeper-server/src/main/resources/lib/ivy-* +zookeeper-server/src/main/java/org/apache/zookeeper/version/Info.java +zookeeper-server/src/main/java/org/apache/zookeeper/version/VersionInfoMain.java # Python *.py[cod] From f010295244410042ee2a57e7e5de04328db68406 Mon Sep 17 00:00:00 2001 From: Mate Szalay-Beko Date: Wed, 4 Sep 2019 09:51:00 +0200 Subject: [PATCH 3/8] ZOOKEEPER-3436 Enhance Mavenized Make C client --- README.md | 1 + README_packaging.md | 77 +++++++++++++++++++ README_packaging.txt | 45 ----------- build.xml | 4 +- .../src/main/assembly/bin-package.xml | 12 +++ .../src/main/assembly/components.xml | 2 +- zookeeper-client/zookeeper-client-c/pom.xml | 20 ++++- 7 files changed, 112 insertions(+), 49 deletions(-) create mode 100644 README_packaging.md delete mode 100644 README_packaging.txt diff --git a/README.md b/README.md index 9a248e12ece..f859ef76ad1 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ found in zookeeper-assembly/target directory after building the project with mav Contains all the jar files required to run ZooKeeper Full documentation can also be found in the docs folder + The compiled C-client is located in the /usr folder (if the build profile `-Pfull-build` used during maven install) As of version 3.5.5, the parent, zookeeper and zookeeper-jute artifacts are deployed to the central repository after the release diff --git a/README_packaging.md b/README_packaging.md new file mode 100644 index 00000000000..6c0a40ca786 --- /dev/null +++ b/README_packaging.md @@ -0,0 +1,77 @@ +# README file for Packaging Notes + +The ZooKeeper project publishes releases as tarballs. For ZooKeeper packages +specific to your OS (such as rpm and deb), consider using Apache Bigtop: + +http://bigtop.apache.org/ + + +## Requirements + +ant (recommended version 1.9.4 or later for concurrent JUnit test execution) or maven +gcc, cppunit and python-setuptools are required to build +C and python bindings. + +On RHEL machine: + +`yum install cppunit` +`yum install python-setuptools` + +On Ubuntu: + +`apt-get --install cppunit` +`apt-get --install python-setuptools` + + + +## Package build command (using ant) + +Command to build tarball package: `ant tar` + +`zookeeper-.tar.gz` tarball file structure layout + + /bin - User executable + /sbin - System executable + /libexec - Configuration boot trap script + /lib - Library dependencies + /docs - Documents + /share/zookeeper - Project files + +Command to build tarball package with native components: `ant package-native tar` + +`zookeeper--lib.tar.gz` tarball file structure layout + + /bin - User executable + /lib - Native libraries + /include/zookeeper - Native library headers + + +## Package build command (using maven) + +Command to clean everything and build the tarball package without executing the tests: +`mvn clean -Pfull-build && mvn install -Pfull-build -DskipTests` + + +Optional parameters you might consider when using maven: + `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build + `-Pfull-build` - activates the full-build profile, causing the C client to be built + `-Pc-test-coverage=true` - activates the test coverage calculation during the execution of C client tests + + +Please note: if you don't provide the `-Pfull-build` parameter, then the C client will not be built, the C client tests +will not be executed and the previous C client builds will no be cleaned up (e.g. with 'mvn clean'). + +`zookeeper-assembly/target/apache-zookeeper--bin.tar.gz` tarball file structure layout + + /bin - User executables + /conf - Configuration files + /lib - ZooKeeper JAR files and all the required java library dependencies + /docs - Documents + /usr - Native artifacts (only present if `-Pfull-build` used) + /usr/bin - User executable + /usr/lib - Native libraries + /usr/include/zookeeper - Native library headers + + +Beside the binary tarball, you can find the whole original source project packaged into: +`zookeeper-assembly/target/apache-zookeeper-.tar.gz` diff --git a/README_packaging.txt b/README_packaging.txt deleted file mode 100644 index 9776f74ca90..00000000000 --- a/README_packaging.txt +++ /dev/null @@ -1,45 +0,0 @@ -README file for Packaging Notes - -Requirement ------------ - -ant (recommended version 1.9.4 or later for concurrent JUnit test execution) -gcc, cppunit and python-setuptools are required to build -C and python bindings. - -On RHEL machine: - -yum install cppunit -yum install python-setuptools - -On Ubuntu: - -apt-get --install cppunit -apt-get --install python-setuptools - -Package build command ---------------------- - -The ZooKeeper project publishes releases as tarballs. For ZooKeeper packages -specific to your OS (such as rpm and deb), consider using Apache Bigtop: - -http://bigtop.apache.org/ - -Command to build tarball package: ant tar - -zookeeper-.tar.gz tarball file structure layout - - /bin - User executable - /sbin - System executable - /libexec - Configuration boot trap script - /lib - Library dependencies - /docs - Documents - /share/zookeeper - Project files - -Command to build tarball package with native components: ant package-native tar - -zookeeper--lib.tar.gz tarball file structure layout - - /bin - User executable - /lib - Native libraries - /include/zookeeper - Native library headers diff --git a/build.xml b/build.xml index b965084f008..c2a0f83f828 100644 --- a/build.xml +++ b/build.xml @@ -875,7 +875,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - + @@ -1004,7 +1004,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - + diff --git a/zookeeper-assembly/src/main/assembly/bin-package.xml b/zookeeper-assembly/src/main/assembly/bin-package.xml index 1fa81d0bb22..2984477a63e 100644 --- a/zookeeper-assembly/src/main/assembly/bin-package.xml +++ b/zookeeper-assembly/src/main/assembly/bin-package.xml @@ -70,6 +70,18 @@ ${rw.file.permission} ${rwx.file.permission} + + + ${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c + usr + + bin/* + include/**/* + lib/* + + ${rw.file.permission} + ${rwx.file.permission} + ${project.basedir}/../zookeeper-server/src/main/resources/lib diff --git a/zookeeper-assembly/src/main/assembly/components.xml b/zookeeper-assembly/src/main/assembly/components.xml index 2510db1ba85..e0df12bec16 100644 --- a/zookeeper-assembly/src/main/assembly/components.xml +++ b/zookeeper-assembly/src/main/assembly/components.xml @@ -29,7 +29,7 @@ NOTICE.txt LICENSE.txt README.md - README_packaging.txt + README_packaging.md ${rw.file.permission} diff --git a/zookeeper-client/zookeeper-client-c/pom.xml b/zookeeper-client/zookeeper-client-c/pom.xml index d8f98b18f74..e3703f1f85d 100755 --- a/zookeeper-client/zookeeper-client-c/pom.xml +++ b/zookeeper-client/zookeeper-client-c/pom.xml @@ -33,6 +33,24 @@ Apache ZooKeeper - Client - C ZooKeeper c client + + + c-test-coverage + + --enable-gcov + + + + no-c-test-coverage + + true + + + + + + + @@ -71,7 +89,7 @@ --prefix=${project.build.directory}/c - --enable-gcov + ${c-test-coverage-arg} From 936550e4808f4ce98669305c1ce2e2c172300d5c Mon Sep 17 00:00:00 2001 From: Mate Szalay-Beko Date: Wed, 4 Sep 2019 10:20:28 +0200 Subject: [PATCH 4/8] ZOOKEEPER-3436 fixing README_packaging.md --- README_packaging.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README_packaging.md b/README_packaging.md index 6c0a40ca786..f8b03710a14 100644 --- a/README_packaging.md +++ b/README_packaging.md @@ -53,9 +53,9 @@ Command to clean everything and build the tarball package without executing the Optional parameters you might consider when using maven: - `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build - `-Pfull-build` - activates the full-build profile, causing the C client to be built - `-Pc-test-coverage=true` - activates the test coverage calculation during the execution of C client tests + `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build + `-Pfull-build` - activates the full-build profile, causing the C client to be built + `-Pc-test-coverage` - activates the test coverage calculation during the execution of C client tests Please note: if you don't provide the `-Pfull-build` parameter, then the C client will not be built, the C client tests From 30eea5e27914fa9c8416963784e3cc10c13b99c0 Mon Sep 17 00:00:00 2001 From: Mate Szalay-Beko Date: Wed, 4 Sep 2019 12:25:37 +0200 Subject: [PATCH 5/8] ZOOKEEPER-3436 exclude README_packaging.md from license check Change-Id: I0303c13231ddff03e4df96a2cd9902d07f27f0c2 --- build.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index c2a0f83f828..ce9436100c7 100644 --- a/build.xml +++ b/build.xml @@ -1760,7 +1760,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"> - + diff --git a/pom.xml b/pom.xml index 01c38115283..34abff47e20 100755 --- a/pom.xml +++ b/pom.xml @@ -789,7 +789,7 @@ conf/configuration.xsl .travis.yml excludeFindBugsFilter.xml - README_packaging.txt + README_packaging.md src/main/resources/markdown/skin/* src/main/resources/markdown/html/* src/main/resources/markdown/images/* From a2ac025a0c1842b5ecc5955aa368857d22df94ec Mon Sep 17 00:00:00 2001 From: Mate Szalay-Beko Date: Wed, 4 Sep 2019 12:36:09 +0200 Subject: [PATCH 6/8] ZOOKEEPER-3436 enhance / format README_packaging.md Change-Id: Ie9b433f011ba6c15cd09a45672d45509da84da13 --- README_packaging.md | 92 +++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/README_packaging.md b/README_packaging.md index f8b03710a14..bfda87f4df5 100644 --- a/README_packaging.md +++ b/README_packaging.md @@ -8,70 +8,72 @@ http://bigtop.apache.org/ ## Requirements -ant (recommended version 1.9.4 or later for concurrent JUnit test execution) or maven -gcc, cppunit and python-setuptools are required to build -C and python bindings. +- ant (recommended version 1.9.4 or later for concurrent JUnit test execution) or maven to build the java code +- gcc, cppunit and python-setuptools are required to build C and python bindings. On RHEL machine: -`yum install cppunit` -`yum install python-setuptools` +``` +yum install cppunit +yum install python-setuptools +``` On Ubuntu: -`apt-get --install cppunit` -`apt-get --install python-setuptools` +``` +apt-get install cppunit +apt-get install python-setuptools +``` +## Package build command (using maven) -## Package build command (using ant) +Commands to clean everything and build the tarball package without executing the tests: + +``` +mvn clean -Pfull-build +mvn install -Pfull-build -DskipTests +``` + +Optional parameters you might consider when using maven: +- `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build +- `-Pfull-build` - activates the full-build profile, causing the C client and python code to be built +- `-Pc-test-coverage` - activates the test coverage calculation during the execution of C client tests -Command to build tarball package: `ant tar` +Please note: if you don't provide the `-Pfull-build` parameter, then the C client will not be built, the C client tests +will not be executed and the previous C client builds will no be cleaned up (e.g. with simply using `mvn clean`). -`zookeeper-.tar.gz` tarball file structure layout +`zookeeper-assembly/target/apache-zookeeper--bin.tar.gz` tarball file structure layout: - /bin - User executable - /sbin - System executable - /libexec - Configuration boot trap script - /lib - Library dependencies - /docs - Documents - /share/zookeeper - Project files +- `/bin` - User executables +- `/conf` - Configuration files +- `/lib` - ZooKeeper JAR files and all the required java library dependencies +- `/docs` - Documents +- `/usr` - Native artifacts (only present if `-Pfull-build` used) + +Beside the binary tarball, you can find the whole original source project packaged into: +`zookeeper-assembly/target/apache-zookeeper-.tar.gz` -Command to build tarball package with native components: `ant package-native tar` -`zookeeper--lib.tar.gz` tarball file structure layout +## Package build command (using ant) - /bin - User executable - /lib - Native libraries - /include/zookeeper - Native library headers +**Command to build tarball package:** `ant tar` +`zookeeper-.tar.gz` tarball file structure layout: -## Package build command (using maven) +- `/bin` - User executable +- `/sbin` - System executable +- `/libexec` - Configuration boot trap script +- `/lib` - Library dependencies +- `/docs` - Documents +- `/share/zookeeper` - Project files -Command to clean everything and build the tarball package without executing the tests: -`mvn clean -Pfull-build && mvn install -Pfull-build -DskipTests` +**Command to build tarball package with native components:** `ant package-native tar` -Optional parameters you might consider when using maven: - `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build - `-Pfull-build` - activates the full-build profile, causing the C client to be built - `-Pc-test-coverage` - activates the test coverage calculation during the execution of C client tests +`zookeeper--lib.tar.gz` tarball file structure layout: +- `/bin` - User executable +- `/lib` - Native libraries +- `/include/zookeeper` - Native library headers -Please note: if you don't provide the `-Pfull-build` parameter, then the C client will not be built, the C client tests -will not be executed and the previous C client builds will no be cleaned up (e.g. with 'mvn clean'). - -`zookeeper-assembly/target/apache-zookeeper--bin.tar.gz` tarball file structure layout - - /bin - User executables - /conf - Configuration files - /lib - ZooKeeper JAR files and all the required java library dependencies - /docs - Documents - /usr - Native artifacts (only present if `-Pfull-build` used) - /usr/bin - User executable - /usr/lib - Native libraries - /usr/include/zookeeper - Native library headers - - -Beside the binary tarball, you can find the whole original source project packaged into: -`zookeeper-assembly/target/apache-zookeeper-.tar.gz` From 57b7cd61dad666fb8cf891ac13d0557c937fcbc9 Mon Sep 17 00:00:00 2001 From: Mate Szalay-Beko Date: Thu, 5 Sep 2019 09:43:32 +0200 Subject: [PATCH 7/8] ZOOKEEPER-3436 fixing file permissions of usr/bin/* in binary tarball --- .../src/main/assembly/bin-package.xml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/zookeeper-assembly/src/main/assembly/bin-package.xml b/zookeeper-assembly/src/main/assembly/bin-package.xml index 2984477a63e..00668e5f70e 100644 --- a/zookeeper-assembly/src/main/assembly/bin-package.xml +++ b/zookeeper-assembly/src/main/assembly/bin-package.xml @@ -71,17 +71,26 @@ ${rwx.file.permission} - + ${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c usr - bin/* include/**/* lib/* ${rw.file.permission} ${rwx.file.permission} + + + ${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c + usr + + bin/* + + ${rwx.file.permission} + ${rwx.file.permission} + ${project.basedir}/../zookeeper-server/src/main/resources/lib From 18250df41b0c8bfd1ea153d20f7b8e5b53d5c86a Mon Sep 17 00:00:00 2001 From: Mate Szalay-Beko Date: Mon, 9 Sep 2019 09:19:58 +0200 Subject: [PATCH 8/8] ZOOKEEPER-3436 remove the C binaries from the binary tarball; update the readme files --- README.md | 1 - README_packaging.md | 34 ++++++++++++------- .../src/main/assembly/bin-package.xml | 21 ------------ 3 files changed, 22 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index f859ef76ad1..9a248e12ece 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ found in zookeeper-assembly/target directory after building the project with mav Contains all the jar files required to run ZooKeeper Full documentation can also be found in the docs folder - The compiled C-client is located in the /usr folder (if the build profile `-Pfull-build` used during maven install) As of version 3.5.5, the parent, zookeeper and zookeeper-jute artifacts are deployed to the central repository after the release diff --git a/README_packaging.md b/README_packaging.md index bfda87f4df5..fe731a7ff03 100644 --- a/README_packaging.md +++ b/README_packaging.md @@ -28,7 +28,23 @@ apt-get install python-setuptools ## Package build command (using maven) -Commands to clean everything and build the tarball package without executing the tests: +Commands to clean everything and build the tarball package without executing the tests: `mvn clean install -DskipTests` + + +`zookeeper-assembly/target/apache-zookeeper--bin.tar.gz` tarball file structure layout: + +- `/bin` - User executables +- `/conf` - Configuration files +- `/lib` - ZooKeeper JAR files and all the required java library dependencies +- `/docs` - Documents + +Beside the binary tarball, you can find the whole original source project packaged into: +`zookeeper-assembly/target/apache-zookeeper-.tar.gz` + + +### Building the C client (using maven) + +To also build the C client, you need to activate the `full-build` profile: ``` mvn clean -Pfull-build @@ -36,23 +52,17 @@ mvn install -Pfull-build -DskipTests ``` Optional parameters you might consider when using maven: +- `-Pfull-build` - activates the full-build profile, causing the C client to be built - `-DskipTests` - this parameter will skip both java and C++ unit test execution during the build -- `-Pfull-build` - activates the full-build profile, causing the C client and python code to be built - `-Pc-test-coverage` - activates the test coverage calculation during the execution of C client tests Please note: if you don't provide the `-Pfull-build` parameter, then the C client will not be built, the C client tests will not be executed and the previous C client builds will no be cleaned up (e.g. with simply using `mvn clean`). -`zookeeper-assembly/target/apache-zookeeper--bin.tar.gz` tarball file structure layout: - -- `/bin` - User executables -- `/conf` - Configuration files -- `/lib` - ZooKeeper JAR files and all the required java library dependencies -- `/docs` - Documents -- `/usr` - Native artifacts (only present if `-Pfull-build` used) - -Beside the binary tarball, you can find the whole original source project packaged into: -`zookeeper-assembly/target/apache-zookeeper-.tar.gz` +The compiled C client can be found here: +- `zookeeper-client/zookeeper-client-c/target/c/bin` - User executable +- `zookeeper-client/zookeeper-client-c/target/c/lib` - Native libraries +- `zookeeper-client/zookeeper-client-c/target/c/include/zookeeper` - Native library headers ## Package build command (using ant) diff --git a/zookeeper-assembly/src/main/assembly/bin-package.xml b/zookeeper-assembly/src/main/assembly/bin-package.xml index 00668e5f70e..1fa81d0bb22 100644 --- a/zookeeper-assembly/src/main/assembly/bin-package.xml +++ b/zookeeper-assembly/src/main/assembly/bin-package.xml @@ -70,27 +70,6 @@ ${rw.file.permission} ${rwx.file.permission} - - - ${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c - usr - - include/**/* - lib/* - - ${rw.file.permission} - ${rwx.file.permission} - - - - ${project.basedir}/../zookeeper-client/zookeeper-client-c/target/c - usr - - bin/* - - ${rwx.file.permission} - ${rwx.file.permission} - ${project.basedir}/../zookeeper-server/src/main/resources/lib