aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bootstrap/buildenv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootstrap/buildenv.sh')
-rwxr-xr-xscripts/bootstrap/buildenv.sh15
1 files changed, 14 insertions, 1 deletions
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"
}