Repository navigation
rsync: Remove fakeroot from checkInputs - #446259
Merged
Merged
Conversation
Having `fakeroot` in `checkInputs` has the unfortunate side effect of
making rsync depend on systemd, and by extension making the linux
kernel depend on systemd.
```
$ nix why-depends --derivation --all -f . linux systemd.src
/nix/store/ahnjzvyxn3jqaaqmhkrdxfimzd8m6yya-linux-6.12.48.drv
└───/nix/store/07v98114pg0v4vb8xahdj6v488piy23r-rsync-3.4.1.drv
└───/nix/store/70yyn9xwg3gkmdw7azal22wb8hp2lyxz-fakeroot-1.37.1.2.drv
└───/nix/store/sac9bwghprnv77v8c65ljrwpr09c2wbi-libcap-2.76.drv
└───/nix/store/9v3wirxpv9dzjkpr2swkgfwi78q0d72d-linux-pam-1.7.1.drv
└───/nix/store/gfkzz6c2lhr73habq4x9ci7bj6jfgjgz-systemd-minimal-libs-257.9.drv
└───/nix/store/kxpjbfihhzkm2dilaj4xxndxfwmbm98z-source.drv
```
My main goal is keep systemd updates from rebuilding the kernel, and
admittedly the use of rsync in the kernel derivation is completely
unnecessary. But I think, in its own right, removing the dependency of
rsync on systemd is worthwhile.
The consequence of this is that we have to skip two additional tests
(out of the total of 46), namely the `chown` and `devices` tests.
balsoft
reviewed
Sep 26, 2025
balsoft
left a comment
Member
There was a problem hiding this comment.
Perhaps consider adding something like
passthru.tests = lib.optionalAttrs (!stdenv.isDarwin) {
withAllTests = rsync.overrideAttrs (_: { checkInputs = [ fakeroot ]; });
}This will unfortunately rebuild all of rsync again and run some tests twice, but has the benefits of:
- Keeping all tests which don't require extra dependency running even if you don't run
passthru.tests - Not losing any tests on CI
- Keeping consumers of rsync free of the fakeroot dependency.
Alternatively, just set doCheck = false on the main derivation and move both doCheck = true and checkInputs into passthru.tests.withChecks or similar. This will eliminate running tests twice (and will also speed up rebuilds a bit).
2 of 13 tasks
Contributor
Author
|
@balsoft I really do not think these two little tests are worth all of that. |
GrimmTheShrimp
approved these changes
Oct 5, 2025
GrimmTheShrimp
left a comment
Contributor
There was a problem hiding this comment.
The alternative is to build fakeroot with a libcap that has been stripped of pam, see #431477 (comment).
I am however not sure which of the two approaches to prefer, so this one does get my approval.
3 tasks done
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Having
fakerootincheckInputshas the unfortunate side effect of making rsync depend on systemd, and by extension making the linux kernel depend on systemd.My main goal is keep systemd updates from rebuilding the kernel, and admittedly the use of rsync in the kernel derivation is completely unnecessary. But I think, in its own right, removing the dependency of rsync on systemd is worthwhile.
The consequence of this is that we have to skip two additional tests (out of the total of 46), namely the
chownanddevicestests.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.