Commit Graph

25 Commits

Author SHA1 Message Date
Thiago Kenji Okada
1fee681897 buildGraalvmNativeImage: fix UTF-8 encoding issue for JVM dependencies
Now that we can pass build arguments for the GraalVM builder again (see
https://github.com/NixOS/nixpkgs/pull/282901), this should work again.

Fix issue: https://github.com/NixOS/nixpkgs/issues/283953
2024-01-26 11:12:54 +00:00
sohalt
9d353905ea build-graalvm-native-image: pass whole environment
Pass the whole environment to the native-image build process by
generating a -E option for every environment variable.

This has the same effect as setting
NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION=true
but is compatible with packages providing -E options themselves
2024-01-22 18:11:14 +01:00
sohalt
2f6981d6e1 build-graalvm-native-image: do not use NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION
Packages that require access to environment variables in the build
should specify these using `-E` arguments in `nativeImageBuildArgs` or
using a `native-image.properties` as described here:
https://www.graalvm.org/22.1/reference-manual/native-image/BuildConfiguration/#embedding-a-configuration-file

Specifying NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION=true breaks with
packages that list their environment variables explicitly in `native-image.properties`.
2024-01-22 12:44:31 +01:00
Thiago Kenji Okada
ed5b0bccf5 buildGraalvmNativeImage: set NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION 2023-12-13 16:12:04 +00:00
Thiago Kenji Okada
ddf0003c57
Merge pull request #269479 from jcf/remove-more-graalvm-references
Remove more GraalVM references
2023-11-26 21:29:05 +00:00
James Conroy-Finn
56aedbd477
Move reference removal logic into build support 2023-11-26 11:23:15 +00:00
Diego B. Fernandez
8ac4d38ad9 buildGraalvmNativeImage: Set maximum page size to 64K on aarch64-linux 2023-11-23 23:47:23 +01:00
Thiago Kenji Okada
ca662df7bf buildGraalvmNativeImage: fix Unicode issue by setting encoding explicitly
Remove the old workaround where we set it by LC_ALL, that does not seem
to be working anymore.

Fixes #260161.
2023-11-16 10:13:46 +00:00
Moritz Heidkamp
7db47744f5 buildGraalvmNativeImage: build with "-march=compatibility" by default
This is necessary for compatibility with all targets supported by nixpkgs.
2023-10-12 11:42:56 +02:00
Thiago Kenji Okada
45eff9d9c7 graalvm-ce: 22.3.1 -> 21.0.0
This initially may look like a downgrade, but this is caused by how
upstream is tagging versions.

Before they would have the GraalVM having its own version (e.g. 22.3.1),
and each version would support multiple JVM versions (e.g. 11, 17, 19).
Now each release supports only one JVM version (e.g.: 21), and they
track the same version as the JVM.

They also changed packaging, making all sub-products (e.g.: GraalPy,
GraalRuby, etc.) standalone, so they do not depend in GraalVM anymore
and have their own version. Thanks to this change, we will need to
repackage everything.

To simplify, this commit will remove all sub-products and only care
about the GraalVM/Native Image (that is back to GraalVM itself) part.
Other commits will re-added each sub-product.

Fix (partial): https://github.com/NixOS/nixpkgs/issues/257292
2023-09-27 10:25:44 +01:00
Thiago Kenji Okada
f05d7d022c buildGraalvmNativeImage: allow overwriting {build,install}Phase/nativeBuildInputs 2023-03-17 16:50:52 +00:00
Thiago Kenji Okada
aea640a73b buildGraalvmNativeImage: allow overriding attributes
Remove the previous function closure, that would make it difficult to
access the inner derivation attributes.

Fix issue #216787.
2023-02-18 12:38:09 +00:00
Thiago Kenji Okada
d2e047f112 graalvm-ce: add it to all-packages pointing to graalvm11-ce 2023-02-12 19:08:44 +00:00
Thiago Kenji Okada
6704d4f4e4 bbin: inherit graalvmDrv from babashka 2023-02-11 14:03:22 +00:00
Thiago Kenji Okada
256195c07a native-image-installable-svm: init at 22.3.0
Also refactor the buildGraalvm derivation, allowing it to compose with
the other products.
2023-02-09 21:42:39 +00:00
Thiago Kenji Okada
afb99ad5d4 graalvm*-ce: wrap native-image to pass -H:CLibraryPath, misc improvements
Fixes issue #214922 by not adding C libraries to the default library
path of GraalVM. This should reduce the closure size of native compiled
binaries in nixpkgs again, e.g.:

Before:
```
$ ldd ./result/bin/bb
	linux-vdso.so.1 (0x00007fff2669b000)
	libstdc++.so.6 => /nix/store/qbgfsaviwqi2p6jr7an1g2754sv3xqhn-gcc-11.3.0-lib/lib/libstdc++.so.6 (0x00007f77fc0cf000)
	libm.so.6 => /nix/store/l7vp7c9z03dspbmss3gq5wdwx5c6ifcq-graalvm11-ce-22.3.0/lib/svm/clibraries/linux-amd64/libm.so.6 (0x00007f77fbfef000)
	libpthread.so.0 => /nix/store/l7vp7c9z03dspbmss3gq5wdwx5c6ifcq-graalvm11-ce-22.3.0/lib/svm/clibraries/linux-amd64/libpthread.so.0 (0x00007f77fbfea000)
	libdl.so.2 => /nix/store/l7vp7c9z03dspbmss3gq5wdwx5c6ifcq-graalvm11-ce-22.3.0/lib/svm/clibraries/linux-amd64/libdl.so.2 (0x00007f77fbfe5000)
	librt.so.1 => /nix/store/l7vp7c9z03dspbmss3gq5wdwx5c6ifcq-graalvm11-ce-22.3.0/lib/svm/clibraries/linux-amd64/librt.so.1 (0x00007f77fbfde000)
	libc.so.6 => /nix/store/l7vp7c9z03dspbmss3gq5wdwx5c6ifcq-graalvm11-ce-22.3.0/lib/svm/clibraries/linux-amd64/libc.so.6 (0x00007f77fbdd5000)
	/nix/store/c35hf8g5b9vksadym9dbjrd6p2y11m8h-glibc-2.35-224/lib/ld-linux-x86-64.so.2 => /nix/store/9xfad3b5z4y00mzmk2wnn4900q0qmxns-glibc-2.35-224/lib64/ld-linux-x86-64.so.2 (0x00007f77fc2e7000)
	libgcc_s.so.1 => /nix/store/qbgfsaviwqi2p6jr7an1g2754sv3xqhn-gcc-11.3.0-lib/lib/libgcc_s.so.1 (0x00007f77fbdbb000)
```

After:
```
$ ldd ./result/bin/bb
	linux-vdso.so.1 (0x00007fffdfd4e000)
	libstdc++.so.6 => /nix/store/qbgfsaviwqi2p6jr7an1g2754sv3xqhn-gcc-11.3.0-lib/lib/libstdc++.so.6 (0x00007fc3a5658000)
	libm.so.6 => /nix/store/c35hf8g5b9vksadym9dbjrd6p2y11m8h-glibc-2.35-224/lib/libm.so.6 (0x00007fc3a5578000)
	libpthread.so.0 => /nix/store/c35hf8g5b9vksadym9dbjrd6p2y11m8h-glibc-2.35-224/lib/libpthread.so.0 (0x00007fc3a5573000)
	libdl.so.2 => /nix/store/c35hf8g5b9vksadym9dbjrd6p2y11m8h-glibc-2.35-224/lib/libdl.so.2 (0x00007fc3a556e000)
	librt.so.1 => /nix/store/c35hf8g5b9vksadym9dbjrd6p2y11m8h-glibc-2.35-224/lib/librt.so.1 (0x00007fc3a5569000)
	libc.so.6 => /nix/store/c35hf8g5b9vksadym9dbjrd6p2y11m8h-glibc-2.35-224/lib/libc.so.6 (0x00007fc3a535e000)
	/nix/store/c35hf8g5b9vksadym9dbjrd6p2y11m8h-glibc-2.35-224/lib/ld-linux-x86-64.so.2 => /nix/store/9xfad3b5z4y00mzmk2wnn4900q0qmxns-glibc-2.35-224/lib64/ld-linux-x86-64.so.2 (0x00007fc3a5870000)
	libgcc_s.so.1 => /nix/store/qbgfsaviwqi2p6jr7an1g2754sv3xqhn-gcc-11.3.0-lib/lib/libgcc_s.so.1 (0x00007fc3a5344000)
```

Also improves the installCheckPhase to include more tests and improve
the old onest .
2023-02-07 17:00:13 +00:00
Thiago Kenji Okada
8f58bc3a1d buildGraalvmNativeImage: allow LC_ALL overrides 2022-07-03 18:16:38 +01:00
Thiago Kenji Okada
44a4401945 buildGraalvmNativeImage: mark as broken if Native Image is not available 2022-04-15 23:20:52 +01:00
Thiago Kenji Okada
bdfff535f0 buildGraalvmNativeImage: allow usage of arbitrary graalvm derivation
This will allow for easier overrides for specific systems (e.g.
`aarch64-linux` that is only supported in `graalvm17-ce`).
2022-03-31 22:35:44 +01:00
heyarne
ce9b3a3723 buildGraalVmNativeImage: enable utf-8 by default
The tools built with buildGraalVmNativeImage have broken UTF-8 support
when not properly setting the locale, e.g.

$ bb -e '(prn "bépo àê")'
"b??po ????"

This commit sets the locale to en_US.UTF-8 by default, which fixes that.
2022-01-04 09:56:34 +01:00
Thiago Kenji Okada
24f9dcd06b buildGraalvmNativeImage: fix meta 2021-12-27 19:49:52 -03:00
Thiago Kenji Okada
a5c0f59bf7 buildGraalvmNativeImage: allow nativeImageBuildArgs to be overwritten 2021-11-25 11:02:46 -03:00
Thiago Kenji Okada
f1c16183c8 buildGraalvmNativeImage: fix meta, add --verbose flag 2021-11-24 10:37:33 -03:00
Thiago Kenji Okada
d352856ea2 buildGraalvmNativeImage: default executable to pname 2021-11-24 10:37:32 -03:00
Thiago Kenji Okada
1415e30830 buildGraalvmNativeImage: init
For now it only takes care of the single Jar <-> single Executable case.
This will take care of the majority (all?) use cases we have in nixpkgs
currently.
2021-11-24 10:37:32 -03:00