Rename a few things in new tests

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
John Ericson 2023-05-05 11:49:41 -04:00 committed by John Ericson
parent 8eeaf591db
commit 278c94d607
4 changed files with 10 additions and 11 deletions

View file

@ -89,7 +89,6 @@ const ContentAddress * getDerivationCA(const BasicDerivation & drv)
if (out == drv.outputs.end()) if (out == drv.outputs.end())
return nullptr; return nullptr;
if (auto dof = std::get_if<DerivationOutput::CAFixed>(&out->second)) { if (auto dof = std::get_if<DerivationOutput::CAFixed>(&out->second)) {
return &dof->ca; return &dof->ca;
} }
return nullptr; return nullptr;

View file

@ -8,7 +8,7 @@ mkDerivation rec {
requiredSystemFeatures = [ "recursive-nix" ]; requiredSystemFeatures = [ "recursive-nix" ];
drv = builtins.unsafeDiscardOutputDependency (import ./text-hashed-output.nix).root.drvPath; drv = builtins.unsafeDiscardOutputDependency (import ./text-hashed-output.nix).hello.drvPath;
buildCommand = '' buildCommand = ''
export NIX_CONFIG='experimental-features = nix-command ca-derivations' export NIX_CONFIG='experimental-features = nix-command ca-derivations'

View file

@ -4,8 +4,8 @@ with import ./config.nix;
# The derivation can be arbitrarily modified by passing a different `seed`, # The derivation can be arbitrarily modified by passing a different `seed`,
# but the output will always be the same # but the output will always be the same
rec { rec {
root = mkDerivation { hello = mkDerivation {
name = "text-hashed-root"; name = "hello";
buildCommand = '' buildCommand = ''
set -x set -x
echo "Building a CA derivation" echo "Building a CA derivation"
@ -16,11 +16,11 @@ rec {
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHashAlgo = "sha256"; outputHashAlgo = "sha256";
}; };
dependent = mkDerivation { producingDrv = mkDerivation {
name = "text-hashed-root.drv"; name = "hello.drv";
buildCommand = '' buildCommand = ''
echo "Copying the derivation" echo "Copying the derivation"
cp ${builtins.unsafeDiscardOutputDependency root.drvPath} $out cp ${builtins.unsafeDiscardOutputDependency hello.drvPath} $out
''; '';
__contentAddressed = true; __contentAddressed = true;
outputHashMode = "text"; outputHashMode = "text";

View file

@ -12,13 +12,13 @@ source common.sh
# - build the dependent derivation # - build the dependent derivation
# - check that the path of the output coincides with that of the original 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" nix show-derivation "$drv"
drvDep=$(nix-instantiate ./text-hashed-output.nix -A dependent) drvProducingDrv=$(nix-instantiate ./text-hashed-output.nix -A producingDrv)
nix show-derivation "$drvDep" 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 $drv --derivation --json | jq
nix path-info $out1 --derivation --json | jq nix path-info $out1 --derivation --json | jq