From 2f9225a5ed87520bd739df7a9294e9e47053c252 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 21 Aug 2018 00:20:04 +0200 Subject: [PATCH] Regenerated with current zproject (concerning tmp-deps) --- .gitattributes | 2 + .gitignore | 10 +- .travis.yml | 161 +++++-- Dockerfile | 8 +- Jenkinsfile | 539 +++++++++++++++++++++++- bindings/jni/.gitignore | 3 - bindings/jni/ci_build.sh | 10 +- bindings/nodejs/build.sh | 8 + bindings/python_cffi/zyre_cffi/cdefs.py | 9 + builds/android/ci_build.sh | 7 +- builds/check_zproject/ci_build.sh | 8 +- builds/cmake/ci_build.sh | 13 +- builds/rpi/build.sh | 17 +- ci_build.sh | 13 +- include/zyre_library.h | 1 - src/zyre_classes.h | 1 - 16 files changed, 736 insertions(+), 74 deletions(-) diff --git a/.gitattributes b/.gitattributes index cf7ef78f6..ef0e56360 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ +# This is a skeleton created by zproject. +# You can add hand-written code here. # disables auto CRLF conversion for all files; create the file correctly and it will be allright * -text diff --git a/.gitignore b/.gitignore index 7e121b7c8..2ace560d8 100644 --- a/.gitignore +++ b/.gitignore @@ -33,7 +33,7 @@ src/zyre_selftest *.app core - # Distcheck workspace and archives +# Distcheck workspace and archives zyre-*/ zyre-*.tar.gz zyre-*.zip @@ -77,8 +77,7 @@ install_manifest.txt Testing/ # Repositories downloaded by CI integration scripts -libzmq/ -czmq/ +tmp-deps/ # Travis build area tmp/ @@ -107,7 +106,7 @@ src/app/gen/ src/app/obj/ src/app/local.properties -# Android -dependencies +# Android - dependencies src/app/jni/output # Python build directory @@ -129,5 +128,8 @@ bindings/qt/selftest/selftest *.bak .test* +# Netbeans directory +nbproject/ + # editor backups *~ diff --git a/.travis.yml b/.travis.yml index 9c90c1c8e..5319990eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,48 @@ # Travis CI script +# This is a skeleton created by zproject. +# You can add hand-written code here. +### NOTE: This file was customized after zproject generation; +### be careful about updating it (git difftool is your friend) -language: c +language: +- c +cache: +- ccache + +### Customization note: added OSX os: - linux - osx -dist: trusty - +# Note: some packages or dependencies may require extended permissions +# which take longer to set up and boot. If your project does not build +# in the default container with sudo==false, consider requiring a docker +# image and/or a newer Ubuntu Trusty baseline VM, by uncommenting below. +# See the current docs on http://travis-ci.org for up-to-date options. sudo: false +#sudo: required + +### Customization note: enabled dist:trusty +dist: +- trusty +#services: +#- docker + +# Set CI_TIME=true to enable build-step profiling in Travis +# Set CI_TRACE=true to enable shell script tracing in Travis +# Set CI_CONFIG_QUIET=true to enable "configure --quiet" (only report stderr) +# Set CI_REQUIRE_GOOD_GITIGNORE=false to NOT fail if "git status -s" is not clean +# Set CI_REQUIRE_GOOD_CLANG_FORMAT=true to fail if "clang-format" check is not clean env: global: + - CI_TIME=false + - CI_TRACE=false + - CI_CONFIG_QUIET=true + - CI_REQUIRE_GOOD_GITIGNORE=false + - CI_REQUIRE_GOOD_CLANG_FORMAT=false + ### Customization note: added credentials data and comments below # Note: Secure variables must be global! # # Bintray upload credentials. (BINTRAY_USER and BINTRAY_KEY are encrypted!) @@ -25,18 +56,64 @@ env: # capability and encrypt it with travis encrypt --org -r / GH_TOKEN="" # 2) Create 2 OBS tokens with osc token --create network:messaging:zeromq:release- # encrypt them with travis encrypt --org -r / OBS__TOKEN="" - # 3) Uncomment the "secure" lines and paste the encrypted tokens + # 3) Uncomment the three "secure" lines and paste the three generated hashed + # strings, which include each token's name, as parameters - secure: VmpVRSM7UNdF/P6CGac9r+yWYyngU/vBkI1IGPL6gTNm5ctAUzr+ni/3A4K9vHCLXEXFC2BX5XO050e09dw3U/jtG1n463E2JPW/sOmirQZl9N2RPU9fmT07mLWkpNKkPC7P0z/c37z2/xFlDQZ5gwIAnuMKLW1Gzg/XkTVCWh4= - secure: kjO5KenouBNcw41x0+7dLBZ4k/32/EQzx2nM4PbsblAODnnKxI6FDWh+25qvu8YFdItvuoRnISVRORWjEJYBBD6JhEbpCvlcn0tQ7RjeTT4mUEl03qrtEmYtjFJklZ1Wf6m1ZA3fokC1uzyaX4eF+vgO//v8j4UrHcSRrr3s2V0= - secure: dmmMz3OyX9xZF/IoSYJnyZS37KVx5xdL9qkAj8nH10n9w9T+y86WcQx/vYFOEGTufzCV+eAgHRV7hvJyYyA6MdrhrEvytVgYfZTcdYhVOGJxeANxAUCtp1TTY3EEgamGFYSUMMN6U2mowg7qNHzBkAu61bYF+DjcvUTPhoSasJs= + ### Customization note: build/test options matrix: - - BUILD_TYPE=default - - BUILD_TYPE=android - - BUILD_TYPE=cmake - - BUILD_TYPE=check_zproject - - BUILD_TYPE=bindings BINDING=jni + - BUILD_TYPE=default + - BUILD_TYPE=android + - BUILD_TYPE=default-Werror + - BUILD_TYPE=cmake + - BUILD_TYPE=check_zproject + - BUILD_TYPE=bindings BINDING=jni +# - BUILD_TYPE=check-py + +# Prerequisite packages provided by OS distro and used "as is" +pkg_deps_prereqs_distro: &pkg_deps_prereqs_distro + +# Prerequisite packages that may be built from source or used from +# prebuilt packages of that source (usually not from an OS distro) +pkg_deps_prereqs_source: &pkg_deps_prereqs_source + - libzmq3-dev + - libczmq-dev + +pkg_deps_prereqs: &pkg_deps_prereqs + - *pkg_deps_prereqs_source + - *pkg_deps_prereqs_distro + +pkg_deps_doctools: &pkg_deps_doctools + - asciidoc + - xmlto + +pkg_deps_devtools: &pkg_deps_devtools + - git -# osx environment does not have docker +pkg_src_zeromq_ubuntu12: &pkg_src_zeromq_ubuntu12 +- sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_12.04/ ./' + key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_12.04/Release.key' + +pkg_src_zeromq_ubuntu14: &pkg_src_zeromq_ubuntu14 +- sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/ ./' + key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/Release.key' + +# Note: refer to ubuntu14 if you use dist==Trusty +# Also note that as of early 2017, either dist==trusty or services==docker +# is needed for C++11 support; docker envs are usually faster to start up +### Customization note: packages referred by older incarnation hardcoded into this list +addons: + apt: + sources: *pkg_src_zeromq_ubuntu14 + packages: &pkg_deps_common + - *pkg_deps_devtools + - *pkg_deps_prereqs + - uuid-dev + - zproject + +### Customization note: build/test options +### Note: osx environment does not have docker matrix: exclude: - os: osx @@ -44,18 +121,23 @@ matrix: - os: osx env: BUILD_TYPE=bindings BINDING=jni include: + - env: BUILD_TYPE=default-with-docs + os: linux + addons: + apt: + sources: *pkg_src_zeromq_ubuntu14 + packages: + - *pkg_deps_common + - *pkg_deps_doctools - env: BUILD_TYPE=valgrind os: linux dist: trusty addons: apt: - sources: - - sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/ ./' - key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/Release.key' + sources: *pkg_src_zeromq_ubuntu14 packages: - - uuid-dev - valgrind - - libczmq-dev + - *pkg_deps_common - env: BUILD_TYPE=check_zproto os: linux dist: trusty @@ -70,27 +152,46 @@ matrix: apt: packages: - python3 + - env: BUILD_TYPE=default ADDRESS_SANITIZER=enabled + os: linux + dist: trusty + addons: + apt: + sources: *pkg_src_zeromq_ubuntu14 + packages: + - *pkg_deps_common + - env: BUILD_TYPE=cmake DO_CLANG_FORMAT_CHECK=1 CLANG_FORMAT=clang-format-5.0 +# For non-cmake users, there is an autotools solution with a bit more overhead +# to have dependencies ready and pass configure script before making this check). +# Note that the autotools variant will also require dependencies preinstalled to +# pass its configure script: +# - env: BUILD_TYPE=clang-format-check CLANG_FORMAT=clang-format-5.0 + os: linux + dist: trusty + addons: + apt: + sources: + - llvm-toolchain-trusty-5.0 + packages: + - clang-5.0 + - clang-format-5.0 +#autotools# - *pkg_deps_prereqs -addons: - apt: - sources: - - sourceline: 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/ ./' - key_url: 'http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_14.04/Release.key' - packages: - - uuid-dev - - zproject - - libczmq-dev - +### Customization note: python binding before_install: -- if [ $TRAVIS_OS_NAME == "osx" -a $BUILD_TYPE == "android" ] ; then brew install binutils ; fi -- if [ $TRAVIS_OS_NAME == "osx" -a $BUILD_TYPE == "bindings" -a $BINDING == "python" ] ; then brew upgrade python; brew install python@2 ; fi +- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "android" ] ; then brew install binutils ; fi +- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "valgrind" ] ; then brew install valgrind ; fi +- if [ "$TRAVIS_OS_NAME" == "osx" -a "$BUILD_TYPE" == "bindings" -a "$BINDING" == "python" ] ; then brew upgrade python; brew install python@2 ; fi -# Build and check this project according to the BUILD_TYPE -script: "./ci_build.sh" -before_deploy: . ./ci_deploy.sh +# Hand off to generated script for each BUILD_TYPE +### Customization note: credentials and condition for deploy +script: ./ci_build.sh +before_deploy: . ./ci_deploy.sh && ./ci_deploy_obs.sh deploy: provider: releases api_key: + # To encrypt your access token run: `travis encrypt -r user/repo` + # secure: secure: "k0AHi/KbT5uRiugRQdHG4B8Le5Q/clTFM7dwS3V+c5xjCsAa8UOgi4Q/rYEm2EfjnsItg/qtRYn9rJ/9XqahBcIhQKwMFHntblUY7gRYz6CCT0EpRnZkU+hczUvXjzTIIxs1d3goMCdFlfmIz+9aRh/o8LyzgoIF5Fd6AJWX4JY=" file_glob: true file: ${ZYRE_DEPLOYMENT} diff --git a/Dockerfile b/Dockerfile index 70f77e5c9..89c227a85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,18 +10,18 @@ RUN chmod 0440 /etc/sudoers.d/zmq USER zmq -WORKDIR /home/zmq +WORKDIR /home/zmq/tmp-deps RUN git clone --quiet https://github.com/zeromq/libzmq.git libzmq -WORKDIR /home/zmq/libzmq +WORKDIR /home/zmq/tmp-deps/libzmq RUN ./autogen.sh 2> /dev/null RUN ./configure --quiet --without-docs RUN make RUN sudo make install RUN sudo ldconfig -WORKDIR /home/zmq +WORKDIR /home/zmq/tmp-deps RUN git clone --quiet https://github.com/zeromq/czmq.git czmq -WORKDIR /home/zmq/czmq +WORKDIR /home/zmq/tmp-deps/czmq RUN ./autogen.sh 2> /dev/null RUN ./configure --quiet --without-docs RUN make diff --git a/Jenkinsfile b/Jenkinsfile index b23a64638..82e0b8a94 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,39 +9,529 @@ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + + NOTE : This Jenkins pipeline script only handles the self-testing of your + project. If you also want the successful codebase published or deployed, + you can define a helper job - see the reference implementation skeleton at + https://github.com/zeromq/zproject/blob/master/Jenkinsfile-deploy.example + */ pipeline { - agent any + agent any + parameters { + // Use DEFAULT_DEPLOY_BRANCH_PATTERN and DEFAULT_DEPLOY_JOB_NAME if + // defined in this jenkins setup -- in Jenkins Management Web-GUI + // see Configure System / Global properties / Environment variables + // Default (if unset) is empty => no deployment attempt after good test + // See zproject Jenkinsfile-deploy.example for an example deploy job. + // TODO: Try to marry MultiBranchPipeline support with pre-set defaults + // directly in MultiBranchPipeline plugin, or mechanism like Credentials, + // or a config file uploaded to master for all jobs or this job, see + // https://jenkins.io/doc/pipeline/examples/#configfile-provider-plugin + string ( + defaultValue: '${DEFAULT_DEPLOY_BRANCH_PATTERN}', + description: 'Regular expression of branch names for which a deploy action would be attempted after a successful build and test; leave empty to not deploy. Reasonable value is ^(master|release/.*|feature/*)$', + name : 'DEPLOY_BRANCH_PATTERN') + string ( + defaultValue: '${DEFAULT_DEPLOY_JOB_NAME}', + description: 'Name of your job that handles deployments and should accept arguments: DEPLOY_GIT_URL DEPLOY_GIT_BRANCH DEPLOY_GIT_COMMIT -- and it is up to that job what to do with this knowledge (e.g. git archive + push to packaging); leave empty to not deploy', + name : 'DEPLOY_JOB_NAME') + booleanParam ( + defaultValue: true, + description: 'If the deployment is done, should THIS job wait for it to complete and include its success or failure as the build result (true), or should it schedule the job and exit quickly to free up the executor (false)', + name: 'DEPLOY_REPORT_RESULT') + booleanParam ( + defaultValue: true, + description: 'Attempt stable build without DRAFT API in this run?', + name: 'DO_BUILD_WITHOUT_DRAFT_API') + booleanParam ( + defaultValue: true, + description: 'Attempt build with DRAFT API in this run?', + name: 'DO_BUILD_WITH_DRAFT_API') + choice ( + choices: 'auto\nyes\nno', + description: 'Enable pedantic compiler options for common builds (auto turns into yes for GCC builds)?', + name: 'ENABLE_WERROR') + booleanParam ( + defaultValue: false, + description: 'Attempt a build with docs in this run? (Note: corresponding tools are required in the build environment)', + name: 'DO_BUILD_DOCS') + booleanParam ( + defaultValue: false, + description: 'Publish as an archive a "dist" tarball from a build with docs in this run? (Note: corresponding tools are required in the build environment; enabling this enforces DO_BUILD_DOCS too)', + name: 'DO_DIST_DOCS') + booleanParam ( + defaultValue: true, + description: 'Attempt "make check" in this run?', + name: 'DO_TEST_CHECK') + booleanParam ( + defaultValue: true, + description: 'Attempt "make memcheck" in this run?', + name: 'DO_TEST_MEMCHECK') + booleanParam ( + defaultValue: true, + description: 'Attempt "make distcheck" in this run?', + name: 'DO_TEST_DISTCHECK') + booleanParam ( + defaultValue: true, + description: 'Attempt a "make install" check in this run?', + name: 'DO_TEST_INSTALL') + string ( + defaultValue: "`pwd`/tmp/_inst", + description: 'If attempting a "make install" check in this run, what DESTDIR to specify? (absolute path, defaults to "BUILD_DIR/tmp/_inst")', + name: 'USE_TEST_INSTALL_DESTDIR') + booleanParam ( + defaultValue: true, + description: 'Attempt "cppcheck" analysis before this run? (Note: corresponding tools are required in the build environment)', + name: 'DO_CPPCHECK') + booleanParam ( + defaultValue: true, + description: 'Require that there are no files not discovered changed/untracked via .gitignore after builds and tests?', + name: 'CI_REQUIRE_GOOD_GITIGNORE') + booleanParam ( + defaultValue: true, + description: 'Attempt "clang-format" (v5+) analysis before this run? (Note: corresponding tools are required in the build environment)', + name: 'DO_CHECK_CLANG_FORMAT') + booleanParam ( + defaultValue: false, + description: 'Require that if clang-format is executed, then it must show no differences in codebase?', + name: 'CI_REQUIRE_GOOD_CLANG_FORMAT') + string ( + defaultValue: "", + description: 'The clang-format program (v5+) to use for this build, e.g. clang-format-5.0; an empty value means configure-time guesswork', + name: 'CLANG_FORMAT') + string ( + defaultValue: "30", + description: 'When running tests, use this timeout (in minutes; be sure to leave enough for double-job of a distcheck too)', + name: 'USE_TEST_TIMEOUT') + booleanParam ( + defaultValue: false, + description: 'Try to collect CCACHE logs in the build workspace during this run, to analyze the build behavior?', + name: 'USE_CCACHE_LOGGING') + booleanParam ( + defaultValue: true, + description: 'When using temporary subdirs in build/test workspaces, wipe them right after each successful build stage?', + name: 'DO_CLEANUP_AFTER_BUILD') + booleanParam ( + defaultValue: true, + description: 'When using temporary subdirs in build/test workspaces, wipe them after the whole job is done successfully?', + name: 'DO_CLEANUP_AFTER_JOB') + booleanParam ( + defaultValue: false, + description: 'When using temporary subdirs in build/test workspaces, wipe them after the whole job is done unsuccessfully (failed)? Note this would not allow postmortems on CI server, but would conserve its disk space.', + name: 'DO_CLEANUP_AFTER_FAILED_JOB') + } triggers { pollSCM 'H/5 * * * *' } +// Note: your Jenkins setup may benefit from similar setup on side of agents: +// PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/bin:/bin:${PATH}" stages { + stage ('prepare') { + steps { + dir("tmp") { + sh 'if [ -s Makefile ]; then make -k distclean || true ; fi' + sh 'chmod -R u+w .' + deleteDir() + } + sh './autogen.sh' + sh 'rm -f ccache.log' + stash (name: 'prepped', includes: '**/*', excludes: '**/cppcheck.xml') + } + } stage ('compile') { - steps { - sh './autogen.sh' - sh './configure' - sh 'make' + parallel { + stage ('build with DRAFT') { + when { expression { return ( params.DO_BUILD_WITH_DRAFT_API ) } } + steps { + dir("tmp/build-withDRAFT") { + deleteDir() + unstash 'prepped' + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then rm -f ccache.log ; CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; ./configure --enable-drafts=yes --enable-Werror="${params.ENABLE_WERROR}" --with-docs=no""" + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; make -k -j4 || make""" + sh """ echo "Are GitIgnores good after make with drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + stash (name: 'built-draft', includes: '**/*', excludes: '**/cppcheck.xml') + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('build without DRAFT') { + when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API ) } } + steps { + dir("tmp/build-withoutDRAFT") { + deleteDir() + unstash 'prepped' + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then rm -f ccache.log ; CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; ./configure --enable-drafts=no --enable-Werror="${params.ENABLE_WERROR}" --with-docs=no""" + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; make -k -j4 || make""" + sh """ echo "Are GitIgnores good after make without drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + stash (name: 'built-nondraft', includes: '**/*', excludes: '**/cppcheck.xml') + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('build with DOCS') { + when { expression { return ( params.DO_BUILD_DOCS || params.DO_DIST_DOCS ) } } + steps { + dir("tmp/build-DOCS") { + deleteDir() + unstash 'prepped' + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then rm -f ccache.log ; CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; ./configure --enable-drafts=yes --with-docs=yes --enable-Werror=no""" + script { + if ( params.DO_DIST_DOCS ) { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; make dist-gzip || exit ; DISTFILE="`ls -1tc *.tar.gz | head -1`" && [ -n "\$DISTFILE" ] && [ -s "\$DISTFILE" ] || exit ; mv -f "\$DISTFILE" __dist.tar.gz""" + archiveArtifacts artifacts: '__dist.tar.gz' + sh "rm -f __dist.tar.gz" + } + } + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; make -k -j4 || make""" + sh """ echo "Are GitIgnores good after make with docs?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + stash (name: 'built-docs', includes: '**/*', excludes: '**/cppcheck.xml') + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } } } stage ('check') { - steps { - timeout (time: 5, unit: MINUTES) { - sh 'make check' + parallel { + stage ('cppcheck') { + when { expression { return ( params.DO_CPPCHECK ) } } + steps { + dir("tmp/test-cppcheck") { + deleteDir() + script { + // We need a configured source codebase to run + // "make", any variant will do. Save some time + // by using a build tree (if exists), but can + // fall back to running the configure script + // explicitly. + if ( params.DO_BUILD_WITH_DRAFT_API ) { + unstash 'built-draft' + } else if ( params.DO_BUILD_WITHOUT_DRAFT_API ) { + unstash 'built-nondraft' + } else if ( params.DO_BUILD_DOCS || params.DO_DIST_DOCS ) { + unstash 'built-docs' + } else { + unstash 'prepped' + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then rm -f ccache.log ; CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; ./configure --enable-drafts=no --enable-Werror="${params.ENABLE_WERROR}" --with-docs=no""" + } + } + sh 'rm -f cppcheck.xml' + // This make target should produce a cppcheck.xml if tool is available + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; make cppcheck""" + archiveArtifacts artifacts: '**/cppcheck.xml', allowEmptyArchive: true + sh 'rm -f cppcheck.xml' + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } } - } - } - stage ('memcheck') { - steps { - timeout (time: 5, unit: MINUTES) { - sh 'make memcheck' + stage ('clang-format-check') { + when { expression { return ( params.DO_CHECK_CLANG_FORMAT ) } } + steps { + dir("tmp/test-clang-format-check") { + deleteDir() + script { + // We need a configured source codebase to run + // "make", any variant will do. Save some time + // by using a build tree (if exists), but can + // fall back to running the configure script + // explicitly. + if ( params.DO_BUILD_WITH_DRAFT_API ) { + unstash 'built-draft' + } else if ( params.DO_BUILD_WITHOUT_DRAFT_API ) { + unstash 'built-nondraft' + } else if ( params.DO_BUILD_DOCS || params.DO_DIST_DOCS ) { + unstash 'built-docs' + } else { + unstash 'prepped' + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then rm -f ccache.log ; CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; ./configure --enable-drafts=no --enable-Werror="${params.ENABLE_WERROR}" --with-docs=no""" + } + } + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; make clang-format-check-CI""" + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('check with DRAFT') { + when { expression { return ( params.DO_BUILD_WITH_DRAFT_API && params.DO_TEST_CHECK ) } } + steps { + dir("tmp/test-check-withDRAFT") { + script { + def RETRY_NUMBER = 0 + deleteDir() + unstash 'built-draft' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + try { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\$LD_LIBRARY_PATH" check""" + } + catch (Exception e) { + currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve" + sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`""" + archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmptyArchive: true + throw e + } + } + } + sh """ echo "Are GitIgnores good after make check with drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('check without DRAFT') { + when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API && params.DO_TEST_CHECK ) } } + steps { + dir("tmp/test-check-withoutDRAFT") { + script { + def RETRY_NUMBER = 0 + deleteDir() + unstash 'built-nondraft' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + try { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\$LD_LIBRARY_PATH" check""" + } + catch (Exception e) { + currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve" + sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`""" + archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmptyArchive: true + throw e + } + } + } + sh """ echo "Are GitIgnores good after make check without drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('memcheck with DRAFT') { + when { expression { return ( params.DO_BUILD_WITH_DRAFT_API && params.DO_TEST_MEMCHECK ) } } + steps { + dir("tmp/test-memcheck-withDRAFT") { + script { + def RETRY_NUMBER = 0 + deleteDir() + unstash 'built-draft' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + try { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\$LD_LIBRARY_PATH" memcheck && exit 0 ; echo "Re-running failed (\$?) memcheck with greater verbosity" >&2 ; make LD_LIBRARY_PATH="\$LD_LIBRARY_PATH" VERBOSE=1 memcheck-verbose""" + } + catch (Exception e) { + currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve" + sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`""" + archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmptyArchive: true + throw e + } + } + } + sh """ echo "Are GitIgnores good after make memcheck with drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('memcheck without DRAFT') { + when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API && params.DO_TEST_MEMCHECK ) } } + steps { + dir("tmp/test-memcheck-withoutDRAFT") { + script { + def RETRY_NUMBER = 0 + deleteDir() + unstash 'built-nondraft' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + try { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\$LD_LIBRARY_PATH" memcheck && exit 0 ; echo "Re-running failed (\$?) memcheck with greater verbosity" >&2 ; make LD_LIBRARY_PATH="\$LD_LIBRARY_PATH" VERBOSE=1 memcheck-verbose""" + } + catch (Exception e) { + currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve" + sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`""" + archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmptyArchive: true + throw e + } + } + } + sh """ echo "Are GitIgnores good after make memcheck without drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('distcheck with DRAFT') { + when { expression { return ( params.DO_BUILD_WITH_DRAFT_API && params.DO_TEST_DISTCHECK ) } } + steps { + dir("tmp/test-distcheck-withDRAFT") { + script { + def RETRY_NUMBER = 0 + deleteDir() + unstash 'built-draft' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + try { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; DISTCHECK_CONFIGURE_FLAGS="--enable-drafts=yes --with-docs=no" ; export DISTCHECK_CONFIGURE_FLAGS; make DISTCHECK_CONFIGURE_FLAGS="\$DISTCHECK_CONFIGURE_FLAGS" LD_LIBRARY_PATH="\$LD_LIBRARY_PATH" distcheck""" + } + catch (Exception e) { + currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve" + sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`""" + archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmptyArchive: true + throw e + } + } + } + sh """ echo "Are GitIgnores good after make distcheck with drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('distcheck without DRAFT') { + when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API && params.DO_TEST_DISTCHECK ) } } + steps { + dir("tmp/test-distcheck-withoutDRAFT") { + script { + def RETRY_NUMBER = 0 + deleteDir() + unstash 'built-nondraft' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + try { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH; DISTCHECK_CONFIGURE_FLAGS="--enable-drafts=no --with-docs=no" ; export DISTCHECK_CONFIGURE_FLAGS; make DISTCHECK_CONFIGURE_FLAGS="\$DISTCHECK_CONFIGURE_FLAGS" LD_LIBRARY_PATH="\$LD_LIBRARY_PATH" distcheck""" + } + catch (Exception e) { + currentBuild.result = 'UNSTABLE' // Jenkins should not let the verdict "improve" + sh """D="`pwd`"; B="`basename "\$D"`" ; [ "${RETRY_NUMBER}" -gt 0 ] && T="_try-${RETRY_NUMBER}" || T="" ; tar czf "test-suite_${BUILD_TAG}_\${B}\${T}.tar.gz" `find . -name '*.trs'` `find . -name '*.log'`""" + archiveArtifacts artifacts: "**/test-suite*.tar.gz", allowEmptyArchive: true + throw e + } + } + } + sh """ echo "Are GitIgnores good after make distcheck without drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('install with DRAFT') { + when { expression { return ( params.DO_BUILD_WITH_DRAFT_API && params.DO_TEST_INSTALL ) } } + steps { + dir("tmp/test-install-withDRAFT") { + deleteDir() + unstash 'built-draft' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}" DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}/withDRAFT" install""" + } + sh """cd "${params.USE_TEST_INSTALL_DESTDIR}/withDRAFT" && find . -ls""" + sh """ echo "Are GitIgnores good after make install with drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('install without DRAFT') { + when { expression { return ( params.DO_BUILD_WITHOUT_DRAFT_API && params.DO_TEST_INSTALL ) } } + steps { + dir("tmp/test-install-withoutDRAFT") { + deleteDir() + unstash 'built-nondraft' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}" DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}/withoutDRAFT" install""" + } + sh """cd "${params.USE_TEST_INSTALL_DESTDIR}/withoutDRAFT" && find . -ls""" + sh """ echo "Are GitIgnores good after make install without drafts?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } + } + stage ('install with DOCS') { + when { expression { return ( params.DO_BUILD_DOCS && params.DO_TEST_INSTALL ) } } + steps { + dir("tmp/test-install-withDOCS") { + deleteDir() + unstash 'built-docs' + timeout (time: "${params.USE_TEST_TIMEOUT}".toInteger(), unit: 'MINUTES') { + sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; if test "${params.USE_CCACHE_LOGGING}" = true ; then CCACHE_LOGFILE="`pwd`/ccache.log" ; export CCACHE_LOGFILE ; fi ; LD_LIBRARY_PATH="`pwd`/src/.libs:\${LD_LIBRARY_PATH}"; export LD_LIBRARY_PATH; make LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}" DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}/withDOCS" install""" + } + sh """cd "${params.USE_TEST_INSTALL_DESTDIR}/withDOCS" && find . -ls""" + sh """ echo "Are GitIgnores good after make install with docs?"; make CI_REQUIRE_GOOD_GITIGNORE="${params.CI_REQUIRE_GOOD_GITIGNORE}" check-gitignore """ + script { + if ( params.DO_CLEANUP_AFTER_BUILD ) { + deleteDir() + } + } + } + } } } } - stage ('distcheck') { + stage ('deploy if appropriate') { steps { - timeout (time: 10, unit: MINUTES) { - sh 'make distcheck' + script { + def myDEPLOY_JOB_NAME = sh(returnStdout: true, script: """echo "${params["DEPLOY_JOB_NAME"]}" """).trim(); + def myDEPLOY_BRANCH_PATTERN = sh(returnStdout: true, script: """echo "${params["DEPLOY_BRANCH_PATTERN"]}" """).trim(); + def myDEPLOY_REPORT_RESULT = sh(returnStdout: true, script: """echo "${params["DEPLOY_REPORT_RESULT"]}" """).trim().toBoolean(); + echo "Original: DEPLOY_JOB_NAME : ${params["DEPLOY_JOB_NAME"]} DEPLOY_BRANCH_PATTERN : ${params["DEPLOY_BRANCH_PATTERN"]} DEPLOY_REPORT_RESULT : ${params["DEPLOY_REPORT_RESULT"]}" + echo "Used: myDEPLOY_JOB_NAME:${myDEPLOY_JOB_NAME} myDEPLOY_BRANCH_PATTERN:${myDEPLOY_BRANCH_PATTERN} myDEPLOY_REPORT_RESULT:${myDEPLOY_REPORT_RESULT}" + if ( (myDEPLOY_JOB_NAME != "") && (myDEPLOY_BRANCH_PATTERN != "") ) { + if ( env.BRANCH_NAME =~ myDEPLOY_BRANCH_PATTERN ) { + def GIT_URL = sh(returnStdout: true, script: """git remote -v | egrep '^origin' | awk '{print \$2}' | head -1""").trim() + def GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse --verify HEAD').trim() + def DIST_ARCHIVE = "" + if ( params.DO_DIST_DOCS ) { DIST_ARCHIVE = env.BUILD_URL + "artifact/__dist.tar.gz" } + build job: "${myDEPLOY_JOB_NAME}", parameters: [ + string(name: 'DEPLOY_GIT_URL', value: "${GIT_URL}"), + string(name: 'DEPLOY_GIT_BRANCH', value: env.BRANCH_NAME), + string(name: 'DEPLOY_GIT_COMMIT', value: "${GIT_COMMIT}"), + string(name: 'DEPLOY_DIST_ARCHIVE', value: "${DIST_ARCHIVE}") + ], quietPeriod: 0, wait: myDEPLOY_REPORT_RESULT, propagate: myDEPLOY_REPORT_RESULT + } else { + echo "Not deploying because branch '${env.BRANCH_NAME}' did not match filter '${myDEPLOY_BRANCH_PATTERN}'" + } + } else { + echo "Not deploying because deploy-job parameters are not set" + } } } } @@ -55,6 +545,11 @@ pipeline { //slackSend (color: "#008800", message: "Build ${env.JOB_NAME} is back to normal.") //emailext (to: "qa@example.com", subject: "Build ${env.JOB_NAME} is back to normal.", body: "Build ${env.JOB_NAME} is back to normal.") } + if ( params.DO_CLEANUP_AFTER_JOB ) { + dir("tmp") { + deleteDir() + } + } } } failure { @@ -63,6 +558,16 @@ pipeline { sleep 1 //slackSend (color: "#AA0000", message: "Build ${env.BUILD_NUMBER} of ${env.JOB_NAME} ${currentBuild.result} (<${env.BUILD_URL}|Open>)") //emailext (to: "qa@example.com", subject: "Build ${env.JOB_NAME} failed!", body: "Build ${env.BUILD_NUMBER} of ${env.JOB_NAME} ${currentBuild.result}\nSee ${env.BUILD_URL}") + + dir("tmp") { + script { + if ( params.DO_CLEANUP_AFTER_FAILED_JOB ) { + deleteDir() + } else { + sh """ echo "NOTE: BUILD AREA OF WORKSPACE `pwd` REMAINS FOR POST-MORTEMS ON `hostname` AND CONSUMES `du -hs . | awk '{print \$1}'` !" """ + } + } + } } } } diff --git a/bindings/jni/.gitignore b/bindings/jni/.gitignore index ef168a65c..13b2d3975 100644 --- a/bindings/jni/.gitignore +++ b/bindings/jni/.gitignore @@ -6,6 +6,3 @@ build/ src/native gradle-app.setting libzyrejni.so -.classpath -.project -.settings/ diff --git a/bindings/jni/ci_build.sh b/bindings/jni/ci_build.sh index 055f22c23..dba201e78 100755 --- a/bindings/jni/ci_build.sh +++ b/bindings/jni/ci_build.sh @@ -39,9 +39,13 @@ if [ -z "${CI_CONFIG_QUIET-}" ] || [ "${CI_CONFIG_QUIET-}" = yes ] || [ "${CI_CO fi pushd ../../.. +rm -rf tmp-deps +mkdir -p tmp-deps # Clone and build dependencies [ -z "$CI_TIME" ] || echo "`date`: Starting build of dependencies (if any)..." +BASE_PWD=${PWD} +cd tmp-deps $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git libzmq cd libzmq git --no-pager log --oneline -n1 @@ -62,8 +66,10 @@ fi $CI_TIME ./configure "${CONFIG_OPTS[@]}" $CI_TIME make -j4 $CI_TIME make install -cd .. +cd ${BASE_PWD} +BASE_PWD=${PWD} +cd tmp-deps $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/czmq.git czmq cd czmq git --no-pager log --oneline -n1 @@ -86,7 +92,7 @@ $CI_TIME make -j4 $CI_TIME make install # Build jni dependency ( cd bindings/jni && TERM=dumb PKG_CONFIG_PATH=$BUILD_PREFIX/lib/pkgconfig $CI_TIME ./gradlew publishToMavenLocal ) -cd .. +cd ${BASE_PWD} popd pushd ../.. diff --git a/bindings/nodejs/build.sh b/bindings/nodejs/build.sh index 0ebd5c46c..209b2586a 100755 --- a/bindings/nodejs/build.sh +++ b/bindings/nodejs/build.sh @@ -37,8 +37,12 @@ done BUILD_ROOT=`pwd` cd ../../.. +rm -rf tmp-deps +mkdir -p tmp-deps # Check dependent projects +BASE_PWD=${PWD} +cd tmp-deps if [ ! -d libzmq ]; then echo "I: cloning https://github.com/zeromq/libzmq.git into `pwd`/libzmq..." git clone $QUIET https://github.com/zeromq/libzmq.git @@ -47,8 +51,11 @@ if [ ! -f libzmq/builds/gyp/project.gyp ]; then echo "E: `pwd`/libzmq out of date (builds/gyp/project.gyp missing)" exit fi +cd ${BASE_PWD} # Check dependent projects +BASE_PWD=${PWD} +cd tmp-deps if [ ! -d czmq ]; then echo "I: cloning https://github.com/zeromq/czmq.git into `pwd`/czmq..." git clone $QUIET https://github.com/zeromq/czmq.git @@ -57,6 +64,7 @@ if [ ! -f czmq/builds/gyp/project.gyp ]; then echo "E: `pwd`/czmq out of date (builds/gyp/project.gyp missing)" exit fi +cd ${BASE_PWD} # Check Node.js dependencies diff --git a/bindings/python_cffi/zyre_cffi/cdefs.py b/bindings/python_cffi/zyre_cffi/cdefs.py index a4e279ab2..cd9d9f29e 100644 --- a/bindings/python_cffi/zyre_cffi/cdefs.py +++ b/bindings/python_cffi/zyre_cffi/cdefs.py @@ -1,6 +1,8 @@ ################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Read the zproject/README.md for information about making permanent changes. # +### NOTE: A block of code below went missing after zproject regeneration; ### +### someone needs to take a look ### ################################################################################ import re zyre_cdefs = list () @@ -3841,6 +3843,10 @@ int zsys_auto_use_fd (void); +// ####################################################################### +// ### NOTE: This block went missing after zproject regeneration; +// ### someone needs to take a look +// ####################################################################### // Print formatted string. Format is specified by variable names // in Python-like format style // @@ -3872,6 +3878,9 @@ // Return error string for given format/args combination. char * zsys_zplprintf_error (const char *format, zconfig_t *args); +// ####################################################################### +// ### NOTE: End of block which went missing after zproject regeneration # +// ####################################################################### // Set log identity, which is a string that prefixes all log messages sent // by this process. The log identity defaults to the environment variable diff --git a/builds/android/ci_build.sh b/builds/android/ci_build.sh index e58d5c09b..e057b6550 100755 --- a/builds/android/ci_build.sh +++ b/builds/android/ci_build.sh @@ -30,10 +30,13 @@ export TOOLCHAIN_NAME="arm-linux-androideabi-$NDK_ABI_VER" export TOOLCHAIN_HOST="arm-linux-androideabi" export TOOLCHAIN_ARCH="arm" -export LIBZMQ_ROOT="/tmp/libzmq" +rm -rf /tmp/tmp-deps +mkdir -p /tmp/tmp-deps + +export LIBZMQ_ROOT="/tmp/tmp-deps/libzmq" git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git $LIBZMQ_ROOT -export CZMQ_ROOT="/tmp/czmq" +export CZMQ_ROOT="/tmp/tmp-deps/czmq" git clone --quiet --depth 1 https://github.com/zeromq/czmq.git $CZMQ_ROOT source ./build.sh diff --git a/builds/check_zproject/ci_build.sh b/builds/check_zproject/ci_build.sh index de81d780a..2ed3021e3 100755 --- a/builds/check_zproject/ci_build.sh +++ b/builds/check_zproject/ci_build.sh @@ -6,14 +6,16 @@ set -ex [ -n "${REPO_DIR-}" ] || exit 1 # Verify all required dependencies with repos can be checked out -cd "$REPO_DIR/.." +rm -rf "$REPO_DIR/../tmp-deps" +mkdir -p "$REPO_DIR/../tmp-deps" +cd "$REPO_DIR/../tmp-deps" git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git libzmq git clone --quiet --depth 1 https://github.com/zeromq/czmq.git czmq cd - if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list zproject >/dev/null 2>&1) || \ (command -v brew >/dev/null 2>&1 && brew ls --versions zproject >/dev/null 2>&1)); then - cd "$REPO_DIR/.." + cd "$REPO_DIR/../tmp-deps" git clone --quiet --depth 1 https://github.com/zeromq/zproject zproject cd zproject PATH="`pwd`:$PATH" @@ -21,7 +23,7 @@ fi if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list generator-scripting-language >/dev/null 2>&1) || \ (command -v brew >/dev/null 2>&1 && brew ls --versions gsl >/dev/null 2>&1)); then - cd "$REPO_DIR/.." + cd "$REPO_DIR/../tmp-deps" git clone https://github.com/zeromq/gsl.git gsl cd gsl/src make diff --git a/builds/cmake/ci_build.sh b/builds/cmake/ci_build.sh index a7981a80d..5568bc506 100755 --- a/builds/cmake/ci_build.sh +++ b/builds/cmake/ci_build.sh @@ -24,9 +24,14 @@ LC_ALL=C export LANG LC_ALL if [ -d "./tmp" ]; then + # Proto installation area for this project and its deps rm -rf ./tmp fi -mkdir -p tmp +if [ -d "./tmp-deps" ]; then + # Checkout/unpack and build area for dependencies + rm -rf ./tmp-deps +fi +mkdir -p tmp tmp-deps BUILD_PREFIX=$PWD/tmp # Use tools from prerequisites we might have built @@ -59,8 +64,9 @@ fi [ -z "$CI_TIME" ] || echo "`date`: Starting build of dependencies (if any)..." if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libzmq3-dev >/dev/null 2>&1) || \ (command -v brew >/dev/null 2>&1 && brew ls --versions libzmq >/dev/null 2>&1)); then - $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git libzmq BASE_PWD=${PWD} + cd tmp-deps + $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git libzmq cd libzmq CCACHE_BASEDIR=${PWD} export CCACHE_BASEDIR @@ -86,8 +92,9 @@ if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libzmq3-dev >/ fi if ! ((command -v dpkg-query >/dev/null 2>&1 && dpkg-query --list libczmq-dev >/dev/null 2>&1) || \ (command -v brew >/dev/null 2>&1 && brew ls --versions czmq >/dev/null 2>&1)); then - $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/czmq.git czmq BASE_PWD=${PWD} + cd tmp-deps + $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/czmq.git czmq cd czmq CCACHE_BASEDIR=${PWD} export CCACHE_BASEDIR diff --git a/builds/rpi/build.sh b/builds/rpi/build.sh index 3941546ec..9ad901c8f 100755 --- a/builds/rpi/build.sh +++ b/builds/rpi/build.sh @@ -53,7 +53,16 @@ if [ $UPDATE ]; then fi # Cross build for the Raspberry Pi -mkdir -p $PWD/tmp +if [ -d "./tmp" ]; then + # Proto installation area for this project and its deps + rm -rf ./tmp +fi +if [ -d "./tmp-deps" ]; then + # Checkout/unpack and build area for dependencies + rm -rf ./tmp-deps +fi +mkdir -p tmp tmp-deps + BUILD_PREFIX=$PWD/tmp TOOLCHAIN_HOST="arm-linux-gnueabihf" TOOLCHAIN_PATH="${PWD}/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin" @@ -95,6 +104,8 @@ CONFIG_OPTS+=("RANLIB=${RANLIB}") if [ ! $INCREMENTAL ]; then # Clone and build dependencies + BASE_PWD=${PWD} + cd tmp-deps if [ ! -e libzmq ]; then $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git libzmq fi @@ -123,7 +134,10 @@ if [ ! $INCREMENTAL ]; then $CI_TIME make install ) || exit 1 popd + cd ${BASE_PWD} + BASE_PWD=${PWD} + cd tmp-deps if [ ! -e czmq ]; then $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/czmq.git czmq fi @@ -152,6 +166,7 @@ if [ ! $INCREMENTAL ]; then $CI_TIME make install ) || exit 1 popd + cd ${BASE_PWD} fi diff --git a/ci_build.sh b/ci_build.sh index a56dcd918..894ebbfbc 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -32,9 +32,14 @@ default|default-Werror|default-with-docs|valgrind|clang-format-check) export LANG LC_ALL if [ -d "./tmp" ]; then + # Proto installation area for this project and its deps rm -rf ./tmp fi - mkdir -p tmp + if [ -d "./tmp-deps" ]; then + # Checkout/unpack and build area for dependencies + rm -rf ./tmp-deps + fi + mkdir -p tmp tmp-deps BUILD_PREFIX=$PWD/tmp PATH="`echo "$PATH" | sed -e 's,^/usr/lib/ccache/?:,,' -e 's,:/usr/lib/ccache/?:,,' -e 's,:/usr/lib/ccache/?$,,' -e 's,^/usr/lib/ccache/?$,,'`" @@ -183,8 +188,9 @@ default|default-Werror|default-with-docs|valgrind|clang-format-check) echo "" BASE_PWD=${PWD} echo "`date`: INFO: Building prerequisite 'libzmq' from Git repository..." >&2 + cd ./tmp-deps $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/libzmq.git libzmq - cd libzmq + cd ./libzmq CCACHE_BASEDIR=${PWD} export CCACHE_BASEDIR git --no-pager log --oneline -n1 @@ -215,8 +221,9 @@ default|default-Werror|default-with-docs|valgrind|clang-format-check) echo "" BASE_PWD=${PWD} echo "`date`: INFO: Building prerequisite 'czmq' from Git repository..." >&2 + cd ./tmp-deps $CI_TIME git clone --quiet --depth 1 https://github.com/zeromq/czmq.git czmq - cd czmq + cd ./czmq CCACHE_BASEDIR=${PWD} export CCACHE_BASEDIR git --no-pager log --oneline -n1 diff --git a/include/zyre_library.h b/include/zyre_library.h index 576405ef5..0b8ca6e8c 100644 --- a/include/zyre_library.h +++ b/include/zyre_library.h @@ -35,7 +35,6 @@ #define ZYRE_VERSION \ ZYRE_MAKE_VERSION(ZYRE_VERSION_MAJOR, ZYRE_VERSION_MINOR, ZYRE_VERSION_PATCH) - #if defined (__WINDOWS__) # if defined ZYRE_STATIC # define ZYRE_EXPORT diff --git a/src/zyre_classes.h b/src/zyre_classes.h index 0e565c924..51ba470e0 100644 --- a/src/zyre_classes.h +++ b/src/zyre_classes.h @@ -51,7 +51,6 @@ typedef struct _zyre_node_t zyre_node_t; // Internal API - #include "zre_msg.h" #include "zyre_peer.h" #include "zyre_group.h"