aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/BUILD
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-08-01 13:35:33 +0000
committerGravatar Yun Peng <pcloudy@google.com>2016-08-01 14:37:15 +0000
commit8b4df1b70eb040a6813579690ad8ce4dbe467e0a (patch)
tree57695667e3ea8fb908540744e232bed953027efd /scripts/BUILD
parent7f421afc3a9acec567eec9a3269f68b9fe218b95 (diff)
Using a temporary user output root when generating the completion script
Without that, we write some data in the cache that should not be cached. This fix the remaining issue about bazel writing out of the cache directory described in Homebrew/homebrew-core#3427. -- Change-Id: I8794693233675124fbc7ee3691297e7a84d999b4 Reviewed-on: https://bazel-review.googlesource.com/#/c/4221/ MOS_MIGRATED_REVID=128980718
Diffstat (limited to 'scripts/BUILD')
-rw-r--r--scripts/BUILD6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/BUILD b/scripts/BUILD
index 398ce4ca48..df78a86b73 100644
--- a/scripts/BUILD
+++ b/scripts/BUILD
@@ -10,8 +10,10 @@ genrule(
outs = ["bazel-complete.bash"],
cmd = "cat $(SRCS) > $@\n" +
"touch err.log\n" +
- "trap \"rm err.log\" EXIT\n" +
- "$(location //src:bazel) --host_javabase=$(JAVABASE) " +
+ "TMP=`mktemp -d $${TMPDIR:-/tmp}/tmp.XXXXXXXXXX`\n" +
+ "trap \"rm -fr err.log $${TMP}\" EXIT\n" +
+ "$(location //src:bazel) " +
+ " --batch --output_user_root=$${TMP} --host_javabase=$(JAVABASE) " +
" help completion 2>err.log >>$@ || { cat err.log; exit 1; }",
output_to_bindir = 1,
tools = [