Skip to content

rsync: Remove fakeroot from checkInputs - #446259

Merged
ElvishJerricco merged 1 commit into
NixOS:stagingfrom
ElvishJerricco:push-swxztqmkpoqq
Oct 13, 2025
Merged

ElvishJerricco merged 1 commit into
NixOS:stagingfrom
ElvishJerricco:push-swxztqmkpoqq

Conversation

@ElvishJerricco

@ElvishJerricco ElvishJerricco commented Sep 26, 2025 •

Copy link
Copy Markdown
Contributor

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.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

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.
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. labels Sep 26, 2025
@nix-owners
nix-owners Bot requested a review from ivan September 26, 2025 06:59

@balsoft balsoft left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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:

  1. Keeping all tests which don't require extra dependency running even if you don't run passthru.tests
  2. Not losing any tests on CI
  3. 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).

@ElvishJerricco

Copy link
Copy Markdown
Contributor Author

@balsoft I really do not think these two little tests are worth all of that.

@GrimmTheShrimp GrimmTheShrimp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 5, 2025
@ElvishJerricco
ElvishJerricco added this pull request to the merge queue Oct 13, 2025
Merged via the queue into NixOS:staging with commit ce95c22 Oct 13, 2025
@ElvishJerricco
ElvishJerricco deleted the push-swxztqmkpoqq branch October 13, 2025 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants