falsify the glibc store paths

Commits 205c59367c and
325e7e1824 introduced real glibc store paths from
current nixpkgs unstable into the source. Since nixpkgs `fetchFromGitea` (and
similar fixed-output derivations) depends on a C library, on x86_64-linux they
will fail with the forbidden reference error:

error: the fixed-output derivation '/nix/store/wnmnj3jzc82y89sfmyicr04kilg8zs2k-source.drv' must not reference store paths but 1 such references were found:
         /nix/store/q4wq65gl3r8fy746v9bbwgx4gzn0r2kl-glibc-2.40-66

Falsify the store path to prevent this failure.

Change-Id: I949033567bcad070f9a0a19cefdb33a79222e421
This commit is contained in:
Alois Wohlschlager
2025-07-13 10:56:47 +02:00
parent ae00b12983
commit 2090853b80
2 changed files with 7 additions and 7 deletions
@@ -12,8 +12,8 @@ Example:
```
$ nix-build -A hello
error: output '/nix/store/0b7k85gg5r28gb54px9nq7iv5986mns9-hello-2.12.2' is not allowed to refer to the following paths:
/nix/store/q4wq65gl3r8fy746v9bbwgx4gzn0r2kl-glibc-2.40-66
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.40-66
Shown below are chains that lead to the forbidden path(s).
/nix/store/0b7k85gg5r28gb54px9nq7iv5986mns9-hello-2.12.2
└───/nix/store/q4wq65gl3r8fy746v9bbwgx4gzn0r2kl-glibc-2.40-66
└───/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.40-66
```
+5 -5
View File
@@ -12,7 +12,7 @@ TEST(PathTree, simple)
auto store = aio.blockOn(openStore("dummy://"));
auto parent = StorePath{"hr8lmmjmd1jk6s3p5ymggyk4am7n2lmb-openssh-10.0p2"};
auto child = StorePath{"q4wq65gl3r8fy746v9bbwgx4gzn0r2kl-glibc-2.40-66"};
auto child = StorePath{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-glibc-2.40-66"};
std::map<StorePath, StorePathSet> graph;
graph.insert({child, {}});
@@ -25,7 +25,7 @@ TEST(PathTree, simple)
ASSERT_EQ(
graph_data,
"/nix/store/hr8lmmjmd1jk6s3p5ymggyk4am7n2lmb-openssh-10.0p2\n"
"\x1B[1m└───/nix/store/q4wq65gl3r8fy746v9bbwgx4gzn0r2kl-glibc-2.40-66\x1B[0m"
"\x1B[1m└───/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-glibc-2.40-66\x1B[0m"
);
// clang-format on
}
@@ -37,7 +37,7 @@ TEST(PathTree, all)
auto store = aio.blockOn(openStore("dummy://"));
auto parent = StorePath{"hr8lmmjmd1jk6s3p5ymggyk4am7n2lmb-openssh-10.0p2"};
auto child = StorePath{"q4wq65gl3r8fy746v9bbwgx4gzn0r2kl-glibc-2.40-66"};
auto child = StorePath{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-glibc-2.40-66"};
auto intermediate = StorePath{"6r4zqb04fq5l5l4zghq76wvcpz7dwd35-linux-pam-1.6.1"};
std::map<StorePath, StorePathSet> graph;
@@ -48,9 +48,9 @@ TEST(PathTree, all)
// clang-format off
const std::string expected =
"/nix/store/hr8lmmjmd1jk6s3p5ymggyk4am7n2lmb-openssh-10.0p2\n"
"\x1B[1m├───/nix/store/q4wq65gl3r8fy746v9bbwgx4gzn0r2kl-glibc-2.40-66\x1B[0m\n"
"\x1B[1m├───/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-glibc-2.40-66\x1B[0m\n"
"└───/nix/store/6r4zqb04fq5l5l4zghq76wvcpz7dwd35-linux-pam-1.6.1\x1B[0m\n"
" \x1B[1m└───/nix/store/q4wq65gl3r8fy746v9bbwgx4gzn0r2kl-glibc-2.40-66\x1B[0m";
" \x1B[1m└───/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-glibc-2.40-66\x1B[0m";
// clang-format on
auto graph_data =