aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bootstrap
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2016-10-17 16:47:55 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-10-18 10:56:57 +0000
commit286cfdd54791cc869526506dc94a24b2c93e2fee (patch)
treef9d7400867506f3813c401d2fec80404703ad065 /scripts/bootstrap
parent80bb0f27a435974ac5105361bf79637aba519f98 (diff)
Fix permissions before overwriting files
In our bazel-srcs tar ball, files are packed with permissions 550. Copying into a temporary directory may preserve permissions. So, when overwriting one of those files in the temporary directory, grant the user write permissions before writing to that file. Otherwise, bootstrapping from //:bazel-srcs via ./compile.sh as normal user will fail on some systems. -- Change-Id: I70b4645c9bc3c25b9fd356bacdb959205c64b931 Reviewed-on: https://bazel-review.googlesource.com/#/c/6695 MOS_MIGRATED_REVID=136360945
Diffstat (limited to 'scripts/bootstrap')
-rwxr-xr-xscripts/bootstrap/compile.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index 123d050a96..d897a4b7b3 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -201,6 +201,7 @@ if [ -z "${BAZEL_SKIP_JAVA_COMPILATION}" ]; then
done
# Overwrite tools.WORKSPACE, this is only for the bootstrap binary
+ chmod u+w "${OUTPUT_DIR}/classes/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE"
cat <<EOF >${OUTPUT_DIR}/classes/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE
local_repository(name = 'bazel_tools', path = __workspace_dir__)
bind(name = "cc_toolchain", actual = "@bazel_tools//tools/cpp:default-toolchain")