diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-19 17:52:01 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-19 17:53:34 +0000 |
commit | 68294746aeb1d23d2859e5ccc1a0c971cd7d5120 (patch) | |
tree | c63ca1c6b5d879a60b985bfa04f03b065d407594 /src/libexpr/primops.cc | |
parent | c98081d2702b535e6fe802e8dafbe65c329f9a3f (diff) | |
parent | 424bb5819f736af7413c343d462663474222eaac (diff) |
Merge remote-tracking branch 'upstream/master' into no-hash-type-unknown
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index ea19a1cf0..f5fbd3fa6 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -775,10 +775,11 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * * auto outPath = state.store->makeFixedOutputPath(ingestionMethod, h, drvName); if (!jsonObject) drv.env["out"] = state.store->printStorePath(outPath); drv.outputs.insert_or_assign("out", DerivationOutput { - std::move(outPath), - (ingestionMethod == FileIngestionMethod::Recursive ? "r:" : "") - + printHashType(*h.type), - h.to_string(Base16, false), + .path = std::move(outPath), + .hash = DerivationOutputHash { + .method = ingestionMethod, + .hash = std::move(h), + }, }); } @@ -792,7 +793,10 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * * for (auto & i : outputs) { if (!jsonObject) drv.env[i] = ""; drv.outputs.insert_or_assign(i, - DerivationOutput { StorePath::dummy, "", "" }); + DerivationOutput { + .path = StorePath::dummy, + .hash = std::optional<DerivationOutputHash> {}, + }); } Hash h = hashDerivationModulo(*state.store, Derivation(drv), true); @@ -801,7 +805,10 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * * auto outPath = state.store->makeOutputPath(i, h, drvName); if (!jsonObject) drv.env[i] = state.store->printStorePath(outPath); drv.outputs.insert_or_assign(i, - DerivationOutput { std::move(outPath), "", "" }); + DerivationOutput { + .path = std::move(outPath), + .hash = std::optional<DerivationOutputHash>(), + }); } } |