Skip to content

Commit 7e50ba7

Browse files
committed
Provide downloadFile() with a writable store
1 parent 0159911 commit 7e50ba7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/libfetchers/builtin.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ static void builtinFetchTree(const BuiltinBuilderContext & ctx)
4343

4444
std::cerr << fmt("fetching '%s'...\n", input.to_string());
4545

46-
/* Make sure we don't use the real store because we're in a forked
47-
process. */
48-
auto dummyStore = openStore("dummy://");
46+
/* Functions like downloadFile() expect a store. We can't use the
47+
real one since we're in a forked process. FIXME: use recursive
48+
Nix's daemon so we can use the real store? */
49+
auto tmpStore = openStore(ctx.tmpDirInSandbox + "/nix");
4950

50-
auto [accessor, lockedInput] = input.getAccessor(dummyStore);
51+
auto [accessor, lockedInput] = input.getAccessor(tmpStore);
5152

5253
auto source = sinkToSource([&](Sink & sink) { accessor->dumpPath(CanonPath::root, sink); });
5354

0 commit comments

Comments
 (0)