-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Java compilation always fails with strict deps errors with bzlmod #16109
Comments
I did some more testing. The follow minimal repro case:
... already throws the same error about String being from an indirect dependency. However, if I don't enable Bzlmod, everything compiles and runs perfectly even if I set up a source directory that contains tildes. I tried package directory names containing tildes ( So I'm inclined to think that somehow rules_java being located in a directory whose path contains |
With
vs
Strict Java Deps depends on a bug fix in JDK 11: #14533. With
I'm not sure where the different in JDK version and |
Hmm... interesting how this bug only surfaces with the tildes, then. With Bzlmod enabled, the remote JDK is coming from rules_java 5.0.0, which is the latest release version, but doesn't contain bazelbuild/rules_java@36a7611, which updates the JDK versions to match what Bazel uses itself (without Bzlmod, that is). So we should be good if we just release a new version of rules_java. I'll look into that. Thanks for your help, Liam! |
Fixes bazelbuild#16109 PiperOrigin-RevId: 468676158 Change-Id: I3db2b9a6d8d952fd0bb6bbfa0abc7936916bfe9b
Description of the bug:
As of 34a4f13, when using Bzlmod, every Java compilation fails with a strict deps error.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?HEAD
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 master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
I augmented
JavaBuilder
with some additional debug output and noticed that with the failing commit, thejarPath
here is absolute, whereas the entries indirectJars
andplatformJars
are relative to the exec root. With the commit before the failing commit, thejarPath
is relative.I unfortunately didn't find the place where paths containing
~
would be handled specially in the JDK and/orJavaBuilder
.The text was updated successfully, but these errors were encountered: