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

Use @arg file for running native binaries #209

Closed
melix opened this issue Feb 16, 2022 · 3 comments
Closed

Use @arg file for running native binaries #209

melix opened this issue Feb 16, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@melix
Copy link
Collaborator

melix commented Feb 16, 2022

Release 0.9.10 fixed the long classpath issue when building a native image, but it didn't fix the problem when running tests, or when running the native binary.

It is extremely likely that only the Maven plugin is affected 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

because the test mojo builds the native image directly with tests.

Gradle builds the native image separately so should be immune: https://github.com/melix/native-build-tools/blob/925d6ba73c7f0d6122dc0ba9b4ca8afe0d60ec18/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/tasks/NativeRunTask.java#L76-L79

Initially reported at spring-attic/spring-native#1486 (comment)

@melix melix added the bug Something isn't working label Feb 16, 2022
@melix melix added this to the 0.9.11 milestone Feb 16, 2022
@sdeleuze sdeleuze modified the milestones: 0.9.11, 0.9.12 Mar 25, 2022
@melix melix modified the milestones: 0.9.12, 0.9.13 Jun 21, 2022
@lazar-mitrovic
Copy link
Collaborator

I'm not sure what this issue is about - argument file is only used for building native images.
NativeImageJUnitLauncher doesn't support @ files, and I can't see where this would be a problem since it only consumes 3 different arguments.

Native Maven Plugin uses argument files for building tests by default on Windows since #247, so we should be good.

@melix melix removed this from the 0.9.13 milestone Jul 12, 2022
@melix
Copy link
Collaborator Author

melix commented Jul 26, 2022

I agree that this should be good, I'm closing this, let's create a new issue if something arises.

@melix melix closed this as completed Jul 26, 2022
@human-user
Copy link

human-user commented Feb 23, 2023

@melix I get a similar failure message like spring-attic/spring-native#1486.
My native-maven-plugin version is 0.9.19. How could I do to fix this?

Failures (1):
  JUnit Jupiter:DemoApplicationTests
    ClassSource [className = 'com.example.demo.DemoApplicationTests', filePosition = null]
    => java.lang.ExceptionInInitializerError
       org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:113)
       org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$4(ExtensionValuesStore.java:86)
       org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.computeValue(ExtensionValuesStore.java:223)
       org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:211)
       org.junit.jupiter.engine.execution.ExtensionValuesStore$StoredValue.evaluate(ExtensionValuesStore.java:191)
       [...]
       Suppressed: java.lang.NoClassDefFoundError: Could not initialize class org.springframework.test.context.BootstrapUtils
         org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:113)
         org.junit.jupiter.engine.execution.ExtensionValuesStore.lambda$getOrComputeIfAbsent$4(ExtensionValuesStore.java:86)
         org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.computeValue(ExtensionValuesStore.java:223)
         org.junit.jupiter.engine.execution.ExtensionValuesStore$MemoizingSupplier.get(ExtensionValuesStore.java:211)
         org.junit.jupiter.engine.execution.ExtensionValuesStore$StoredValue.evaluate(ExtensionValuesStore.java:191)
         [...]
     Caused by: java.lang.IllegalStateException: Failed to load class for @org.springframework.test.context.web.WebAppConfiguration
       org.springframework.test.context.BootstrapUtils.loadWebAppConfigurationClass(BootstrapUtils.java:213)
       org.springframework.test.context.BootstrapUtils.<clinit>(BootstrapUtils.java:63)
       [...]
     Caused by: java.lang.ClassNotFoundException: org.springframework.test.context.web.WebAppConfiguration
       java.base@17.0.6/java.lang.Class.forName(DynamicHub.java:1132)
       org.springframework.util.ClassUtils.forName(ClassUtils.java:283)
       org.springframework.test.context.BootstrapUtils.loadWebAppConfigurationClass(BootstrapUtils.java:209)
       [...]

Test run finished after 166 ms
[         2 containers found      ]
[         0 containers skipped    ]
[         2 containers started    ]
[         0 containers aborted    ]
[         1 containers successful ]
[         1 containers failed     ]
[         1 tests found           ]
[         0 tests skipped         ]
[         0 tests started         ]
[         0 tests aborted         ]
[         0 tests successful      ]
[         0 tests failed          ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants