-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
babashka: 1.3.186 -> 1.3.188, buildGraalNativeImage: remove NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION #282901
Conversation
…R_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`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this PR missing something? Because I am not seeing the removal of NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION
.
But anyway, this will not work because we depend in NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION
for the NIX_*
that we will pass to the build environment and GraalVM will ignore without NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION
. It may work in Linux in some cases but definitely will not work in Darwin because we need to pass macOS libraries via NIX_LD_FLAGS
.
Sorry, I forgot to push…
Is this the case for builds with |
Yes, this is the case for builds with
Will be built in OfBorg automatically, but I will review/build before merging.
At least But actually there are many more flags that needs to be passed, this is why we decided by simply using You can take a look at the derivation that we pass to the builder, and pretty much every flag with
So that is the point of the issue above, we need to have a pretty good understanding of everything we need to pass to the builder environment to make sure that we are not missing anything. BTW, why is |
Also, please take a look at #273961 to understand the context why we are using |
Yes, babashka is failing now, since
I could probably do something like |
This will not solve the issue since |
What about constructing the args to |
Yes, this would work. Are you interested in working on this @Sohalt ? |
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
Result of 1 package marked as broken and skipped:
1 package failed to build:
10 packages built:
|
Thanks @Sohalt. |
Now that we can pass build arguments for the GraalVM builder again (see NixOS#282901), this should work again. Fix issue: NixOS#283953
Now that we can pass build arguments for the GraalVM builder again (see NixOS#282901), this should work again. Fix issue: NixOS#283953
Description of changes
Since babashka/babashka@6052b9b babashka uses
-E
arguments tobuild-native-image
, which are incompatible with our use ofNATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION
.Derivations using
buildGraalvmNativeImage
should specify environment variables needed during compliation using-E
innativeImageBuildArgs
.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)cc maintainers: @thiagokokada @jlesquembre @bennyandresen @bhougland @DerGuteMoritz @ericdallo @babariviere @stelcodes @rtimush @sg-qwt
--
Add a 👍 reaction to pull requests you find important.