open{jdk{8,11,17,21,23},jfx{17,21,23}}: deduplicate#350736
open{jdk{8,11,17,21,23},jfx{17,21,23}}: deduplicate#350736thiagokokada merged 15 commits intoNixOS:staging-nextfrom
Conversation
This causes issues with the automated removal script.
This is about to go away.
|
Creating an entire Python package (and package itself) feels way overkill for an update script, which seems (hard to tell from my phone) to be contained in a single Python file. Unless there is library usage I'm not seeing, it would be preferable to condense that down to a single script file if possible. (Which for the record, I am definitely for using Python for the update script. An entire Python package just feels a bit overkill.) Will make a more proper review when I'm both on my laptop and feeling better |
|
It made the development easier (since it does have external dependencies, mostly the GitHub library) and means that the linting and type‐checking can be enforced. This caught a bunch of issues while I was working on it. Since it’s used in both OpenJDK and OpenJFX, the latter of which is now in Note that all the actual code is in one file. (I admit that |
|
I'm pretty sure it's relatively straight forward to make pyproject work in a flat directory, which would be better imo. I'd rather be slightly off of Python standards than have a tiny ancillary package with an absurd amount of boilerplate structure. Don't know how that's done off of the top of my head, but that's more to do with me not being able to think straight right now than anything else lol. Update script structure isn't a blocker by any means, and it can be cleaned up later. |
|
The way it is set up now allows doing e.g. A bigger problem is that |
|
Looks like I also have to figure out what’s causing the rebuild. |
7fc0ac7 to
9315e1f
Compare
|
Okay, hopefully fixed both of those. Naturally it was of course an error in the OpenJDK 8 derivation that I accidentally fixed. |
9315e1f to
103681c
Compare
|
Still showing a rebuild? Will look into it tomorrow. @ofborg eval |
Infinidoge
left a comment
There was a problem hiding this comment.
Overall looks great! Mainly some comments on code organization, plus a couple more important comments sprinkled in.
There was a problem hiding this comment.
Should also merge and reorder the lists here. I would be surprised if the order mattered, and IMO the extra lists make it harder to read and reason about. That said, if the order here is important, then that can be done in when the update scripts are run.
There was a problem hiding this comment.
Flag lists are ordered. However, most of the complexity here is not related to ordering; I believe only the devendoring flags are due to that. I plan to do a major clean‐up of this derivation for the 25.05 cycle and will rationalize this then.
There was a problem hiding this comment.
Why is this comment by itself >=17, when the actual code it refers to is >=11?
There was a problem hiding this comment.
Because it was changed between 11.nix and 17.nix, and this affects the derivation hash.
There was a problem hiding this comment.
Wouldn't ls $out/lib/openjdk/bin work?
There was a problem hiding this comment.
That would change the derivation hash.
There was a problem hiding this comment.
See comment near top about the double override which makes this currently redundant.
There was a problem hiding this comment.
I changed it to be like this because the OpenJDK 8 derivation incorrectly lists the non‐overridden bootstrap JDK here, making it quite useless, but affecting the derivation hash. I’ve removed the override from the function header for now so that this can correctly match the original derivation and avoid the rebuilds.
103681c to
afb8cd5
Compare
jtojnar
left a comment
There was a problem hiding this comment.
The update script changes look good to me.
Unfortunately, the logic does not translate to Nix 1:1 so we can probably only make it clearer by introducing comments.
|
Good idea, I’ve applied the comments. I was working out a clearer approach with less code duplication based on a fold, but then I realized that it’s not clear that the current behaviour is correct in all cases anyway, e.g. if you combine a |
afb8cd5 to
338d7cd
Compare
|
Base branch eval error was fixed. @ofborg eval |
|
Well, the rebuilds are not benign: they are the canary in the coal mine telling us that overriding |
Between the 2 options, I think the "Or just fix the few in‐tree users and accept a minor breaking change to the interface" is the most reasonable one. |
338d7cd to
55abf68
Compare
|
I’ve renamed the parameter to This should be ready to merge once ofborg says no rebuilds. |
Co-authored-by: Jan Tojnar <[email protected]>
55abf68 to
f3b30d4
Compare
| "armv7l-linux" | ||
| "armv6l-linux" | ||
| "powerpc64le-linux" | ||
| ]; |
There was a problem hiding this comment.
| ]; | |
| ++ lib.optionals atLeast17 [ | |
| "riscv64-linux" | |
| ]; |
This would make #343907 obsolete.
There was a problem hiding this comment.
Would you be up for rebasing your PR after this one merges? I’d be happy to review and merge it then (though I don’t have hardware to test it out). I’ve tried to keep this PR strictly to changes that result in no change in the resulting derivations and metas here in order to separate organizing the current state of things from deciding what the state of things ought to be; keeping it purely mechanical means that this PR can’t be responsible for any regressions, should never need to be reverted, and doesn’t express any policy other than “copy‐pasted code is bad”. Not that I expect adding RISC‐V support would lead to any of those, which is why I’m happy to hit the merge button after :)
|
One rebuild for the updater package 🎉 🎉 🎉 This is ready now. |
|
Thanks for the great work again @emilazy. |
|
Thanks for working on this, but I don't see the advantage of rewriting the update script. What's the painful part of running Java in the update script? The main reason for using Java was to avoid re-implementing the version parse logic. (#306616 (comment)). Also, it looks like the Python version doesn't work as expected: https://nixpkgs-update-logs.nix-community.org/jdk23/2024-10-31.log |
|
The problem with the Java dependency is that having to build an OpenJDK version to update that same OpenJDK version causes problems when adding new versions and causes huge builds when doing it on top of |
Fair enough, I didn't consider macOS (I don't have a mac, but it'd be nice to improve the macOS build)
In that case, something else is going on, or I'm missing something. The update script was executed, but I don't see a PR to update jdk23 to |
|
Yeah, I’d like to get our OpenJDK and OpenJFX packages building on Darwin so that we can use a source‐built JDK on all platforms and probably drop Zulu as redundant. I already did the update in #351025, which might be it. It’s possible there’s something else going on too, though, since r-ryantm can be a bit finnicky. If we don’t get the next batch of updates automatically I’ll look into it. |
Previously, the OpenJDK and OpenJFX derivations had been copied, pasted, and modified through some 14 distinct versions. This is a maintenance nightmare and resulted in a lot of inessential build configuration drift between versions. This PR aims to deduplicate them into a single expression with conditionals for the version; it should hopefully result in zero rebuilds.
The intent here is not to do anything about the madness but simply to make it legible, so as to have a single point of reference for future refactoring. I plan to do more aggressive clean‐up and add Darwin support to the derivations later, but this is what I have for 24.11. The nice thing about Nix is that as long as the resulting derivation hashes are the same, we don’t need to worry about my refactored code having significant errors.
I also rewrote the update script code. It’s in Python now, sorry; nothing against Java, but the previous state involved bootstrapping a JDK in order to run its own update script, which made adding OpenJDK 23 more of a pain than it needed to be, and I had to rework the behaviour in order to get the correct build number version handling in future. Python is the most common language for this kind of utility script in Nixpkgs after Bash, and I tried to extensively comment the code, so hopefully this won’t pose a maintenance burden for others in future.
cc @jtojnar for the update script combinator change – sorry for making it uglier.
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.