openjdk: remove references also in CA-derivations#354451
openjdk: remove references also in CA-derivations#354451gador wants to merge 1 commit intoNixOS:stagingfrom
Conversation
analog to NixOS#350137 Signed-off-by: Florian Brandes <[email protected]>
|
@emilazy you did some major refactoring recently to |
|
I don’t really understand the patch. Why do we need to remove references here? Also, we should not propagate the |
Because with ca derivations enabled by default, there is this reference which isn't removed
This is a bit above my knowledge. I did take a look there and am not that confident to change that. There seems to be only a few derivations which need that reference removed by hand (see the linked issue or #297466) and without this fix, |
What leaves a reference to the bootstrap JDK? There shouldn’t be any present, so having to strip them out seems concerning.
The current state is incorrect and does not prevent references to the correct bootstrap package on JDK 8. I only kept it when merging the packages into one file to avoid rebuilds. If we’re touching the disallowed references code, we should use |
The same thing that is required to have
Ah, I missunderstood. I thought you were asking me to fix diff --git a/pkgs/development/compilers/openjdk/generic.nix b/pkgs/development/compilers/openjdk/generic.nix
index 3238dc521561..ff5371882d8e 100644
--- a/pkgs/development/compilers/openjdk/generic.nix
+++ b/pkgs/development/compilers/openjdk/generic.nix
@@ -580,8 +580,6 @@ stdenv.mkDerivation (finalAttrs: {
mkdir -p $out/nix-support
#TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
echo -n "${setJavaClassPath}" > $out/nix-support/propagated-build-inputs
- # remove references also in CA-derivations
- find "$out" -type f -exec remove-references-to -t ${jdk-bootstrap'} '{}' +
''
else
''
@@ -590,8 +588,6 @@ stdenv.mkDerivation (finalAttrs: {
# properly.
mkdir -p $jre/nix-support
printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs
- # remove references also in CA-derivations
- find "$out" -type f -exec remove-references-to -t ${jdk-bootstrap} '{}' +
''
)
+ ''
@@ -601,6 +597,8 @@ stdenv.mkDerivation (finalAttrs: {
cat <<EOF > $out/nix-support/setup-hook
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
EOF
+ # remove references also in CA-derivations
+ find "$out" -type f -exec remove-references-to -t ${jdk-bootstrap'} '{}' +
'';
postFixup = ''
@@ -626,7 +624,7 @@ stdenv.mkDerivation (finalAttrs: {
# TODO: The OpenJDK 8 derivation got this wrong.
disallowedReferences = [
- (if atLeast11 then jdk-bootstrap' else jdk-bootstrap)
+ jdk-bootstrap'
];
passthru = |
The |
Why do you think it is an assertion? If I read #211783 correctly, it actually removes the reference completely from the output. Following up on that NixOS/nix#4629 (comment) states that the As @thufschmitt said in NixOS/nix#4629 (comment) this is probably a wontfix in Ergo this needs the |
|
My understanding of that PR is that it just addresses an infelicity where I believe this patch is incorrect; it would mean that the |
I still don't believe it to be a check but an actual removal of build-outputs from the output. Just not for
Agreed. Although I believe ca-derivations to be an important experimental feature, which we should try to make it work. The sprinkles are rather few anyway. If #214044 actually fixes the issue, I would rather have that in |
No:
They are sprinkles that subvert the very purpose of the mechanism they are trying to fix. If you add |
|
Thanks for the example and the clarification. This did help a lot. |
|
Yeah, I think that sounds reasonable. The |
Ok, cool.
I don't know, I'll look into it tomorrow 👍 |
|
Let's do #214044 instead, please. |
@emilazy I have found Take nixpkgs/pkgs/applications/radio/gnuradio/shared.nix Lines 71 to 75 in 23e89b7 and nixpkgs/pkgs/applications/radio/gnuradio/shared.nix Lines 85 to 93 in 23e89b7 So, what should we do about those? |
|
For example in #49856 both ( |
|
I think that they can make sense in conjunction sometimes: you want to enforce that nobody accidentally makes a reference leak, and there are also known references you want to remove to achieve that. If you strip references from every single file in the output, then the check can never break. But if it’s only one or two files it can be a sensible combination. Even if you’re stripping all references, maybe you’re worried about someone doing something in In the So I am only really concerned with packages that had I still don’t fully understand where the |
|
Yeah, this goes a little bit above my understanding, too :-D Thanks for your explanation about the differences and the usecases for |
|
BTW, I forgot to mention that |
analog to #350137
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.