From 9f7180fc5211f9c381a57a940975390c825a7d90 Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Tue, 27 Sep 2016 13:07:43 +0000 Subject: Bootstrapping: don't use convenience symlinks When `compile.sh` builds bazel using bazel, it copies the resulting binary to `output/bazel`. However sometimes the convenience symlink `bazel-bin` is not created, probably because an old one is still around and cannot be deleted. That is clearly a bug, but to work around it, the bootstrap builder shouldn't attempt to rely on the creation of these symlinks in the first place. This change updates compile.sh to use `bazel info` to locate the `bazel-bin` directory's real path, and attempt to copy the bazel binary from there. This works around https://github.com/bazelbuild/bazel/issues/1827 -- MOS_MIGRATED_REVID=134398451 --- compile.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'compile.sh') diff --git a/compile.sh b/compile.sh index 53fc4127b9..484b043a57 100755 --- a/compile.sh +++ b/compile.sh @@ -99,8 +99,13 @@ if [ $DO_COMPILE ]; then new_step 'Building Bazel with Bazel' display "." log "Building output/bazel" - bazel_build "src:bazel${EXE_EXT}" - cp -f "bazel-bin/src/bazel${EXE_EXT}" "output/bazel${EXE_EXT}" + bazel_build "src:bazel${EXE_EXT}" \ + || fail "Could not build Bazel" + bazel_bin_path="$(get_bazel_bin_path)/src/bazel${EXE_EXT}" + [ -e "$bazel_bin_path" ] \ + || fail "Could not find freshly built Bazel binary at '$bazel_bin_path'" + cp -f "$bazel_bin_path" "output/bazel${EXE_EXT}" \ + || fail "Could not copy '$bazel_bin_path' to 'output/bazel${EXE_EXT}'" chmod 0755 "output/bazel${EXE_EXT}" BAZEL="$(pwd)/output/bazel${EXE_EXT}" fi -- cgit v1.2.3