Skip to content

Comments

Improve check that evaluation does not depend on the Nixpkgs path#156587

Merged
edolstra merged 2 commits intoNixOS:masterfrom
edolstra:path-independent
Jan 25, 2022
Merged

Improve check that evaluation does not depend on the Nixpkgs path#156587
edolstra merged 2 commits intoNixOS:masterfrom
edolstra:path-independent

Conversation

@edolstra
Copy link
Member

Motivation for this change

While adding a evaluation regression test to Nix, I found that the docbookrx package in revision b1f2623 depends on the location of Nixpkgs. The function pathDerivation in pkgs/development/ruby-modules/bundled-common/functions.nix encodes the source path of the Gem (e.g. /home/eelco/Dev/nixpkgs/pkgs/tools/typesetting/docbookrx) into the derivation, which is impure and doesn't work in a sandboxed environment. The fix is to ensure that the input is copied to the store. I also improved the test in pkgs/top-level/nixpkgs-basic-release-checks.nix to make sure that this is caught.

Note that docbookrx has been removed in master, but we should ensure that this doesn't reoccur.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Otherwise you end up with a derivation that refers to the original
path (which is not in the Nix store and not accessible to
builders). This caused the derivation paths for the docbookrx package
(removed on master) to depend on the location of the nixpkgs source
tree.
@edolstra edolstra requested a review from marsam as a code owner January 24, 2022 19:18
@github-actions github-actions bot added the 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. label Jan 24, 2022
@edolstra edolstra added the 6.topic: release process Issues or PRs which are parts of the NixOS release process label Jan 24, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jan 24, 2022
@edolstra edolstra merged commit 651c5ce into NixOS:master Jan 25, 2022
@edolstra edolstra deleted the path-independent branch January 25, 2022 19:08
@github-actions
Copy link
Contributor

Successfully created backport PR #156751 for release-21.11.

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

Labels

6.topic: release process Issues or PRs which are parts of the NixOS release process 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant