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

linux: do not depend on systemd indirectly #86208

Merged
merged 1 commit into from Apr 29, 2020

Conversation

arianvp
Copy link
Member

@arianvp arianvp commented Apr 28, 2020

utillinux depends on systemd because:

systemd doesn't depend on utillinux but on utillinuxMinimal which is a
version of utillinux without these features to avoid cyclic
dependencies.

With this change, the linux kernel (of which i don't fully understand
why it would depend on util-linux in the first place, but this was added in
https://github.com/NixOS/nixpkgs/pull/32137/files without too much
explanation) depends on the minimal version of util-linux too.

This makes it that every time we change build flags in systemd
the linux kernel doesn't have to wastefully rebuild.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

utillinux depends on systemd because:

* uuidd supports socket activation
* lslogins can show recent journal entries
* fstrim comes with a service file (and we use this in NixOS)
* logger can write journal entries
(See https://www.openembedded.org/pipermail/openembedded-core/2015-February/102069.html)

systemd doesn't depend on utillinux but on utillinuxMinimal which is a
version of utillinux without these features to avoid cyclic
dependencies.

With this change, the linux kernel (of which i don't fully understand
why it would depend on util-linux in the first place, but this was added in
https://github.com/NixOS/nixpkgs/pull/32137/files without too much
explanation) depends on the minimal version of util-linux too.

This makes it that every time we change build flags in systemd
the linux kernel doesn't have to wastefully rebuild.
@flokli
Copy link
Contributor

flokli commented Apr 28, 2020

@arianvp did you try building it without utillinux to see how it fails? ;-)

@arianvp
Copy link
Member Author

arianvp commented Apr 29, 2020

It's listed as a dependency here: https://www.kernel.org/doc/html/v4.15/process/changes.html

so i'll just believe them :)

@flokli
Copy link
Contributor

flokli commented Apr 29, 2020

Fair enough :-D

@flokli flokli merged commit fbc63c4 into NixOS:staging Apr 29, 2020
@arianvp
Copy link
Member Author

arianvp commented Apr 29, 2020

for some reason build times of the kernel regressed enormously. it is stuck rsync'ing things in the postInstall script for hours and hours. Not sure if that's due to the dependency change; I would be surprised; but i'll try building the kernel again without my changes and see if this is something I introduced or not...

@flokli
Copy link
Contributor

flokli commented Apr 29, 2020

I see the following output:

rsync: failed to set permissions on "/nix/store/v1q8m9vsvjhc5zp0rdrzq62lhbqyddz5-linux-5.5.19-dev/lib/modules/5.5.19/source/.COPYING.5uJvZC": Function not implemented (38)
rsync: failed to set permissions on "/nix/store/v1q8m9vsvjhc5zp0rdrzq62lhbqyddz5-linux-5.5.19-dev/lib/modules/5.5.19/source/.CREDITS.ZjYYtD": Function not implemented (38)

Reverting d103dc4 (this PR) didn't help - so I don't think it's caused by this PR. Maybe it's #85951, but need to bisect further to say for sure.

@arianvp
Copy link
Member Author

arianvp commented Apr 29, 2020

I added the --verbose flag to rsync. somewhere at the beginning it poops out those permission isues but I think they're moot.

However after a while progress seems to be stuck:

Documentation/arm64/acpi_object_usage.rst
Documentation/arm64/arm-acpi.rst
Documentation/arm64/booting.rst
Documentation/arm64/cpu-feature-registers.rst
Documentation/arm64/elf_hwcaps.rst
Documentation/arm64/hugetlbpage.rst
Documentation/arm64/index.rst
Documentation/arm64/kasan-offsets.sh
Documentation/arm64/legacy_instructions.rst
Documentation/arm64/memory.rst
Documentation/arm64/perf.txt
Documentation/arm64/pointer-authentication.rst
Documentation/arm64/silicon-errata.rst
Documentation/arm64/sve.rst

... here it hangs

maybe it's actually the next command after the rsync that is stuck... ill add some more debug logs (set -x) to the script

@flokli
Copy link
Contributor

flokli commented Apr 29, 2020

Indeed my assumption was right - see #85951 (comment) for what broke it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants