-
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
Windows, Java launcher: relativize paths in the classpath jar #4408
Comments
Huge thanks to @cushon and his colleagues for their help with identifying this problem. |
Repro1. Source tree:I pretend to have two source trees,
2. Compiling MyClass and creating my-class.jar:
3. Creating the classpath jar:
4. Compiling against my-class.jar works, but against classpath.jar it doesn't:
5. Running against either of the jars works, and the jars are needed:
6. Using relative paths works both with
|
Thank you all for figuring out this, I'm looking into it! |
Thank you! |
Will do it! |
Is there a minimal repo with Bazel that I can test against? |
Not yet. @c-parsons is working on CL 180818052, which adds a new annotation processor and associated tests, which is how we found the problem.
|
Very helpful, thank you!! |
Description of the problem / feature request:
On Windows, the java_{binary,test} native launcher should create classpath jars with relative paths in the manifest, not with absolute file URLs.
Feature requests: what underlying problem are you trying to solve with this feature?
Motivation: JUnit testing Java annotation processors.
Such tests run
javac
within a JUnit test, and the JUnit test's runtime classpath (which is a classpath jar file) isjavac
's compile-time classpath jar.The JAR file spec states:
(Source: https://docs.oracle.com/javase/9/docs/specs/jar/jar.html#class-path-attribute)
The Java launcher currently violates the JAR spec because the launcher writes absolute "file:/" URLs in the classpath jar's manifest.
What operating system are you running Bazel on?
Windows 10.
What's the output of
bazel info release
?0.9.0
The text was updated successfully, but these errors were encountered: