diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-23 15:00:25 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-23 15:01:11 +0000 |
commit | 35e6288be1a2384a29caccd64d88a6b623e6c033 (patch) | |
tree | df5cb1473e7b6b228331030273a80555ffd3a1e6 /src | |
parent | 4d77513d97775c05b19b0676a76fcdd3d00bea8b (diff) |
`writeDerivation` just needs a plain store reference
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/primops.cc | 2 | ||||
-rw-r--r-- | src/libstore/derivations.cc | 8 | ||||
-rw-r--r-- | src/libstore/derivations.hh | 2 | ||||
-rw-r--r-- | src/nix/develop.cc | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 30f4c3529..dcc34407b 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -839,7 +839,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * * } /* Write the resulting term into the Nix store directory. */ - auto drvPath = writeDerivation(state.store, drv, state.repair); + auto drvPath = writeDerivation(*state.store, drv, state.repair); auto drvPathS = state.store->printStorePath(drvPath); printMsg(lvlChatty, "instantiated '%1%' -> '%2%'", drvName, drvPathS); diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index a9fed2564..43bc61e55 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -61,7 +61,7 @@ bool BasicDerivation::isBuiltin() const } -StorePath writeDerivation(ref<Store> store, +StorePath writeDerivation(Store & store, const Derivation & drv, RepairFlag repair) { auto references = drv.inputSrcs; @@ -71,10 +71,10 @@ StorePath writeDerivation(ref<Store> store, (that can be missing (of course) and should not necessarily be held during a garbage collection). */ auto suffix = std::string(drv.name) + drvExtension; - auto contents = drv.unparse(*store, false); + auto contents = drv.unparse(store, false); return settings.readOnlyMode - ? store->computeStorePathForText(suffix, contents, references) - : store->addTextToStore(suffix, contents, references, repair); + ? store.computeStorePathForText(suffix, contents, references) + : store.addTextToStore(suffix, contents, references, repair); } diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh index 3aae30ab2..9656a32f2 100644 --- a/src/libstore/derivations.hh +++ b/src/libstore/derivations.hh @@ -146,7 +146,7 @@ class Store; enum RepairFlag : bool { NoRepair = false, Repair = true }; /* Write a derivation to the Nix store, and return its path. */ -StorePath writeDerivation(ref<Store> store, +StorePath writeDerivation(Store & store, const Derivation & drv, RepairFlag repair = NoRepair); /* Read a derivation from a file. */ diff --git a/src/nix/develop.cc b/src/nix/develop.cc index 9aaa80822..8a14e45c9 100644 --- a/src/nix/develop.cc +++ b/src/nix/develop.cc @@ -138,7 +138,7 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath) .path = shellOutPath } }); drv.env["out"] = store->printStorePath(shellOutPath); - auto shellDrvPath2 = writeDerivation(store, drv); + auto shellDrvPath2 = writeDerivation(*store, drv); /* Build the derivation. */ store->buildPaths({{shellDrvPath2}}); |