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 @argFiles to prevent issues with long command line invocations #3734

Merged
merged 2 commits into from
Sep 7, 2021

Conversation

lazar-mitrovic
Copy link
Contributor

This PR introduces 2 changes to the Native Image Driver (and its argument parsing mechanism):

  1. Adds support for @argFile command line option to the native-image tool. This command is implemented in the same way as in java tool (on JDK9+).
  2. Configures Native Image driver to pass all of the JVM arguments through argument file when invoking NativeImageGeneratorRunner on JDK9+. This enables usage of classpath jar workaround when user encounters a problem with long command line invocation. IMO this change is a bugfix, and should as such be backported to all of the supported versions.

Closes #3696.

@lazar-mitrovic lazar-mitrovic changed the title Use @argFiles to prevent issues when building on Windows Use @argFiles to prevent issues with long command line invocations Aug 27, 2021
Copy link
Member

@olpaw olpaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Small cosmetic changes requested.

@olpaw
Copy link
Member

olpaw commented Sep 2, 2021

  • Please test that this change works transitively with native-image.properties ?
    I.e. native-image -cp foo.jar where foo.jar contains a META-INF/native-image/foo/native-image.properties file that contains Args = @my_at_file

Fixes the issue where builder vm invocation would fail on Windows due to classpath length exceeding command line length limit.
@lazar-mitrovic
Copy link
Contributor Author

  • I can confirm that this change works transitively with native-image.properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[native-image] Support for @argfile CLI option
3 participants