Skip to content

Commit

Permalink
filterPath: Ensure /nix/store/<hash>-<hash>-source
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Apr 30, 2024
1 parent c5ae41d commit ea54be0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/libexpr/primops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2376,7 +2376,18 @@ static void prim_filterSource(EvalState & state, const PosIdx pos, Value * * arg
"while evaluating the second argument (the path to filter) passed to 'builtins.filterSource'");
state.forceFunction(*args[0], pos, "while evaluating the first argument passed to builtins.filterSource");

addPath(state, pos, path.baseName(), path, args[0], FileIngestionMethod::Recursive, std::nullopt, v, context);
addPath(
state,
pos,
path.path.isRoot()
? state.store->computeStorePath("source", *path.accessor, path.path).first.to_string()
: path.baseName(),
path,
args[0],
FileIngestionMethod::Recursive,
std::nullopt,
v,
context);
}

static RegisterPrimOp primop_filterSource({
Expand Down

0 comments on commit ea54be0

Please sign in to comment.