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

nativeRun failed on windows du to the "EXE" extention #198

Closed
nassimus26 opened this issue Feb 3, 2022 · 1 comment · Fixed by #199
Closed

nativeRun failed on windows du to the "EXE" extention #198

nassimus26 opened this issue Feb 3, 2022 · 1 comment · Fixed by #199

Comments

@nassimus26
Copy link

Running the command gradlew :nativeRun --stacktrace on windows 10 and version 0.9.4 of the org.graalvm.buildtools.native

print this :

 gradlew :nativeRun

> Task :nativeBuild
========================================================================================================================
GraalVM Native Image: Generating 'test'...
========================================================================================================================
[1/7] Initializing...                                                                                    (8,7s @ 0,19GB)
 Version info: 'GraalVM 22.0.0.2 Java 17 CE'                                                                            
 1 user-provided feature(s)                                                                                             
  - com.oracle.svm.polyglot.kotlin.KotlinFeature
[2/7] Performing analysis...  [*******]                                                                 (18,2s @ 0,44GB)
   2?706 (85,04%) of  3?182 classes reachable                                                                           
   3?325 (60,38%) of  5?507 fields reachable                                                                            
  12?350 (73,45%) of 16?815 methods reachable
      26 classes,     0 fields, and   171 methods registered for reflection
      61 classes,    53 fields, and    51 methods registered for JNI access
[3/7] Building universe...                                                                               (1,3s @ 0,60GB)
[4/7] Parsing methods...      [*]                                                                        (1,0s @ 0,81GB)
[5/7] Inlining methods...     [****]                                                                     (1,8s @ 0,68GB)
[6/7] Compiling methods...    [****]                                                                    (15,3s @ 1,30GB)
[7/7] Creating image...                                                                                  (3,4s @ 1,55GB)
   4,28MB (35,52%) for code area:    7?436 compilation units                                                            
   6,93MB (57,45%) for image heap:   1?634 classes and 90?599 objects                                                   
 868,54KB ( 7,04%) for other data
  12,06MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area:                               Top 10 object types in image heap:                          
 643,80KB java.util                                            1,79MB byte[] for general heap data                      
 345,14KB com.oracle.svm.jni                                 789,63KB java.lang.String
 308,68KB java.lang                                          583,95KB java.lang.Class
 286,84KB java.text                                          485,80KB byte[] for java.lang.String
 235,75KB java.util.regex                                    419,44KB java.util.HashMap$Node
 179,84KB java.util.concurrent                               221,38KB java.util.HashMap$Node[]
 146,93KB java.math                                          154,27KB java.util.concurrent.ConcurrentHashMap$Node
 124,46KB com.oracle.svm.core.reflect                        147,78KB char[]
 111,64KB com.oracle.svm.core.code                           147,17KB java.lang.String[]
  95,13KB java.util.logging                                  139,78KB sun.util.locale.LocaleObjectCache$CacheEntry
      ... 110 additional packages                                 ... 760 additional object types
                                           (use GraalVM Dashboard to see all)
------------------------------------------------------------------------------------------------------------------------
                        1,6s (2,9% of total time) in 17 GCs | Peak RSS: 2,61GB | CPU load: 5,10
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 C:\work\GraalVMTest\build\native\nativeBuild\test.exe (executable)
 C:\work\GraalVMTest\build\native\nativeBuild\test.build_artifacts.txt
========================================================================================================================
Finished generating 'test' in 53,0s.
[native-image-plugin] Native Image written to: C:\work\GraalVMTest\build\native\nativeBuild

> Task :nativeRun FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':nativeRun' (type 'NativeRunTask').
  - In plugin 'org.graalvm.buildtools.gradle.NativeImagePlugin$Inject' type 'org.graalvm.buildtools.gradle.tasks.NativeRunTask' property 'image' specifies file 'C:\work\GraalVMTest\build\native\nativeBuild\test' which doesn't exist.

    Reason: An input file was expected to be present but it doesn't exist.
@melix
Copy link
Collaborator

melix commented Feb 3, 2022

Thanks, I think the bug is here: https://github.com/melix/native-build-tools/blob/e0e4492483fc19b7c24f123a3a973f4260ff040f/native-gradle-plugin/src/main/java/org/graalvm/buildtools/gradle/tasks/BuildNativeImageTask.java#L110

This line should be:

        return getOptions().flatMap(options -> options.getImageName().map(name -> name + EXECUTABLE_EXTENSION));

melix added a commit that referenced this issue Feb 3, 2022
This commit fixes the executable name when the plugin is running
under Windows: `nativeRun` would fail because it doesn't append
the `.exe` extension to the file name.

Fixes #198
melix added a commit that referenced this issue Feb 3, 2022
This commit fixes the executable name when the plugin is running
under Windows: `nativeRun` would fail because it doesn't append
the `.exe` extension to the file name.

Fixes #198
melix added a commit that referenced this issue Feb 3, 2022
This commit fixes the executable name when the plugin is running
under Windows: `nativeRun` would fail because it doesn't append
the `.exe` extension to the file name.

Fixes #198
@melix melix closed this as completed in #199 Feb 4, 2022
melix added a commit that referenced this issue Feb 4, 2022
This commit fixes the executable name when the plugin is running
under Windows: `nativeRun` would fail because it doesn't append
the `.exe` extension to the file name.

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

Successfully merging a pull request may close this issue.

2 participants