Skip to content

Commit f53342f

Browse files
ted-xiecopybara-github
authored andcommitted
Merge #267 by ted-xie: Fix ALT tests for bazel last_green
Also sets internal presubmit bazel version back to last_green. Closes #267 COPYBARA_INTEGRATE_REVIEW=#267 from ted-xie:fix_alt_tests b01beab PiperOrigin-RevId: 687067087 Change-Id: I8c1c13b06a2c61d95376ece5f0048b1bc0e26370
1 parent 4cfa883 commit f53342f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

kokoro/presubmit/presubmit_main.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function main() {
5555
echo "== installing bazelisk ========================================="
5656
bazel_install_dir=$(mktemp -d)
5757
BAZELISK_VERSION="1.18.0"
58-
export USE_BAZEL_VERSION="7.2.1"
58+
export USE_BAZEL_VERSION="last_green"
5959
DownloadBazelisk "$BAZELISK_VERSION" linux amd64 "$bazel_install_dir"
6060
bazel="$bazel_install_dir/bazel"
6161
echo "============================================================="
@@ -115,11 +115,6 @@ function main() {
115115
# `diff -w` compares the two files without whitespaces.
116116
diff -w <(sed -n '/artifacts =/{:start /]/!{N;b start};/.*/p}' defs.bzl | grep -v "bazel worker api") <(sed -n '/artifacts =/{:start /]/!{N;b start};/.*/p}' MODULE.bazel)
117117

118-
# Sync with bzlmod disabled to sniff out WORKSPACE issues
119-
"$bazel" sync --noenable_bzlmod > /dev/null
120-
# Run with bzlmod enabled to catch missing bzlmod deps.
121-
"$bazel" sync --enable_bzlmod > /dev/null
122-
123118
TEST_TARGETS=(
124119
"//src/common/golang/..."
125120
"//src/tools/ak/..."

rules/android_local_test/impl.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ def _process_deploy_jar(ctx, java_package, jvm_ctx, proto_ctx, resources_ctx, **
259259

260260
def _preprocess_stub(ctx, **_unused_sub_ctxs):
261261
javabase = ctx.attr._current_java_runtime[java_common.JavaRuntimeInfo]
262-
java_executable = javabase.java_executable_exec_path
262+
java_executable = javabase.java_executable_runfiles_path
263+
if ctx.workspace_name != "google3":
264+
# Bazel tests need the runfiles location of the java executable, and the workspace name.
265+
java_executable = "$(rlocation " + ctx.workspace_name + "/" + java_executable + ")"
266+
263267
java_executable_files = javabase.files
264268

265269
substitutes = {

0 commit comments

Comments
 (0)