aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
diff options
context:
space:
mode:
authorGeorges Dubus <georges.dubus@gmail.com>2020-07-03 14:21:31 +0200
committerEelco Dolstra <edolstra@gmail.com>2021-09-02 14:50:19 +0200
commitbc6e7ca046952bd773558a3c4984e4f1c2717234 (patch)
tree408ee9e5259caffcf1790db922f50e59c7269a65 /src/libcmd
parentb2e8120d25de5303bfb6a99c14d3ecad21f55a05 (diff)
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 (cherry picked from commit 54525682df707742e58311c32e9c9cb18de1e31f)
Diffstat (limited to 'src/libcmd')
-rw-r--r--src/libcmd/installables.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index 0091a938a..86080f53a 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -756,7 +756,7 @@ BuiltPaths build(ref<Store> evalStore, ref<Store> store, Realise mode,
pathsToBuild.insert(pathsToBuild.end(), b.begin(), b.end());
}
- if (mode == Realise::Nothing)
+ if (mode == Realise::Nothing || mode == Realise::Derivation)
printMissing(store, pathsToBuild, lvlError);
else if (mode == Realise::Outputs)
store->buildPaths(pathsToBuild, bMode, evalStore);