-
Notifications
You must be signed in to change notification settings - Fork 355
Native tests fail when using Shade plugin for Long Classpath Support #1486
Comments
That doesn't sound like this should be reported here. The logs that you have shared comes from the native build tools plugin. Have I missed something? |
@mstine Could you please test if a non-Spring test passes and let me know? |
@snicoll - Oracle advised me to file an issue here after they consulted with a Spring Developer Advocate (not sure who). So that's why I filed here. At any rate, this is how they are advising Maven users on Windows to run tests in native mode, so I expect this is affecting anyone in the Spring community that is trying to do the same. |
@sdeleuze Do you mean a non-Spring test within the reproducer project? Or a non-Spring test in a non-Spring project? |
A non-Spring test within the reproducer project. |
Added two additional tests to the
Both of these tests pass. |
@mstine Thanks, could you please try with the just released Native Build Tools Tools 0.9.10 which brings long classpath support without having to use the super verbose shade configuration (so please remove the additional shade plugin configuration not needed anymore) on Windows? |
Hi @sdeleuze - I've upgraded to 0.9.10 and removed all of the shade configuration. We are back to the original error ("The command line is too long."). I checked the source code for the plugin to make sure I wasn't missing a configuration. I can see exactly where @arg file support is being used to build the image (this is working!): https://github.com/graalvm/native-build-tools/blob/0.9.10/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeBuildMojo.java#L139-L141. However, I cannot find a corresponding change in the test mojo. It seems like the code building the image for testing is still using the classpath as a string: https://github.com/graalvm/native-build-tools/blob/0.9.10/native-maven-plugin/src/main/java/org/graalvm/buildtools/maven/NativeTestMojo.java#L141-L147. Am I missing something? Thanks, |
I have asked and will let you know. In the mean time, could you please check it passes with |
Confirmed on NBT side, so please track graalvm/native-build-tools#209 and #1499 for the resolution of the underlying issue. |
On Windows machines, the long classpath passed to
native-image.cmd
causes execution to fail as described here. Needing to support a large population of Windows users, we applied the solution described by the GraalVM team in their documentation.After applying the changes described in the docs, executing:
Results in this failure:
Reproducer Repo
This project was generated from start.spring.io on 2022-02-03, with web and native options applied. The
main
branch is unchanged from generation. Theshade-fail
branch has an additional commit that follows the instructions listed in the GraalVM Native Maven plugin docs under Long classpath and shading support.The text was updated successfully, but these errors were encountered: