Skip to content

Commit

Permalink
Don't use read-only mode for nix build --dry-run
Browse files Browse the repository at this point in the history
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 NixOS#1795
  • Loading branch information
madjar committed Jul 22, 2020
1 parent 090960b commit d5df933
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nix/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixProfile

void run(ref<Store> store) override
{
auto buildables = build(store, dryRun ? Realise::Nothing : Realise::Outputs, installables);
auto buildables = build(store, dryRun ? Realise::Derivation : Realise::Outputs, installables);

if (dryRun) return;

Expand Down

0 comments on commit d5df933

Please sign in to comment.