-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Improve error for mismatched local_jdk version in tests #21391
Comments
This slightly improves bazelbuild#21391
I submitted #21392 which improves the error but thinking about this more I guess really it seems like this issue should be eliminated a different way |
#21392 looks fine to me as an improvement, but |
Let me know if my steps don't work and I can try to debug further |
I tried your steps in a pristine container and everything works fine. Given that My best guess is the runtime version is getting set to something that is neither |
🤦🏻 you're totally right, I had an old |
…ctually used Work towards #21391 PiperOrigin-RevId: 609683057 Change-Id: Idd4772c9ea76493fa35a5777bf39722fdaa35d51
Thanks for confirming. I've submitted 77c2791 to at least localize the reliance on local_jdk to the tests that actually make use of it. I think your change could be still be valuable, so it would be great if you could rebase on master and incorporate it into the new function. |
This slightly improves bazelbuild#21391
thanks, updated my PR. I think this is fine to close afterwards |
Description of the bug:
When working on bazel itself, some shell tests like
//src/test/tools/bzlmod:verify_default_lock_file
depend on the local_jdk through this script:bazel/src/test/shell/testenv.sh.tmpl
Line 95 in 31fae9e
In the case your installed JDK mismatches what bazel expects, the tests fail with this error:
Since you end up trying to run
dirname
on an empty string. I discovered this was the JDK version mismatch with this log from--toolchain_resolution_debug='.*'
:Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
On macOS install azul 21 so that this is your only java install:
Run:
bazel test src/test/tools/bzlmod:verify_default_lock_file --test_output=all
Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?7.0.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
You can work around this by passing
--java_runtime_version=21
, based on the docs for that flag the default is supposed to belocal_jdk
, which I would assume means it should respect this version without me having to pass that flag. At first I assumed that was because this setup:bazel/tools/jdk/BUILD.tools
Lines 178 to 181 in 31fae9e
Doesn't include 21 but changing that locally doesn't seem to affect this behavior.
The text was updated successfully, but these errors were encountered: