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

native-image fails on windows with command size limit (CreateProcess error=206) #2387

Closed
Mobe91 opened this issue Apr 24, 2020 · 1 comment
Closed

Comments

@Mobe91
Copy link

Mobe91 commented Apr 24, 2020

I am using io.quarkus:quarkus-maven-plugin:1.3.2.Final and GraalVM CE 20.0.0 (Java 11) to build a native image on Windows 10 that issues to following command:

native-image.cmd -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=de -J-Dfile.encoding=Cp1252 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -H:+JNI -jar quarkus-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:-IncludeAllTimeZones -H:EnableURLProtocols=http,https --enable-all-security-services -H:-UseServiceLoaderFeature -H:+StackTrace quarkus-runner

This in turn launches another command targeting java.exe but the -imagecp argument is way too long which is why it fails with "CreateProcess error=206, file name or extension too long".

The problem is caused by https://github.com/oracle/graal/blob/00e729aa62e22646015f3051be7f3c1ae066ff01/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java#L1169. Rather than concatenating all the paths and passing it to the command, this should generate a classpath jar and pass it instead. Alternatively, an args file could be used for Java 9+ as described here.

Describe GraalVM and your environment:

  • GraalVM version: CE 20.0.0
  • JDK major version: 11
  • OS: Windows 10
  • Architecture: AMD64
@quintesse
Copy link
Contributor

I created a PR with a possible solution. Is that what you were looking for @Mobe91 ?

quintesse added a commit to quintesse/graal that referenced this issue May 8, 2020
quintesse added a commit to quintesse/graal that referenced this issue May 8, 2020
quintesse added a commit to quintesse/graal that referenced this issue May 11, 2020
quintesse added a commit to quintesse/graal that referenced this issue May 11, 2020
quintesse added a commit to quintesse/graal that referenced this issue Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants