-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Describe the Issue
Due to the following regex that assumes that Apple is the only possible clang vendor on macOS:
Line 302 in 2b5956d
| while (scanner.findInLine("Apple (clang|LLVM) version ") == null) { |
The following error can occur when using a source build of clang (not from Apple; for example from nixpkgs):
[nix-shell:~/co/flower]$ native-image Foo
Warning: Environment variable 'MACOSX_DEPLOYMENT_TARGET_FOR_TARGET' is undefined and therefore not available during image build-time.
Warning: Environment variable 'DEVELOPER_DIR_FOR_BUILD' is undefined and therefore not available during image build-time.
Warning: Environment variable 'DEVELOPER_DIR_FOR_TARGET' is undefined and therefore not available during image build-time.
Warning: Environment variable 'MACOSX_DEPLOYMENT_TARGET_FOR_BUILD' is undefined and therefore not available during image build-time.
========================================================================================================================
GraalVM Native Image: Generating 'foo' (executable)...
========================================================================================================================
[1/8] Initializing...
(0.0s @ 0.08GB)
Error: Unable to detect supported DARWIN native software development toolchain.
Querying with command '/nix/store/yr2068d9m3nsc3g5gbjgj1n3fbr9rb89-clang-wrapper-19.1.7/bin/cc -v' prints:
clang version 19.1.7
Target: arm64-apple-darwin24.6.0
Thread model: posix
InstalledDir: /nix/store/p0y4nlhvjc8q7kgcj3w554vxg2h9mb0s-clang-19.1.7/bin
Error: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain
------------------------------------------------------------------------------------------------------------------------
0.1s (4.8% of total time) in 6 GCs | Peak RSS: 0.44GB | CPU load: 4.53
========================================================================================================================
Failed generating 'foo' after 0.8s.
Using the latest version of GraalVM can resolve many issues.
- I tried with the latest version of GraalVM.
GraalVM Version
openjdk version "24.0.2" 2025-07-15
OpenJDK Runtime Environment GraalVM CE 24.0.2+11.1 (build 24.0.2+11-jvmci-b01)
OpenJDK 64-Bit Server VM GraalVM CE 24.0.2+11.1 (build 24.0.2+11-jvmci-b01, mixed mode, sharing)
Operating System and Version
macOS 15.6.1
Build Command
native-image Foo
where Foo.class is a hello world.
Expected Behavior
Should believe in my toolchain.
Actual Behavior
Error: Unable to detect supported DARWIN native software development toolchain.
Querying with command '/nix/store/yr2068d9m3nsc3g5gbjgj1n3fbr9rb89-clang-wrapper-19.1.7/bin/cc -v' prints:
clang version 19.1.7
Target: arm64-apple-darwin24.6.0
Thread model: posix
InstalledDir: /nix/store/p0y4nlhvjc8q7kgcj3w554vxg2h9mb0s-clang-19.1.7/bin
Error: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain
Steps to Reproduce
$ nix-shell -p graalvmPackages.graalvm-ce
# gives you not-apple clang and a copy of graal
$ native-image Foo
Additional Context
No response
Build Log Output and Error Messages
see above