aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-06-05 11:11:53 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-06-30 18:22:47 +0200
commit8dca95386c9ab8b13886716ec31e1b2936a3ef10 (patch)
tree0e6676b0d58887bcf4cd182055945294f2ec570a
parent508aa58e671583bf06fa3597629839827c8d1bd7 (diff)
fetchClosure: Disallow toPath for inputAddressed = true
-rw-r--r--src/libexpr/primops/fetchClosure.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libexpr/primops/fetchClosure.cc b/src/libexpr/primops/fetchClosure.cc
index c66fed633..6d2271853 100644
--- a/src/libexpr/primops/fetchClosure.cc
+++ b/src/libexpr/primops/fetchClosure.cc
@@ -58,12 +58,11 @@ static void prim_fetchClosure(EvalState & state, const PosIdx pos, Value * * arg
bool inputAddressed = inputAddressedMaybe.value_or(false);
if (inputAddressed) {
- if (toPath && toPath != fromPath)
+ if (toPath)
throw Error({
- .msg = hintfmt("attribute '%s' is set to true, but 'toPath' does not match 'fromPath'. 'toPath' should be equal, or should be omitted. Instead 'toPath' was '%s' and 'fromPath' was '%s'",
+ .msg = hintfmt("attribute '%s' is set to true, but '%s' is also set. Please remove one of them",
"inputAddressed",
- state.store->printStorePath(*toPath),
- state.store->printStorePath(*fromPath)),
+ "toPath"),
.errPos = state.positions[pos]
});
assert(!enableRewriting);