Skip to content
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

WIP: reintroduce the systemd lib output #99881

Draft
wants to merge 4 commits into
base: staging
Choose a base branch
from

Conversation

andir
Copy link
Member

@andir andir commented Oct 6, 2020

Motivation for this change

Yesterday I started hacking on some changes for systemd and I think the approach might be suitable for one of our current problems with closure bloat (due to not having a lib output) anymore.

The basic idea is to distinguish between build-time and run-time paths in the meson world. There are paths where build results should be installed to but those aren't always the same during runtime.

One concern, to this approach, was that we must always popluate /run/current-system/systemd before stage-2. That is currently the case and not a reason to worry. It will be more difficult once we migrate to initrd in stage-1 but for that to happen we should probably start cleaning up a lot of other things first.

Right now I also have some changes in here that cut down on the test closure size of NixOS tests. I'm willing to file them as another PR if you do not want to mix these things.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
    • I did run the entire small release set and most of the "normal" NixOS tests. Haven't seen any new issues that do not look like normal test flakiness.
  • check if we still need the aarch64 hack

andir and others added 4 commits October 5, 2020 21:52
Since we previously stripped down the features of `qemu_test` some of
the features users are used to while running tests through the (impure)
driver didn't work anymore. Most notably we lost support for graphical
output and audio. With this change the `driver` attribute uses are more
feature complete version of QEmu compared to the one used in the pure
Nix builds.

This gives us the best of both worlds. Users are able to see the
graphical windows of VMs while CI and regular nix builds do not have to
download all the (unnecessary) dependencies.
This allows much faster VM-test based systemd testing as the closure of
qemu suddenly shrinks to reasonable sizes again.
Now that $lib doesn't refer to rootprefixdir anymore,  the
cyclic dependnecy should be gone
@andir andir changed the title WIP: reintroduce the lib output WIP: reintroduce the systemd lib output Oct 6, 2020
@arianvp
Copy link
Member

arianvp commented Oct 6, 2020

cc @edolstra


# Keep only libudev and libsystemd in the lib output.
mkdir -p $out/lib
mv $lib/lib/security $lib/lib/libnss* $out/lib/
Copy link
Member

@arianvp arianvp Oct 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually wonder why

./lib/libnss_myhostname.so.2
./lib/libnss_systemd.so.2
./lib/libnss_mymachines.so.2
./lib/libnss_resolve.so.2

are not part of the $lib output? Commit history doesnt really help here. But I see no point in not having them in $lib ? This is not your fault; but I just wonder what the historic reason is... I would actually just move them to the $lib output

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree. I've, in the past, often questioned what we moved to lib and what not. Eventually I think that even lib might not be granular enough. I could think of separating libraries for udev, runtime plugins (like nss) etc in their output so the closures of things that aren't really part of a NixOS system will not be present on systems that just use nixpkgs outside of NixOS.

@stale
Copy link

stale bot commented Jul 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants