NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.09k stars 14.14k forks source link

`docbookrx` is impure, depends on nixpkgs checkout #152968

Closed trofi closed 2 years ago

trofi commented 2 years ago

The reproducer is visible on a no-op rebuild checker:

$ ./maintainers/scripts/rebuild-amount.sh --print HEAD
Estimating rebuild amount by counting changed Hydra jobs (parallel=unset).
      1 x86_64-darwin
      1 x86_64-linux

docbookrx.x86_64-darwin                                                                   /nix/store/zsgardrx1b1spk9cgpx1zgdnfrd2pv40-docbookrx-unstable-2018-05-18
docbookrx.x86_64-linux                                                                    /nix/store/7bapxpsv236sc3nvjcc7429hvlinm8x2-docbookrx-unstable-2018-05-18

If I diff 2 derivations we see the path of nixpkgs leaked into derivation definition:

nix-shell -p nix-diff
this path will be fetched (0.40 MiB download, 2.20 MiB unpacked):
  /nix/store/1b0270ghqrp9wfqwkrwkchxq4nym7sc8-nix-diff-1.0.17
copying path '/nix/store/1b0270ghqrp9wfqwkrwkchxq4nym7sc8-nix-diff-1.0.17' from 'https://cache.nixos.org'...

[nix-shell:~/dev/git/nixpkgs-staging]$ nix-diff /nix/store/h5lhl6gvh0a9rycj3smljps4nf3am6fy-docbookrx-unstable-2018-05-18.drv /nix/store/x80lk8fcqahhh0i0ks564p55jsl4bzkh-docbookrx-unstable-2018-05-18.drv
- /nix/store/h5lhl6gvh0a9rycj3smljps4nf3am6fy-docbookrx-unstable-2018-05-18.drv:{out}
+ /nix/store/x80lk8fcqahhh0i0ks564p55jsl4bzkh-docbookrx-unstable-2018-05-18.drv:{out}
• The input derivation named `wrapped-ruby-docbookrx-env` differs
  - /nix/store/gvm3a910rl6cpwvda6bfz004158z4q2l-wrapped-ruby-docbookrx-env.drv:{out}
  + /nix/store/q6m3sfrp6dpdgq14cnidd9pm10xcgrww-wrapped-ruby-docbookrx-env.drv:{out}
  • The input derivation named `docbookrx-env` differs
    - /nix/store/6c03vq6vbdjl5b75jamlhvi1vz4f1567-docbookrx-env.drv:{out}
    + /nix/store/vk1mmn0mq1f0z32ianz2kw6pax0kd1bf-docbookrx-env.drv:{out}
    • The environments do not match:
        postBuild=''
        /nix/store/im7rp3a193kllpw4f3prfm4cxnf8x1fi-ruby-2.7.5/bin/ruby /nix/store/zhh0pbcdknhjp5s2kc1jkfyrdna8va86-gen-bin-stubs.rb \
          "/nix/store/im7rp3a193kllpw4f3prfm4cxnf8x1fi-ruby-2.7.5/bin/ruby" \
          "/nix/store/2zcksxrcxik8lc6fm2ckqmnh1xs5vc18-gemfile-and-lockfile/Gemfile" \
          "$out/lib/ruby/gems/2.7.0" \
          "/nix/store/pvl7nl36r298n5rb8sinli395ycy1l6l-bundler-2.2.24/lib/ruby/gems/2.7.0/gems/bundler-2.2.24" \
          '/nix/store/0bcyxvwycsxjsyj93yy6zn9hzp0sqzx8-ruby2.7.5-diff-lcs-1.4.4 /home/slyfox/dev/git/nixpkgs-staging_/pkgs/tools/typesetting/docbookrx/home/slyfox/dev/git/nixpkgs-staging/pkgs/tools/typesetting/docbookrx /nix/store/qq2mqwn86r12ck16mwng3530rryc192q-ruby2.7.5-nokogiri-1.11.7 /nix/store/a8q1zy0vr5aab1rpg4ff7fjmc6k2dznw-ruby2.7.5-racc-1.6.0 /nix/store/38slfcpx4l097p9aj3fm1v6xx4hl7f7y-ruby2.7.5-rake-13.0.6 /nix/store/bdalck43zf0sbqkhdh23wr78inij69h9-ruby2.7.5-rspec-3.9.0 /nix/store/hwbgbg4r4pjhmhbycpdsdfs83hia9znk-ruby2.7.5-rspec-core-3.9.3 /nix/store/ln29akgr9g1h3q9wik7cjpw37hdychnn-ruby2.7.5-rspec-expectations-3.9.4 /nix/store/02bq5p8j0vhm6mp0451fvdh2hba7z0s4-ruby2.7.5-rspec-mocks-3.9.1 /nix/store/nm0p91w1h9a5p56g2k2bhpfpfhsicvyi-ruby2.7.5-rspec-support-3.9.4 /nix/store/pvl7nl36r298n5rb8sinli395ycy1l6l-bundler-2.2.24' \

Note the /home/slyfox/dev/git/nixpkgs-staging_/... path part.

Expected behavior

There should be no output when checking for rebuilds of HEAD against HEAD itself.

Notify maintainers

None?

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

$ :nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.11, NixOS, 22.05 (Quokka)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.6.0pre20211217_6e6e998`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
trofi commented 2 years ago

The problem disappears after 7148ebef251c01b04675bdb2fe41edd8ec0ab9e5 docbookrx: drop. Not sure if it was a package problem or of some shared nix code.