From 2090853b8026ebac17eae181e36bd68ca1f424f2 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sat, 12 Jul 2025 09:56:07 +0200 Subject: [PATCH] falsify the glibc store paths Commits 205c59367c27994d903b39cd7853d203bd25eb5a and 325e7e1824e3e6eec36c619da625d81dd607bb2b 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 --- doc/manual/rl-next/report-forbidden-path-as-chain.md | 4 ++-- tests/unit/libstore/path-tree.cc | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/manual/rl-next/report-forbidden-path-as-chain.md b/doc/manual/rl-next/report-forbidden-path-as-chain.md index dca9ecb6c..8b4cc471e 100644 --- a/doc/manual/rl-next/report-forbidden-path-as-chain.md +++ b/doc/manual/rl-next/report-forbidden-path-as-chain.md @@ -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 ``` diff --git a/tests/unit/libstore/path-tree.cc b/tests/unit/libstore/path-tree.cc index 70b419f48..e32ef02e0 100644 --- a/tests/unit/libstore/path-tree.cc +++ b/tests/unit/libstore/path-tree.cc @@ -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 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 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 =