Skip to content

Commit

Permalink
Rename a few things in new tests
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Hensing <[email protected]>
  • Loading branch information
Ericson2314 and roberth committed May 8, 2023
1 parent 8eeaf59 commit 278c94d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/libstore/misc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const ContentAddress * getDerivationCA(const BasicDerivation & drv)
if (out == drv.outputs.end())
return nullptr;
if (auto dof = std::get_if<DerivationOutput::CAFixed>(&out->second)) {

return &dof->ca;
}
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion tests/dyn-drv/recursive-mod-json.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 5 additions & 5 deletions tests/dyn-drv/text-hashed-output.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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";
Expand Down
8 changes: 4 additions & 4 deletions tests/dyn-drv/text-hashed-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 278c94d

Please sign in to comment.