aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xscripts/bootstrap/buildenv.sh4
-rwxr-xr-xsrc/test/shell/bazel/bazel_bootstrap_distfile_test.sh23
2 files changed, 26 insertions, 1 deletions
diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh
index 88d7e4fc45..5c3682187c 100755
--- a/scripts/bootstrap/buildenv.sh
+++ b/scripts/bootstrap/buildenv.sh
@@ -166,7 +166,9 @@ function tempdir() {
local DIR="$(mktemp -d "${tmp%%/}/bazel_XXXXXXXX")"
mkdir -p "${DIR}"
local DIRBASE=$(basename "${DIR}")
- eval "cleanup_tempdir_${DIRBASE}() { rm -rf '${DIR}' >&/dev/null || true ; }"
+ # TODO(laszlocsomor): Remove the "[ -n ... ] && echo ... ;" part from the
+ # following command after we fixed https://github.com/bazelbuild/bazel/issues/3618.
+ eval "cleanup_tempdir_${DIRBASE}() { [ -n \"\$TEST_TMPDIR\" ] && echo \"DEBUG[$0 (\$(date))] deleting ($DIR)\" ; rm -rf '${DIR}' >&/dev/null || true ; }"
atexit cleanup_tempdir_${DIRBASE}
NEW_TMPDIR="${DIR}"
}
diff --git a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh
index 2783a81ef7..6506efcc2c 100755
--- a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh
+++ b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh
@@ -30,17 +30,40 @@ fi
source $(rlocation io_bazel/src/test/shell/integration_test_setup.sh) \
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }
+function log_progress() {
+ # TODO(laszlocsomor): remove this method after we fixed
+ # https://github.com/bazelbuild/bazel/issues/3618. I added this method only to
+ # catch that bug.
+ echo "DEBUG[$0 ($date)] test_bootstrap, $@"
+}
+
function test_bootstrap() {
local olddir=$(pwd)
WRKDIR=$(mktemp -d ${TEST_TMPDIR}/bazelbootstrap.XXXXXXXX)
+ log_progress "WRKDIR=($WRKDIR)"
+ log_progress "TMPDIR=($TMPDIR)"
+ log_progress "TEST_TMPDIR=($TEST_TMPDIR)"
mkdir -p "${WRKDIR}" || fail "Could not create workdir"
trap "rm -rf \"$WRKDIR\"" EXIT
cd "${WRKDIR}" || fail "Could not change to work directory"
unzip -q ${DISTFILE}
+ log_progress "unzipped DISTFILE=($DISTFILE)"
find . -type f -exec chmod u+w {} \;
+ log_progress "running compile.sh"
./compile.sh || fail "Expected to be able to bootstrap bazel"
+ log_progress "done running compile.sh, WRKDIR contains this many files: $(find "$WRKDIR" -type f | wc -l)"
+ log_progress "running bazel info install_base"
+ # TODO(laszlocsomor): remove the "bazel info install_base" call at the same
+ # time as removing log_progress, i.e. after we fixed
+ # https://github.com/bazelbuild/bazel/issues/3618
+ ./output/bazel info install_base || fail "Generated bazel not working"
+ log_progress "done running bazel info install_base, WRKDIR contains this many files: $(find "$WRKDIR" -type f | wc -l)"
+ log_progress "running bazel info version"
./output/bazel version || fail "Generated bazel not working"
+ log_progress "done running bazel version, WRKDIR contains this many files: $(find "$WRKDIR" -type f | wc -l)"
+ log_progress "running bazel shutdown"
./output/bazel shutdown
+ log_progress "done running bazel shutdown"
cd "${olddir}"
}