diff options
author | Klaus Aehlig <aehlig@google.com> | 2016-10-17 16:47:55 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-10-18 10:56:57 +0000 |
commit | 286cfdd54791cc869526506dc94a24b2c93e2fee (patch) | |
tree | f9d7400867506f3813c401d2fec80404703ad065 /scripts/bootstrap | |
parent | 80bb0f27a435974ac5105361bf79637aba519f98 (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-x | scripts/bootstrap/compile.sh | 1 |
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") |