Skip to content

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
@vjovanov vjovanov requested review from gradinac and olpaw August 30, 2021 12:36
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.

@lazar-mitrovic lazar-mitrovic requested a review from olpaw September 6, 2021 12:59
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