mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Don't use read-only mode for nix build --dry-run
In dry run mode, new derivations can't be create, so running the command on anything that has not been evaluated before results in an error message of the form `don't know how to build these paths (may be caused by read-only store access)`. For comparison, the classical `nix-build --dry-run` doesn't use read-only mode. Closes #1795
This commit is contained in:
parent
199081ad00
commit
54525682df
2 changed files with 2 additions and 2 deletions
|
@ -716,7 +716,7 @@ Buildables build(ref<Store> store, Realise mode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == Realise::Nothing)
|
if (mode == Realise::Nothing || mode == Realise::Derivation)
|
||||||
printMissing(store, pathsToBuild, lvlError);
|
printMissing(store, pathsToBuild, lvlError);
|
||||||
else if (mode == Realise::Outputs)
|
else if (mode == Realise::Outputs)
|
||||||
store->buildPaths(pathsToBuild, bMode);
|
store->buildPaths(pathsToBuild, bMode);
|
||||||
|
|
|
@ -52,7 +52,7 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
|
||||||
|
|
||||||
void run(ref<Store> store) override
|
void run(ref<Store> store) override
|
||||||
{
|
{
|
||||||
auto buildables = build(store, dryRun ? Realise::Nothing : Realise::Outputs, installables, buildMode);
|
auto buildables = build(store, dryRun ? Realise::Derivation : Realise::Outputs, installables, buildMode);
|
||||||
|
|
||||||
if (dryRun) return;
|
if (dryRun) return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue