From c560765b75de66782fe798481e5ab102b6f2c6bc Mon Sep 17 00:00:00 2001 From: Bogdan Matican Date: Wed, 25 Apr 2018 02:24:34 +0000 Subject: [PATCH] Adding java support for shared thirdparty Summary: Enable using our shared NFS thirdparty, if available, during the java mvn steps as well. Test Plan: Using `mvn clean package`: - On NFS: `[WARNING] PROTOC: [2018-04-25T02:23:40 common-build-env.sh:1354 find_shared_thirdparty_dir] Using existing third-party dependencies from /n/jenkins/thirdparty/yugabyte-thirdparty-2018-04-17T11_16_55/thirdparty` - On my mac: `[WARNING] PROTOC: [2018-04-24T19:26:44 common-build-env.sh:1342 find_shared_thirdparty_dir] Parent directory for shared third-party directories ('/n/jenkins/thirdparty') does not exist, cannot use pre-built third-party directory from there.` Reviewers: mikhail Reviewed By: mikhail Subscribers: ybase Differential Revision: https://phabricator.dev.yugabyte.com/D4675 --- build-support/common-build-env.sh | 2 +- build-support/jenkins/build-and-test.sh | 2 +- java/yb-client/dev-support/build-proto.sh | 3 +++ yb_build.sh | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build-support/common-build-env.sh b/build-support/common-build-env.sh index b82014c71cb1..963def1f4a49 100644 --- a/build-support/common-build-env.sh +++ b/build-support/common-build-env.sh @@ -1335,7 +1335,7 @@ read_file_and_trim() { # In our internal environment we build third-party dependencies in separate directories on NFS # so that we can use them across many builds. -find_shared_thirdparty_dir() { +find_thirdparty_dir() { found_shared_thirdparty_dir=false local parent_dir_for_shared_thirdparty=$NFS_PARENT_DIR_FOR_SHARED_THIRDPARTY if [[ ! -d $parent_dir_for_shared_thirdparty ]]; then diff --git a/build-support/jenkins/build-and-test.sh b/build-support/jenkins/build-and-test.sh index 06f755c96244..e26e82a6702b 100755 --- a/build-support/jenkins/build-and-test.sh +++ b/build-support/jenkins/build-and-test.sh @@ -287,7 +287,7 @@ fi configure_remote_build if "$using_default_thirdparty_dir"; then - find_shared_thirdparty_dir + find_thirdparty_dir if ! "$found_shared_thirdparty_dir"; then if [[ ${NO_REBUILD_THIRDPARTY:-} == "1" ]]; then log "Skiping third-party build because NO_REBUILD_THIRDPARTY is set." diff --git a/java/yb-client/dev-support/build-proto.sh b/java/yb-client/dev-support/build-proto.sh index f837c07ac015..ff572f0f537e 100755 --- a/java/yb-client/dev-support/build-proto.sh +++ b/java/yb-client/dev-support/build-proto.sh @@ -39,6 +39,9 @@ . "${BASH_SOURCE%/*}/../../../build-support/common-build-env.sh" +# In case we are on NFS, try to use the shared thirdparty, if possible. +find_thirdparty_dir + PROTOC_BIN=$YB_THIRDPARTY_DIR/installed/uninstrumented/bin/protoc if [[ ! -f $PROTOC_BIN ]]; then if which protoc > /dev/null; then diff --git a/yb_build.sh b/yb_build.sh index 37cdd55b57ae..a597b0327eab 100755 --- a/yb_build.sh +++ b/yb_build.sh @@ -881,7 +881,7 @@ if [[ ${YB_SKIP_BUILD:-} == "1" ]]; then fi if "$use_shared_thirdparty" || [[ -f $YB_SRC_ROOT/thirdparty/.yb_thirdparty_do_not_use ]]; then - find_shared_thirdparty_dir + find_thirdparty_dir fi configure_remote_build