Avoid Two Sets of systemd Binaries in System Closure#261798
Avoid Two Sets of systemd Binaries in System Closure#261798flokli merged 4 commits intoNixOS:stagingfrom
Conversation
There was a problem hiding this comment.
This should probably go into pkgs/development/tools/build-managers/meson/setup-hook.sh.
There was a problem hiding this comment.
Something like mesonInstallFlags?
|
I like the idea of this change. I think we can even delete |
There was a problem hiding this comment.
Something like mesonInstallFlags?
a65b958 to
99f4d2a
Compare
99f4d2a to
6f05322
Compare
6f05322 to
3083cb9
Compare
doc/hooks/meson.section.md
Outdated
There was a problem hiding this comment.
The headers where ### and #### for no apparent reason. I fixed them to be consistent.
The problem is that some places actually use this as a "minimal systemd" and not as "libudev". :( |
Like an alias? |
|
You wrote on the commit message:
A not so long time ago I came across a nasty bug: I treated Since then I do not recommend the reuse of flags. So, I suggest an exclusive name for this: Also, in tandem I will open a refactor PR of Meson, specifically capturing this issue. |
Then this should be fixed :-) |
If you do this, that'd be great. I can also change it here for now. |
This PR sort of does this. |
3083cb9 to
0cebd40
Compare
Projects building with meson are currently installTargets. Map these to install tags, which are roughly equivalent. This allows projects to selectively install components.
systemdMinimal is used to break the dependency cycle of libraries required by systemd on itself. The problem is that this means that every system closure will have two sets of systemd binaries in the closure. This wastes around 10 MiB in every system closure. Add the option to systemd to only ship libudev and libsystemd instead of a whole systemd installation.
pcsclite only depends on libsystemd and libudev.
0cebd40 to
dd97082
Compare
|
@AndersonTorres I've resolved the issues. Do you think it makes sense to fix existing uses of |
|
Another PR is better. |
| udev = | ||
| if (with stdenv.hostPlatform; isLinux && isStatic) then libudev-zero | ||
| else systemd; # TODO: change to systemdMinimal | ||
| else systemdLibs; |
There was a problem hiding this comment.
This broke some things that expected udev to have executables. See e.g. #268813.
There was a problem hiding this comment.
@arianvp Let's revert this change then. Long-term I think the better solution is to create a real udev package with libs and binaries and all. The systemd build system makes this hard though. I have to study how Fedora does this.
There was a problem hiding this comment.
Ok. That also makes sense.
If it still comes to reverting this, please leave the mesonInstallTags change in place. I think this is genuinely useful elsewhere.
|
Darnit. I think we should revert this PR. A lot of places in nixpkgs assume udevadm to exist in the udev package If you search for udevadm there are a lot of hits |
Description of changes
We currently end up with two systemds in every system closure. One is the one you want and the second one is systemdMinimal. This includes the full set of systemd binaries, but it's only there to provide libudev and libsystemd. This wastes around 10 MiB of space.
I'm not sure that what I've done here is a good idea. Consider it a PoC.
Also see #261795.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)