mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
Don’t require NIX_PATH
entries to be valid paths
It’s totally valid to have entries in `NIX_PATH` that aren’t valid paths (they can even be arbitrary urls or `channel:<channel-name>`). Fix #5998 and #5980
This commit is contained in:
parent
1fe3bfdeaf
commit
fcdc60ed22
3 changed files with 26 additions and 6 deletions
|
@ -63,6 +63,7 @@ nix_tests = \
|
|||
eval-store.sh \
|
||||
readfile-context.sh \
|
||||
store-ping.sh \
|
||||
nix_path.sh \
|
||||
why-depends.sh
|
||||
# parallel.sh
|
||||
|
||||
|
|
11
tests/nix_path.sh
Normal file
11
tests/nix_path.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Regression for https://github.com/NixOS/nix/issues/5998 and https://github.com/NixOS/nix/issues/5980
|
||||
|
||||
source common.sh
|
||||
|
||||
export NIX_PATH=non-existent=/non-existent/but-unused-anyways:by-absolute-path=$PWD:by-relative-path=.
|
||||
|
||||
nix-instantiate --eval -E '<by-absolute-path/simple.nix>' --restrict-eval
|
||||
nix-instantiate --eval -E '<by-relative-path/simple.nix>' --restrict-eval
|
||||
|
||||
# Should ideally also test this, but there’s no pure way to do it, so just trust me that it works
|
||||
# nix-instantiate --eval -E '<nixpkgs>' -I nixpkgs=channel:nixos-unstable --restrict-eval
|
Loading…
Add table
Add a link
Reference in a new issue