diff options
-rwxr-xr-x | compile.sh | 4 | ||||
-rwxr-xr-x | scripts/bootstrap/bootstrap.sh | 10 | ||||
-rwxr-xr-x | scripts/bootstrap/buildenv.sh | 15 | ||||
-rwxr-xr-x | scripts/bootstrap/compile.sh | 1 |
4 files changed, 25 insertions, 5 deletions
diff --git a/compile.sh b/compile.sh index 4daeb3ae54..53fc4127b9 100755 --- a/compile.sh +++ b/compile.sh @@ -189,7 +189,9 @@ if [ $DO_TESTS ]; then fi fi fi - $BAZEL --bazelrc=${BAZELRC} --nomaster_bazelrc test \ + $BAZEL --bazelrc=${BAZELRC} --nomaster_bazelrc \ + ${BAZEL_DIR_STARTUP_OPTIONS} \ + test \ --test_tag_filters="${BAZEL_TEST_FILTERS-}" \ --build_tests_only \ --nolegacy_bazel_java_test \ diff --git a/scripts/bootstrap/bootstrap.sh b/scripts/bootstrap/bootstrap.sh index d11b6c5086..e6143f7c0d 100755 --- a/scripts/bootstrap/bootstrap.sh +++ b/scripts/bootstrap/bootstrap.sh @@ -54,7 +54,7 @@ if [ -z "${BAZEL-}" ]; then } else function bazel_build() { - ${BAZEL} --bazelrc=${BAZELRC} build \ + ${BAZEL} --bazelrc=${BAZELRC} ${BAZEL_DIR_STARTUP_OPTIONS} build \ ${BAZEL_ARGS-} \ --verbose_failures \ --javacopt="-source ${JAVA_VERSION} -target ${JAVA_VERSION}" \ @@ -89,9 +89,13 @@ function bootstrap_test() { STRATEGY= fi [ -x "${BAZEL_BIN}" ] || fail "syntax: bootstrap bazel-binary" - run ${BAZEL_BIN} --nomaster_bazelrc --bazelrc=${BAZELRC} clean \ + run ${BAZEL_BIN} --nomaster_bazelrc --bazelrc=${BAZELRC} \ + ${BAZEL_DIR_STARTUP_OPTIONS} \ + clean \ --expunge || return $? - run ${BAZEL_BIN} --nomaster_bazelrc --bazelrc=${BAZELRC} build \ + run ${BAZEL_BIN} --nomaster_bazelrc --bazelrc=${BAZELRC} \ + ${BAZEL_DIR_STARTUP_OPTIONS} \ + build \ ${EXTRA_BAZEL_ARGS-} ${STRATEGY} \ --fetch --nostamp \ --define "JAVA_VERSION=${JAVA_VERSION}" \ diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh index 6efa3556c8..6c851b00c8 100755 --- a/scripts/bootstrap/buildenv.sh +++ b/scripts/bootstrap/buildenv.sh @@ -18,6 +18,19 @@ set -o errexit +# If BAZEL_WRKDIR is set, default all variables to point into +# that directory + +if [ -n "${BAZEL_WRKDIR}" ] ; then + mkdir -p "${BAZEL_WRKDIR}/tmp" + mkdir -p "${BAZEL_WRKDIR}/user_root" + : ${TMPDIR:=${BAZEL_WRKDIR}/tmp} + export TMPDIR + : ${BAZEL_DIR_STARTUP_OPTIONS:="--output_user_root=${BAZEL_WRKDIR}/user_root"} +fi + + +# Set standard variables DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) WORKSPACE_DIR="$(dirname $(dirname ${DIR}))" @@ -245,6 +258,6 @@ function get_java_version() { # Return the target that a bind point to, using Bazel query. function get_bind_target() { - $BAZEL --bazelrc=${BAZELRC} --nomaster_bazelrc \ + $BAZEL --bazelrc=${BAZELRC} --nomaster_bazelrc ${BAZEL_DIR_STARTUP_OPTIONS} \ query "deps($1, 1) - $1" } diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh index 2cb8e58710..ff81f2707b 100755 --- a/scripts/bootstrap/compile.sh +++ b/scripts/bootstrap/compile.sh @@ -277,6 +277,7 @@ function bootstrap_build() { --install_md5= \ --workspace_directory=${PWD} \ --nofatal_event_bus_exceptions \ + ${BAZEL_DIR_STARTUP_OPTIONS} \ build \ --ignore_unsupported_sandboxing \ --startup_time=329 --extract_data_time=523 \ |