Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rules_android. Reapply ba7310ce4a1d8fb14434597fbc7440a4074f7695 #1297

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ahumesky
Copy link
Contributor

@ahumesky ahumesky commented Dec 13, 2024

Reverts #1215 plus accounting for additional changes since ba7310c went in

@jin
Copy link
Collaborator

jin commented Dec 18, 2024

Thanks for pushing this through! The failing tests look legitimate.

@ahumesky
Copy link
Contributor Author

ahumesky commented Jan 8, 2025

Thanks for taking a look, this draft is to run the CI to see what fails

@ahumesky
Copy link
Contributor Author

ahumesky commented Jan 9, 2025

I have the failing tests down to:

…kotlin:inline_function_test with bazel 8.0.0
@ahumesky
Copy link
Contributor Author

ahumesky commented Jan 9, 2025

The //tests/unit/kotlin:inline_function_test failure with bazel 8.0.0 is due to disabling --experimental_sibling_repository_layout, and of course restoring that causes the original failures with the go rules (bazel-contrib/rules_go#3947)

@jin
Copy link
Collaborator

jin commented Jan 13, 2025

There is not enough motivation to flip --experimental_sibling_repository_layout to true so we should be ok to remove it from rules_jvm_external's bazelrc (bazelbuild/bazel#20500 (comment))

And bumping rules_kotlin version fixes the test failure that comes with removing the sibling repository layout flag:

INFO: Analyzed target //tests/unit/kotlin:inline_function_test (114 packages loaded, 6285 targets configured).
INFO: Found 1 test target...
Target //tests/unit/kotlin:inline_function_test up-to-date:
  bazel-bin/tests/unit/kotlin/inline_function_test.jar
  bazel-bin/tests/unit/kotlin/inline_function_test.jdeps
INFO: Elapsed time: 43.089s, Critical Path: 2.71s
INFO: 12 processes: 40 action cache hit, 8 internal, 2 darwin-sandbox, 2 worker.
INFO: Build completed successfully, 12 total actions
//tests/unit/kotlin:inline_function_test                                 PASSED in 0.3s

Executed 1 out of 1 test: 1 test passes.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.


jingwen@jingwen-mac rules_jvm_external % git diff
diff --git a/.bazelrc b/.bazelrc
index d137de4..6f82835 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -8,7 +8,7 @@ build --experimental_strict_java_deps=strict
 build --explicit_java_test_deps

 # Re-enable once https://github.com/bazelbuild/rules_go/issues/3947 is addressed.
-build --experimental_sibling_repository_layout
+# build --experimental_sibling_repository_layout

 # Make sure we get something helpful when tests fail
 test --verbose_failures
diff --git a/MODULE.bazel b/MODULE.bazel
index 60a0dcd..1c6a015 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -30,7 +30,7 @@ bazel_dep(
 )
 bazel_dep(
     name = "rules_kotlin",
-    version = "1.9.6",
+    version = "2.1.0",
 )
 bazel_dep(
     name = "rules_shell",

@ahumesky
Copy link
Contributor Author

Awesome thanks for taking a look at this -- I was initially looking at rules_java since the error was about the path to the java binary (/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/1594/execroot/_main/bazel-out/k8-fastbuild/bin/tests/unit/kotlin/inline_function_test.runfiles/_main/external/rules_java++toolchains+remotejdk11_linux/bin/java: No such file or directory)

Unfortunately updating rules_kotlin to 2.1.0 seems to cause a different (yet still path related) failure on window:

set USE_BAZEL_VERSION=8.0.0
bazelisk build //tests/integration/kt_jvm_export:test-lib

LAUNCHER ERROR: Rlocation failed on _main/external/rules_kotlin++rules_kotlin_extensions+com_github_jetbrains_kotlin_git/lib/annotations-13.0.jar:external/rules_kotlin++rules_kotlin_extensions+com_github_jetbrains_kotlin_git/lib/kotlin-stdlib.jar:external/rules_kotlin++rules_kotlin_extensions+com_github_jetbrains_kotlin_git/lib/kotlin-stdlib-jdk7.jar:external/rules_kotlin++rules_kotlin_extensions+com_github_jetbrains_kotlin_git/lib/kotlin-stdlib-jdk8.jar, path doesn't exist in MANIFEST file

Switching to rules_kotlin 2.0.0 seems to avoid that error, so it must be one of the changes between 2.0.0 and 2.1.0: bazelbuild/rules_kotlin@v2.0.0...v2.1.0

@ahumesky
Copy link
Contributor Author

Ah, but 2.0.0 still has the No such file or directory problem with bin/java on linux: https://buildkite.com/bazel/rules-jvm-external/builds/4767#01946284-2045-4179-af17-cec4ce769182. Bummer. I'll try to find which commit between 2.0.0 and 2.1.0 breaks things on windows tomorrow

@ahumesky
Copy link
Contributor Author

ahumesky commented Jan 15, 2025

The issue with rules_kotlin appears to be from this change: bazelbuild/rules_kotlin@e51619c

Although the error is coming from code that was introduced earlier than that commit:
https://github.com/bazelbuild/rules_kotlin/blob/f20ef32db6988fa1b346b1af12f3a3edd545bc47/src/main/starlark/core/compile/cli/compile.bzl#L33-L35

Maybe that code was not being used until bazelbuild/rules_kotlin@e51619c, not sure

It seems that the java launcher separates these by semicolon:
https://github.com/bazelbuild/bazel/blob/bebe20ed5078edf123b7d528931658168df2cb4c/src/tools/launcher/java_launcher.cc#L328-L331

However changing the Starlark code to use semicolon still results in

LAUNCHER ERROR: Rlocation failed on _main/external/rules_kotlin++rules_kotlin_extensions+com_github_jetbrains_kotlin_git/lib/annotations-13.0.jar, path doesn't exist in MANIFEST file

And the code does appear to add these files to the inputs:
https://github.com/bazelbuild/rules_kotlin/blob/f20ef32db6988fa1b346b1af12f3a3edd545bc47/src/main/starlark/core/compile/cli/compile.bzl#L28

@ahumesky
Copy link
Contributor Author

I also noticed that rules_kotlin added these recently to its .bazelrc:

# Required for windows ci
startup --windows_enable_symlinks
common --enable_runfiles

https://github.com/bazelbuild/rules_kotlin/blob/f20ef32db6988fa1b346b1af12f3a3edd545bc47/.bazelrc#L12-L14

but that didn't seem to help the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants