1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 14:31:46 +02:00

fetchers::downloadTarball(): Return a cacheable accessor

downloadTarball() is used by `-I foo=<url>` etc. fetchToStore() needs
the accessor to have a fingerprint to enable caching.

Fixes #11271.

(cherry picked from commit 9f6ee93f48)
This commit is contained in:
Eelco Dolstra 2024-08-12 15:47:02 +02:00 committed by Mergify
parent b53b07b30b
commit 437f7a0042
5 changed files with 35 additions and 8 deletions

View file

@ -3083,7 +3083,9 @@ std::optional<std::string> EvalState::resolveLookupPathPath(const LookupPath::Pa
if (EvalSettings::isPseudoUrl(value)) {
try {
auto accessor = fetchers::downloadTarball(
EvalSettings::resolvePseudoUrl(value)).accessor;
store,
fetchSettings,
EvalSettings::resolvePseudoUrl(value));
auto storePath = fetchToStore(*store, SourcePath(accessor), FetchMode::Copy);
return finish(store->toRealPath(storePath));
} catch (Error & e) {