mirror of
https://github.com/NixOS/nix
synced 2025-07-07 22:33:57 +02:00
Merge pull request #10612 from edolstra/no-flake-substitution
Input::fetchToStore(): Don't try to substitute
This commit is contained in:
commit
176334d8be
6 changed files with 20 additions and 23 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
source ./common.sh
|
||||
|
||||
# FIXME: this test is disabled because relative path flakes are broken. Re-enable this in #10089.
|
||||
exit 0
|
||||
|
||||
requireGit
|
||||
|
||||
flakeFollowsA=$TEST_ROOT/follows/flakeA
|
||||
|
|
|
@ -35,9 +35,6 @@ test_tarball() {
|
|||
nix-build -o "$TEST_ROOT"/result -E "import (fetchTree file://$tarball)"
|
||||
nix-build -o "$TEST_ROOT"/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; })"
|
||||
nix-build -o "$TEST_ROOT"/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"$hash\"; })"
|
||||
# Do not re-fetch paths already present
|
||||
nix-build -o "$TEST_ROOT"/result -E "import (fetchTree { type = \"tarball\"; url = file:///does-not-exist/must-remain-unused/$tarball; narHash = \"$hash\"; })"
|
||||
expectStderr 102 nix-build -o "$TEST_ROOT"/result -E "import (fetchTree { type = \"tarball\"; url = file://$tarball; narHash = \"sha256-xdKv2pq/IiwLSnBBJXW8hNowI4MrdZfW+SYqDQs7Tzc=\"; })" | grep 'NAR hash mismatch in input'
|
||||
|
||||
[[ $(nix eval --impure --expr "(fetchTree file://$tarball).lastModified") = 1000000000 ]]
|
||||
|
||||
|
|
|
@ -181,8 +181,14 @@ in
|
|||
print(out)
|
||||
info = json.loads(out)
|
||||
assert info["revision"] == "${private-flake-rev}", f"revision mismatch: {info['revision']} != ${private-flake-rev}"
|
||||
assert info["fingerprint"]
|
||||
cat_log()
|
||||
|
||||
# Fetching with the resolved URL should produce the same result.
|
||||
info2 = json.loads(client.succeed(f"nix flake metadata {info['url']} --json --access-tokens github.com=ghp_000000000000000000000000000000000000 --tarball-ttl 0"))
|
||||
print(info["fingerprint"], info2["fingerprint"])
|
||||
assert info["fingerprint"] == info2["fingerprint"], "fingerprint mismatch"
|
||||
|
||||
client.succeed("nix registry pin nixpkgs")
|
||||
client.succeed("nix flake metadata nixpkgs --tarball-ttl 0 >&2")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue