Skip to content

Commit

Permalink
Add Bazel bootstrap test for C++ rules using platforms
Browse files Browse the repository at this point in the history
#6516
#7260.

RELNOTES: None.
PiperOrigin-RevId: 238409948
  • Loading branch information
hlopko authored and copybara-github committed Mar 14, 2019
1 parent 774da7c commit 18f3b55
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/test/shell/bazel/bazel_bootstrap_distfile_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ else
fi

function test_bootstrap() {
execute_bootstrap "--host_javabase=@local_jdk//:jdk"
}

# TODO(#7260): Remove this test once this flag is flipped
function test_bootstrap_with_cc_rules_using_platforms() {
execute_bootstrap "--host_javabase=@local_jdk//:jdk "\
"--incompatible_enable_cc_toolchain_resolution"
}

function execute_bootstrap() {
cd "$(mktemp -d ${TEST_TMPDIR}/bazelbootstrap.XXXXXXXX)"
export SOURCE_DATE_EPOCH=1501234567
unzip -q "${DISTFILE}"
Expand All @@ -80,7 +90,7 @@ function test_bootstrap() {
fi
JAVABASE=$(echo reduced*)

env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" ./compile.sh \
env EXTRA_BAZEL_ARGS="${1}" ./compile.sh \
|| fail "Expected to be able to bootstrap bazel"
./output/bazel \
--server_javabase=$JAVABASE --host_jvm_args=--add-opens=java.base/java.nio=ALL-UNNAMED \
Expand Down

0 comments on commit 18f3b55

Please sign in to comment.