Comments (18)
I tried installing GraalVM and native-image on the system, but not using this plugin. Change the working directory to <project root/build/native
, run native-image ...(arguments)
by copying and pasting the command using ./gradlew --debug buildNativeImage
), it will work.
So the problem is related to the locally cached copy of GraalVM and native-image.
from spring-graalvm-native-plugin.
There are a few similar issues reported:
https://github.com/oracle/graal/issues?q=is%3Aissue+Unable+to+compile+C-ABI+query+code
The causes seem to be related to the OS setup or Java version. To troubleshoot, I would suggest either:
- Create a GitHub Action and build your project on a macOS image to isolate OS setup issue; or
- Share a minimal project that reproduces this error and I can run it on my mac. If there is no error, I can share information like my Java version that compiles successfully.
from spring-graalvm-native-plugin.
I'm not sure what caused this error, but it says "Make sure native software development toolchain is installed on your system". So are you sure you have the native toolchain installed?
Reference: https://www.graalvm.org/reference-manual/native-image/
xcode-select --install
from spring-graalvm-native-plugin.
Yes, this is installed
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
from spring-graalvm-native-plugin.
Did you make any progress?
from spring-graalvm-native-plugin.
Not really, I pretty sure that it is something wrong with my station...
Could you please try ./gradlew buildNativeImage
from https://github.com/artemptushkin/spring-boot-native-scale-zero ?
from spring-graalvm-native-plugin.
I tried to wipe some legacy Java version, check all the dependent libraries, and soft on my station - no result. I started debugging this, but same - can't see the file that exists
from spring-graalvm-native-plugin.
I got the same error executing your project with ./gradlew buildNativeImage
, so I think it is not related to the system configurations. I'll take a deeper look.
from spring-graalvm-native-plugin.
Found this: oracle/graal#2845
Could be a bug in JDK that is fixed in JDK 14/15 but not 11.
from spring-graalvm-native-plugin.
I've been trying with 8.
I think I skipped that ticket as there a different error...
Thanks - waiting for the bug fix I think.
from spring-graalvm-native-plugin.
I've been having the exact same error, although, my investigations I think are a bit different,
I have the tool chain installed, cause when I do
gcc --version
I get,
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin20.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
so as you see the installed dir is /Library/Developer/CommandLineTools/usr/bin
however as @artemptushkin's log shows (which exactly similar to mine, except we are trying to compile an internal source), it is looking for the files in /usr/bin/cc,
is this path mismatch a possible solution? I am not 100% convinced this is the root cause of the issue, but I felt like pointing it out :)
from spring-graalvm-native-plugin.
@codexetreme what have you changed? mine gcc --version
gives the same result, the same directory, but the error perists
from spring-graalvm-native-plugin.
I dowloaded, GraalVM from GitHub, 20.3.0, installed native-image on that , and compiled against that, it works ,
./native-image -cp picocli-4.5.2.jar --static -jar ~/mycode/build/ouptuts/cli-0.2.0-beta.0.0+20201207T212423Z.jar cli
this gets me a binary that I can run and execute
EDIT: yes, I am using this for picocli, so I am not sure if this gradle plugin correctly configured, but I highly doubt that to be the case
from spring-graalvm-native-plugin.
Thanks @codexetreme for building without this plugin so it does seem this is an issue with the command options generated by this plugin.
from spring-graalvm-native-plugin.
Could be the options issue? can you perhaps add an option to show what are the options generated, or something that gives better debug information? I tried the standard --info
and --stacktrace
but they aren't much help
from spring-graalvm-native-plugin.
should not, I see that Graalvm provides its own version of CC by the way
/Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.3.0/Contents/Home/languages/llvm/native/bin
ar graalvm-native-clang++ llvm-readelf
c++ graalvm-native-ld llvm-readobj
cc ld llvm-strip
clang ld.lld nm
clang++ ld64 objcopy
g++ lld objdump
gcc llvm-ar ranlib
graalvm-clang llvm-nm readelf
graalvm-clang++ llvm-objcopy readobj
graalvm-native-binutil llvm-objdump strip
graalvm-native-clang llvm-ranlib
but the running command use cc
from the machine
from spring-graalvm-native-plugin.
I add maven setup to my https://github.com/artemptushkin/spring-boot-native-scale-zero/tree/master
by the samples: from spring-graalvm-native and is working with ./mvnw -Pnative clean package
Logs are different.
Part without JARs:
Gradle:
Command: /Users/artemptushkin/JavaProjects/spint-boot-native-scale-zero/build/tmp/buildNativeImage/graalvm-ce-java11-20.3.0/Contents/Home/bin/native-image --allow-incomplete-classpath --report-unsupported-elements-at-runtime --no-fallback --no-server --install-exit-handlers -H:+ReportExceptionStackTraces -H:-CheckToolchain -Dspring.native.remove-unused-autoconfig=true -Dspring.native.remove-yaml-support=true -Dspring.native.remove-xml-support=false -Dspring.native.remove-spel-support=false -Dspring.native.remove-jmx-support=false -Dspring.native.verify=false -Dspring.native.verbose=false -Dspring.native.mode=reflection -J-Xmx4G -H:Name=spring-boot-native-scale-zero
Maven:
-Dspring.native.remove-yaml-support=true -Dspring.spel.ignore=true -H:Class=io.github.artemptushkin.springbootnativescalezero.SpringBootNativeScaleZeroApplication -H:Name=commandlinerunner
Maven calls directly from my JAVA_HOME:
/Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.3.0/Contents/Home/bin/native-image -cp
and Gradle copies this into build
dir
it would be rational to check all the props from the Gradle run in Maven project but it is so slow, I checked these:
-Dspring.native.mode=reflection -H:+ReportExceptionStackTraces -H:-CheckToolchain
and it is okay
from spring-graalvm-native-plugin.
I tried installing GraalVM and native-image on the system, but not using this plugin. Change the working directory to
<project root/build/native
, runnative-image ...(arguments)
by copying and pasting the command using./gradlew --debug buildNativeImage
), it will work.So the problem is related to the locally cached copy of GraalVM and native-image.
Or even easier, I installed GraalvM via Brew (also to PATH and JAVA_HOME) and added
nativeImage {
download = 'skip'
...
}
It builds fine now...
from spring-graalvm-native-plugin.
Related Issues (20)
- Can you provide an example using spring boot? HOT 2
- The plugin declares repositories, effectively ignoring the repositories declared in the settings.
- How to pass graalVM options? HOT 2
- Unable to produce image from spring boot HOT 2
- Graal 20.3: rework non-Boolean setting "traceClassInitialization" HOT 1
- Classes that should be initialized at run time got initialized during image building: HOT 2
- UnsatisfiedLinkError: no awt in java.library.path HOT 1
- Wrong property for removing xml support HOT 2
- buildNativeImage FAILED HOT 6
- Executable Spring Boot archives are not supported (Unexpected record signature: 0X622F2123) HOT 5
- macOS build error (Collecting native-compiler info with '/usr/bin/cc -v ' failed) HOT 3
- Having issue on macOS Catalina 10.15.6 HOT 1
- Caused by: jdk.vm.ci.common.JVMCIError: failed guarantee: DynamicNewInstanceNode.instanceType is constant, should have been canonicalized to NewInstanceNode. HOT 1
- Illegal char <:> at index 5 HOT 4
- set enableHttps use enableHttp variable HOT 1
- Execution failed for task ':stock-api:buildNativeImage': Cannot run program native-image.cmd The system cannot find the file specified HOT 8
- gu.exe NotExist on Windows HOT 1
- version `1.4.9` not published to plugins.gradle.org/m2 HOT 2
- Support "-H:-CheckToolchain" (or other command-line options) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-graalvm-native-plugin.