jdk{8,11,17,23,24}: always enable __structuredAttrs; cleanup#425773
jdk{8,11,17,23,24}: always enable __structuredAttrs; cleanup#425773symphorien merged 2 commits intoNixOS:stagingfrom
Conversation
|
Things to consider:
|
|
Hello mass rebuild. Ideally the root cause for why there is a difference in the function before/after structured attrs would be sorted out without a universe rebuild, however if no solution can be found then I think it is worth doing, as this is a huge oversight. |
|
Hey there! I'll change the code to only apply the workaround for JDK8, that should reduce rebuilds significantly! |
f80d3c7 to
6f6098a
Compare
6f6098a to
f89e9d8
Compare
|
Alright, I've changed the code and rebuilds are now at 101-500. |
|
That's a lot better, good catch |
|
in my opinion it is better to target staging and change for the better code now. Conditionals to prevent a mass rebuild like that are only useful to get a change quicker to master until it can be cleaned up in a mass rebuild, but there is no rush to enable debuginfo for jdk8. |
I don't really have an opinion on this, I'm open to whatever is preferred. If we go through with the mass rebuild, do you think it would be better to do this for all derivations with |
|
depends how you feel about fixing all occurences in nixpkgs :) but a change local to openjdk is fine by me. |
My "best fix" atm is to add another env variable in make-derivation.nix that has the order of the outputs. The problem with that approach is that derivations that use |
|
+1 to the doing the code and targeting for staging instead :P better than a hack tbh |
f89e9d8 to
4d187ee
Compare
b4bab36 to
9891244
Compare
|
Turns out |
There was a problem hiding this comment.
Came here because I wanted to see how you dealt with getAllOutputNames.. glad to see you just removed it. Will have to keep thinking about this elsewhere, whether we can fix the order of that somehow.
There was a problem hiding this comment.
If I were to fix getAllOutputNames, it would be something like this #425773 (comment). Like the comment says, it only addresses getAllOutputNames and scripts using $outputs or ${outputs[@]} would not be fixed.
Also, in response to #425561 (comment), it was said that relying on the order of getAllOutputNames is not correct, which I tend to agree with. Imo, getAllOutputNames should only be used for applying some steps equally to all outputs, where order does not matter.
I also searched Nixpkgs for occurrences of getAllOutputNames, $outputs, ${outputs[*]}, ${outputs[@]} and there were not that many occurrences. And the places where those were being used either the order was not relevant or there was already some fix in place to ensure the order was correct (look at expect-fail.sh). Only some JDK (jdk8, jetbrains-jdk) derivations were expecting the order to be correct and those are already being fixed.
In the end, if a fix for getAllOoutputNames is provided, I think it should be temporary. More (and clearer) documentation is needed to $outputs on the nix side and to getAllOutputNames on Nixpkgs side.
There was a problem hiding this comment.
If I were to fix
getAllOutputNames, it would be something like this #425773 (comment).
I'd do it differently: I'd just sort the outputs both with and without structuredAttrs alphabetically. That's consistent and rather simple to do.
It implies the same, though: Scripts should not rely on a specific order of these.
There was a problem hiding this comment.
@wolfgangwalther it appears this code in multiple-outputs.sh that relies on outputs having a fixed order when returned by getAllOutputNames
nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh
Lines 186 to 189 in 54066a5
There was a problem hiding this comment.
Thanks for finding this. I added it as a note to the tracking issue in #205690.
|
I just saw the review comments on #350736. Would you like me to address some of those (removing strings with just comments, fixing disallowedReferences for JDK8, ...) or do I just leave the PR as-is? |
You can honestly probably do it and then add ;cleanup to it (do it in a different commit though) |
9891244 to
1149111
Compare
There was a problem hiding this comment.
patchShebangs replaces /bin/bash automatically
There was a problem hiding this comment.
It appears setJavaClassPath is also propagated for jdk8, although it is done in the installPhase
There was a problem hiding this comment.
Previously, the build jobs were set based on the available cores on the machine and not the NIX_BUILD_CORES variable
There was a problem hiding this comment.
I removed these two lines and the build was still successful, so I figured I could remove them. Should I revert?
There was a problem hiding this comment.
This is automatically set based on propagatedBuildInputs
There was a problem hiding this comment.
Left a comment because I didn't know if this was correct or not
|
Did the cleanup and left some comments explaining some of the weirder changes. Other than those, the cleanup consisted of:
Built all jdk derivations and everything seems to be okay. EDIT: it's the first time I'm doing anything like this,.so I'm especially open to suggestions! Thanks! |
1149111 to
1bc0ebe
Compare
|
I will merge this soon unless somebody speaks up. |
|
thank you for your persistence, this kind of change is not easy. |
Re-enables
__structuredAttrsinjdk8.Because the
getAllOutputNamesfunction returns different results depending on the value of__structuredAttrs, and theLIBDIRSvariable needs to be constructed in a given order, the build forjdk8fails with__structuredAttrs = true. The outputs should be patched separately to avoid having a cycle between outputs.As such, I've simplified the
postFixuphook to useautoPatchelfindividually on each output. UsingautoPatchelfretains the old behavior and introduces other checks such as erroring when a library dependency cannot be satisfied.Relevant issue: #425323 (comment)
Follow up to: #425561
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.