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
modules-closure.sh: rewrite to use modinfo + small rust program #109094
base: master
Are you sure you want to change the base?
Conversation
Out of idle curiosity, is there a reason more of the |
ee2e9a4
to
afa2eae
Compare
No reason in particular, I might do more actually. edit: I remember now. One piece of code that can not be easily ported to rust is |
afa2eae
to
823fd44
Compare
Before I review this, it puts |
I think it's not in the closure currently. But it should not be needed for compiling the kernel even with this. The piece of code here should only be needed when assembling an initrd. Maybe the rust program should go in By the way I just started to learn rust, so if you should review this I am very much interested in opinion on style etc. as well! |
823fd44
to
bc7a79d
Compare
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.
Not a full review, but a few comments
done | ||
|
||
export allowMissing firmware | ||
copy-closure "$kernel" "$out" |
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.
I feel like there should be a bit more documentation of what copy-closure does, currently there is only the executable and the code
The use right here is probably fine, it's strictly a "native build input" use case, so no cross-compilation will be required for this feature. (The following does not really apply for this instance... But this is causing a precedent, so I will say it.) With that said, adding Rust dependencies to the basic build environment without Adding Rust dependencies as things are currently would be a regression against cross-compiling NixOS, which @flokli had recently managed to manage without external workarounds for a few generations. (Before a regression in an upstream dep caused new breakage.) |
I think our rust infrastructure should be cross-compile ready. I don't know about writers but a fix should not be that complicated. Otherwise just switching to |
Hm, I guess I had a wrong commit up when I last tried, yesterday, as it failed to build relatively early. Trying fresh, and the We don't yet have a job in Hydra to look at to guesstimate whether Rust cross-compilation through Note that the concern is still present: we shouldn't add dependencies (any!) to the base system unless cross-compilation for them is figured out. Sorry to for the noise right here. |
Yeah, this is up to people interested in cross-compilation and not in the scope of this PR. Right now it is too much of a burden to ask contributors to test cross-compilation like this one if it the majority of dependencies to cross-compile NixOS are not cached by hydra. |
Hm...
I would agree on a simple change, but this is about introducing a totally new ecosystem as a basic build dependency to NixOS. This is a design decision with broad repercussions. Yes it is up to the people interested in cross-compilation, and here I am, stating my concerns. I agree that it is too much of a burden right now to test it. I'm not asking that the change works as it is with cross-compilation. I'm asking that, as a distribution, we properly consider whether it is causing more breakage than it is worth. In this instance adding Rust is okay, it looks like it does cross-compile with I will state it again, in case people only skim my message: I am not against the change. I am bringing up concerns that any decisions to greatly affect the build closure of the base system should keep in mind that cross-compilation should be in a good enough state. It's fine if it doesn't work at the moment, things are still in flux, but they have to be in a place where it is known that cross-compilation was working fine recently.
Repeating this from your message again. What is the solution, if not to raise concerns? Should this get merged-in, then someone interested in cross-compilation comes behind, reverts? |
I was talking about adding rust to pkgsCross not beeing in scope of this PR. Not the other stuff. |
bc7a79d
to
ac931e5
Compare
wrt. cross compiling, am I correct that putting the rust helper in a proper package and using |
Or use packages from |
We also need rust to build the systemd initrd, so this should be fine.
|
17e3f42
to
144ba77
Compare
144ba77
to
ce7ca6e
Compare
I'm playing around with some code changes and fixing some clippy warnings etc. |
You want to build the |
ce7ca6e
to
c0ffd28
Compare
concerning documentation, should I add a README in |
There already is a short description in |
…or computing the closure
c0ffd28
to
d7f2fb4
Compare
This reverts commit 987bf5e.
Motivation for this change
Should fix #60416 (leakage of information from the building system), because modinfo only looks at the dependency information in the modules themselves.
Because modinfo only lists direct dependencies, we have to compute the closure ourselves with this approach.
Same approach as #107871, but the closure computation happens in a small rust program.
Based on #109050 which should be merged before this!Things done
This should produce bit-for-bit identical results compared to the old version (unless you have modules / module options on your kernel cmdline of course). You can (and should) check that withWell it actually won't because the store paths are different, but in a content addressed world they should..diffoscope
.sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)