From 278c94d607dae69226c782de44dcfa6381e3f90b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 5 May 2023 11:49:41 -0400 Subject: [PATCH] Rename a few things in new tests Co-authored-by: Robert Hensing --- src/libstore/misc.cc | 1 - tests/dyn-drv/recursive-mod-json.nix | 2 +- tests/dyn-drv/text-hashed-output.nix | 10 +++++----- tests/dyn-drv/text-hashed-output.sh | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 00f629a85..50336c779 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -89,7 +89,6 @@ const ContentAddress * getDerivationCA(const BasicDerivation & drv) if (out == drv.outputs.end()) return nullptr; if (auto dof = std::get_if(&out->second)) { - return &dof->ca; } return nullptr; diff --git a/tests/dyn-drv/recursive-mod-json.nix b/tests/dyn-drv/recursive-mod-json.nix index 9b32c55e9..c6a24ca4f 100644 --- a/tests/dyn-drv/recursive-mod-json.nix +++ b/tests/dyn-drv/recursive-mod-json.nix @@ -8,7 +8,7 @@ mkDerivation rec { requiredSystemFeatures = [ "recursive-nix" ]; - drv = builtins.unsafeDiscardOutputDependency (import ./text-hashed-output.nix).root.drvPath; + drv = builtins.unsafeDiscardOutputDependency (import ./text-hashed-output.nix).hello.drvPath; buildCommand = '' export NIX_CONFIG='experimental-features = nix-command ca-derivations' diff --git a/tests/dyn-drv/text-hashed-output.nix b/tests/dyn-drv/text-hashed-output.nix index 31a66dfa8..a700fd102 100644 --- a/tests/dyn-drv/text-hashed-output.nix +++ b/tests/dyn-drv/text-hashed-output.nix @@ -4,8 +4,8 @@ with import ./config.nix; # The derivation can be arbitrarily modified by passing a different `seed`, # but the output will always be the same rec { - root = mkDerivation { - name = "text-hashed-root"; + hello = mkDerivation { + name = "hello"; buildCommand = '' set -x echo "Building a CA derivation" @@ -16,11 +16,11 @@ rec { outputHashMode = "recursive"; outputHashAlgo = "sha256"; }; - dependent = mkDerivation { - name = "text-hashed-root.drv"; + producingDrv = mkDerivation { + name = "hello.drv"; buildCommand = '' echo "Copying the derivation" - cp ${builtins.unsafeDiscardOutputDependency root.drvPath} $out + cp ${builtins.unsafeDiscardOutputDependency hello.drvPath} $out ''; __contentAddressed = true; outputHashMode = "text"; diff --git a/tests/dyn-drv/text-hashed-output.sh b/tests/dyn-drv/text-hashed-output.sh index 8c70e0335..f3e5aa93b 100644 --- a/tests/dyn-drv/text-hashed-output.sh +++ b/tests/dyn-drv/text-hashed-output.sh @@ -12,13 +12,13 @@ source common.sh # - build the dependent derivation # - check that the path of the output coincides with that of the original derivation -drv=$(nix-instantiate ./text-hashed-output.nix -A root) +drv=$(nix-instantiate ./text-hashed-output.nix -A hello) nix show-derivation "$drv" -drvDep=$(nix-instantiate ./text-hashed-output.nix -A dependent) -nix show-derivation "$drvDep" +drvProducingDrv=$(nix-instantiate ./text-hashed-output.nix -A producingDrv) +nix show-derivation "$drvProducingDrv" -out1=$(nix-build ./text-hashed-output.nix -A dependent --no-out-link) +out1=$(nix-build ./text-hashed-output.nix -A producingDrv --no-out-link) nix path-info $drv --derivation --json | jq nix path-info $out1 --derivation --json | jq