Skip to content

Commit

Permalink
Adding java support for shared thirdparty
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bmatican committed Apr 25, 2018
1 parent c52c55e commit c560765
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build-support/common-build-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build-support/jenkins/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
3 changes: 3 additions & 0 deletions java/yb-client/dev-support/build-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion yb_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c560765

Please sign in to comment.