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

all-packages.nix: remove res. (next stage super) #55061

Merged
merged 1 commit into from
Feb 2, 2019

Conversation

danbst
Copy link
Contributor

@danbst danbst commented Feb 1, 2019

A bit more consistent version of #51527

@infinisil
Copy link
Member

Huh, shouldn't this be a no-op? ofborg lists a bunch of derivations that seem to have changed

@danbst
Copy link
Contributor Author

danbst commented Feb 2, 2019

Same "huh" here, but it turned out pcre16 is different from res.pcre16 (and qt depends on pcre16)

$ nix-diff  '/nix/store/c2xiw43k59a1h8jnpmiz9q6304ahfs54-pcre16-8.42.drv' '/nix/store/5q4j7rairip8qj9p19sdjza2rbwy4bzf-pcre16-8.42.drv'
- /nix/store/c2xiw43k59a1h8jnpmiz9q6304ahfs54-pcre16-8.42.drv:{out}
+ /nix/store/5q4j7rairip8qj9p19sdjza2rbwy4bzf-pcre16-8.42.drv:{out}
• The builders do not match
    - /nix/store/n9acaakxahkv1q3av11l93p7rgd4xqsf-bootstrap-tools/bin/bash
    + /nix/store/vs6d2fjkl4kb3jb7rwibsd76k9v2n4xy-bash-4.4-p23/bin/bash
• The set of input names do not match:
    - bootstrap-stage4-stdenv-linux
    - bootstrap-tools
    + bash-4.4-p23
    + stdenv-linux
• The input named `pcre-8.42.tar.bz2` differs
  - /nix/store/npj2j3yvh75f6ghiix6sdy49yia4bqf6-pcre-8.42.tar.bz2.drv:{out}
  + /nix/store/v37dhldm7mf5sgrmbvnjp2lc047sbkzn-pcre-8.42.tar.bz2.drv:{out}
  • The platforms do not match
      - builtin
      + x86_64-linux
  • The builders do not match
      - builtin:fetchurl
      + /nix/store/vs6d2fjkl4kb3jb7rwibsd76k9v2n4xy-bash-4.4-p23/bin/bash
  • The arguments do not match
      + -e
      + /nix/store/qjk2h301faawvbnhv5azhyiaw6vrqalg-builder.sh
  • The set of input names do not match:
      + bash-4.4-p23
      + curl-7.63.0
      + mirrors-list
      + stdenv-linux
  • The set of input sources do not match:
      + /nix/store/qjk2h301faawvbnhv5azhyiaw6vrqalg-builder.sh

so, res.pcre was a bootstrap package, but self.pcre is not. I think it is fine to merge this.

@Ericson2314
Copy link
Member

It's the other way around, res.pcre is not the bootstrap package. This is probably because stdenv overrides are applied after all-packages.nix, so res.pcre bypasses it. This change then has the side affect of avoiding a pointless rebuild of pcre.

@Ericson2314 Ericson2314 merged commit c6bb6dd into NixOS:master Feb 2, 2019
@Ericson2314
Copy link
Member

@roberth I'd like to apologize to you for not so analyzing your PR like I said I would. I have had less time for Nixpkgs things lately but still I should follow up on anything I said I'd do.

@danbst danbst deleted the remove-res branch February 3, 2019 00:00
@roberth
Copy link
Member

roberth commented Feb 3, 2019

@Ericson2314 no problem. It seems that there are plenty more important things to do, even when considering just Nixpkgs.

@delroth
Copy link
Contributor

delroth commented Feb 3, 2019

This PR broke nixos/tests/transmission.nix:

error: while evaluating the attribute 'buildCommand' of the derivation 'vm-test-run-transmission' at /home/delroth/work/nixpkgs/nixos/lib/testing.nix:53:7:
while evaluating the attribute 'buildCommand' of the derivation 'nixos-test-driver-transmission' at /home/delroth/work/nixpkgs/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'buildCommand' of the derivation 'nixos-vm' at /home/delroth/work/nixpkgs/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'activationScript' of the derivation 'nixos-system-machine-19.03.git.56b7912' at /home/delroth/work/nixpkgs/nixos/modules/system/activation/top-level.nix:102:5:
while evaluating the attribute 'system.activationScripts.script' at /home/delroth/work/nixpkgs/nixos/modules/system/activation/activation-script.nix:68:9:
while evaluating 'textClosureMap' at /home/delroth/work/nixpkgs/lib/strings-with-deps.nix:70:35, called from /home/delroth/work/nixpkgs/nixos/modules/system/activation/activation-script.nix:89:18:
while evaluating 'id' at /home/delroth/work/nixpkgs/lib/trivial.nix:14:5, called from undefined position:
while evaluating the attribute 'text' at /home/delroth/work/nixpkgs/nixos/modules/system/activation/activation-script.nix:9:5:
while evaluating the attribute 'text' at /home/delroth/work/nixpkgs/lib/strings-with-deps.nix:77:38:
while evaluating the attribute 'sources' of the derivation 'etc' at /home/delroth/work/nixpkgs/nixos/modules/system/etc/etc.nix:12:5:
while evaluating anonymous function at /home/delroth/work/nixpkgs/nixos/modules/system/etc/etc.nix:20:20, called from undefined position:
while evaluating the attribute 'source' at undefined position:
while evaluating anonymous function at /home/delroth/work/nixpkgs/lib/modules.nix:75:45, called from undefined position:
while evaluating the attribute 'value' at /home/delroth/work/nixpkgs/lib/modules.nix:338:9:
while evaluating the option `environment.etc.systemd/system.source':
while evaluating the attribute 'mergedValue' at /home/delroth/work/nixpkgs/lib/modules.nix:370:5:
while evaluating anonymous function at /home/delroth/work/nixpkgs/lib/modules.nix:370:32, called from /home/delroth/work/nixpkgs/lib/modules.nix:370:19:
while evaluating 'check' at /home/delroth/work/nixpkgs/lib/types.nix:245:15, called from /home/delroth/work/nixpkgs/lib/modules.nix:371:10:
while evaluating the attribute 'buildCommand' of the derivation 'system-units' at /home/delroth/work/nixpkgs/pkgs/build-support/trivial-builders.nix:7:14:
while evaluating the attribute 'buildInputs' of the derivation 'udisks-2.8.1' at /home/delroth/work/nixpkgs/pkgs/os-specific/linux/udisks/2-default.nix:11:3:
while evaluating the attribute 'buildInputs' of the derivation 'libblockdev-2.20' at /home/delroth/work/nixpkgs/pkgs/development/libraries/libblockdev/default.nix:9:3:
while evaluating the attribute 'buildInputs' of the derivation 'volume_key-0.3.11' at /home/delroth/work/nixpkgs/pkgs/development/libraries/volume-key/default.nix:8:3:
while evaluating the attribute 'configureFlags' of the derivation 'gpgme-1.12.0' at /home/delroth/work/nixpkgs/pkgs/development/libraries/gpgme/default.nix:16:3:
while evaluating 'callPackageWith' at /home/delroth/work/nixpkgs/lib/customisation.nix:108:35, called from /home/delroth/work/nixpkgs/pkgs/top-level/all-packages.nix:2948:13:
while evaluating 'makeOverridable' at /home/delroth/work/nixpkgs/lib/customisation.nix:67:24, called from /home/delroth/work/nixpkgs/lib/customisation.nix:112:8:
while evaluating anonymous function at /home/delroth/work/nixpkgs/pkgs/tools/security/gnupg/22.nix:1:1, called from /home/delroth/work/nixpkgs/lib/customisation.nix:69:12:
while evaluating the attribute 'pinentry_ncurses' at /home/delroth/work/nixpkgs/pkgs/top-level/all-packages.nix:4808:3:
infinite recursion encountered, at /home/delroth/work/nixpkgs/pkgs/top-level/all-packages.nix:4808:22

edit: Also seems to impact a few more tests (simple.nix, memcached.nix, etc.)

@delroth
Copy link
Contributor

delroth commented Feb 3, 2019

This seems to be caused by an interaction with overlays. In nixos/modules/config/no-x-libs.nix:

    nixpkgs.overlays = singleton (const (super: {
      pinentry = super.pinentry_ncurses;
    }));

@danbst
Copy link
Contributor Author

danbst commented Feb 3, 2019

@delroth crap. However this reveal many other ways when overlay override would cause infinite recursion. For example:

$ nix-instantiate -E 'with import <nixpkgs> { overlays = [(self: super: { 
    ttfautohint = self.ttfautohint-nox;
  })]; }; ttfautohint'
error: infinite recursion encountered, at /nix/store/94cbas4j0w0132qhxa5qn7zybrss3ymm-nixpkgs-19.03pre167327.11cf7d6e1ff/nixpkgs/pkgs/top-level/all-packages.nix:5926:21
(use '--show-trace' to show detailed location information)

$ nix-instantiate -E 'with import <nixpkgs> { overlays = [(self: super: { 
    ttfautohint = super.ttfautohint-nox;
  })]; }; ttfautohint'
error: infinite recursion encountered, at /nix/store/94cbas4j0w0132qhxa5qn7zybrss3ymm-nixpkgs-19.03pre167327.11cf7d6e1ff/nixpkgs/pkgs/top-level/all-packages.nix:5926:21
(use '--show-trace' to show detailed location information)

There should be some principal approach to fix this (never use .override in all-packages.nix?)

cc @nbp

danbst added a commit to danbst/nixpkgs that referenced this pull request Feb 3, 2019
danbst added a commit that referenced this pull request Feb 3, 2019
@danbst
Copy link
Contributor Author

danbst commented Feb 3, 2019

Should have read this commit first d1a2853

@Ericson2314
Copy link
Member

Yes If I understand the issue correctly that commit has a pretty bogus workaround. A good rule for the "overrides and default assignment problem" is to make a fooReal which is overriden instead. So pinentry_ncurses could instead override pinentryReal, which is never flat-out replaced in any overlay.

@oxij
Copy link
Member

oxij commented Feb 21, 2019

Another attempt #56119 by me.

infinisil added a commit to nixpkgs-architecture/nixpkgs that referenced this pull request Jan 24, 2023
Tested with nix-env -qaf .

The res -> super changes are necessary because res points to the result
of the current overlay, but some of the packages were moved to the
previous overlay, which can be accessed with super. This is a
fundamental problem to be fixed, see NixOS#55061
and related issues

The schleuder change is necessary because the ./default.nix file
referenced ./., but there's also another package in ./bin. The tool
couldn't move the gemfiles in ./. because

The schleuder change is necessary because the tool isn't smart enough
and this is a special case of the default.nix reading gemfiles from a
./. reference and there being both schleuder in
pkgs/tools/security/schleuder and schleuder-cli in
pkgs/tools/security/schleuder/cli
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.

7 participants