diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2017-08-23 12:19:25 +0200 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2017-08-23 13:31:53 +0200 |
commit | da1d416f83942dc1b1b203cdd4d79c47fce7335f (patch) | |
tree | d46df885e930a4a90e6bb9df4a85fc969c3eb963 /compile.sh | |
parent | 68776e8ed7768d66ae6cf9a5221a973321d79fc5 (diff) |
Add a Bazel test testing determinism of `bazel build //src:bazel`
- Test if hash(bazel1) == hash(bazel2)
This ensure that the build of bazel is a fixed point.
Change-Id: I422dfc7ec5b95aa054a2677e59427cbd8cd4ef01
PiperOrigin-RevId: 166180529
Diffstat (limited to 'compile.sh')
-rwxr-xr-x | compile.sh | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/compile.sh b/compile.sh index b5a325e937..e481690e27 100755 --- a/compile.sh +++ b/compile.sh @@ -53,12 +53,11 @@ source scripts/bootstrap/buildenv.sh function usage() { [ -n "${1:-compile}" ] && echo "Invalid command(s): $1" >&2 - echo "syntax: $0 [command[,command]* [BAZEL_BIN [BAZEL_SUM]]]" >&2 + echo "syntax: $0 [command[,command]* [BAZEL_BIN]]" >&2 echo " General purpose commands:" >&2 echo " compile = compile the bazel binary (default)" >&2 echo " Commands for developers:" >&2 - echo " all = compile,determinism,test" >&2 - echo " determinism = test for stability of Bazel builds" >&2 + echo " all = compile,srcs,test" >&2 echo " srcs = test that //:srcs contains all the sources" >&2 echo " test = run the full test suite of Bazel" >&2 exit 1 @@ -69,18 +68,13 @@ function parse_options() { COMMANDS="${1:-compile}" [[ "${COMMANDS}" =~ ^$keywords(,$keywords)*$ ]] || usage "$@" DO_COMPILE= - DO_CHECKSUM= - DO_FULL_CHECKSUM=1 DO_TESTS= DO_SRCS_TEST= [[ "${COMMANDS}" =~ (compile|all) ]] && DO_COMPILE=1 - [[ "${COMMANDS}" =~ (bootstrap|determinism|all) ]] && DO_CHECKSUM=1 - [[ "${COMMANDS}" =~ (bootstrap) ]] && DO_FULL_CHECKSUM= [[ "${COMMANDS}" =~ (srcs|all) ]] && DO_SRCS_TEST=1 [[ "${COMMANDS}" =~ (test|all) ]] && DO_TESTS=1 BAZEL_BIN=${2:-"bazel-bin/src/bazel"} - BAZEL_SUM=${3:-"x"} } parse_options "${@}" @@ -132,31 +126,6 @@ if [ $DO_COMPILE ]; then fi # -# Output is deterministic between two bootstrapped bazel binary using the actual tools and the -# released binary. -# -if [ $DO_CHECKSUM ]; then - new_step "Determinism test" - if [ ! -f ${BAZEL_SUM:-x} ]; then - BAZEL_SUM=bazel-out/bazel_checksum - log "First build" - bootstrap_test ${BAZEL} ${BAZEL_SUM} - else - BOOTSTRAP=${BAZEL} - fi - if [ "${BAZEL_SUM}" != "${OUTPUT_DIR}/bazel_checksum" ]; then - cp ${BAZEL_SUM} ${OUTPUT_DIR}/bazel_checksum - fi - if [ $DO_FULL_CHECKSUM ]; then - log "Second build" - bootstrap_test ${BOOTSTRAP} bazel-out/bazel_checksum - log "Comparing output" - (diff -U 0 ${OUTPUT_DIR}/bazel_checksum bazel-out/bazel_checksum >&2) \ - || fail "Differences detected in outputs!" - fi -fi - -# # Test that //:srcs contains all the sources # if [ $DO_SRCS_TEST ]; then |