NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.49k stars 1.44k forks source link

Derivation names now pickier about context #1166

Open Ericson2314 opened 7 years ago

Ericson2314 commented 7 years ago

I've noticed that nixUnstable doesn't work with https://github.com/solson/rust-nightly-nix/ but nix stable does. Not sure if this is a regression, or an intentional tightening of policy around non-determinism. This issue is a minimization of https://github.com/solson/rust-nightly-nix/issues/14

With default.nix being:

builtins.derivation {
  name = builtins.readFile
    (builtins.fetchurl "https://static.rust-lang.org/dist/channel-rust-nightly-date.txt");
  builder = "bash";
  system = "x86_64";
}
$ nix-instantiate
error: the string ‘’ is not allowed to refer to a store path (such as ‘/nix/store/wgkxb2vsxj80z37gy6dpcw2j8pfysr9r-channel-rust-nightly-date.txt’)
vcunat commented 7 years ago

Isn't this about name-version parsing? If you put just numbers into the name, then the pname is probably empty under our definition.

Ericson2314 commented 7 years ago

Ah, I was wondering about the empty string. I think thats independent from the the error, however.

timokau commented 5 years ago

This is/was probably because the package name was derived by something like lib.splitString "/" drv, which will add drv to the string context of the output string. As a result, nix gives the error (since it thinks the string refers to a store path). I haven't found a way to force nix to remove that context.

(Also, this is probably way outdated and can be closed)

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info