1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 22:20:59 +01:00

Store a ref to InputAccessor in SourcePath

This commit is contained in:
Eelco Dolstra 2022-07-06 17:25:15 +02:00
parent 72dffd6c6c
commit a18b3c665a
14 changed files with 44 additions and 31 deletions

View file

@ -768,7 +768,7 @@ SourcePath EvalState::findFile(SearchPath & searchPath, const std::string_view p
}
if (hasPrefix(path, "nix/"))
return {*corepkgsFS, CanonPath(path.substr(3))};
return {corepkgsFS, CanonPath(path.substr(3))};
debugThrowLastTrace(ThrownError({
.msg = hintfmt(evalSettings.pureEval
@ -791,7 +791,8 @@ SourcePath EvalState::findFile(SearchPath & searchPath, const std::string_view p
try {
auto storePath = fetchers::downloadTarball(
store, resolveUri(elem.second), "source", false).first.storePath;
auto & accessor = registerAccessor(makeFSInputAccessor(CanonPath(store->toRealPath(storePath))));
auto accessor = makeFSInputAccessor(CanonPath(store->toRealPath(storePath)));
registerAccessor(accessor);
res.emplace(SourcePath {accessor, CanonPath::root});
} catch (FileTransferError & e) {
logWarning({