1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Trivial changes from lazy-trees

This commit is contained in:
Eelco Dolstra 2024-11-19 17:30:38 +01:00
parent 3b76d01f3b
commit f1b4f14055
3 changed files with 9 additions and 6 deletions

View file

@ -1603,7 +1603,8 @@ static RegisterPrimOp primop_placeholder({
*************************************************************/ *************************************************************/
/* Convert the argument to a path. !!! obsolete? */ /* Convert the argument to a path and then to a string (confusing,
eh?). !!! obsolete? */
static void prim_toPath(EvalState & state, const PosIdx pos, Value * * args, Value & v) static void prim_toPath(EvalState & state, const PosIdx pos, Value * * args, Value & v)
{ {
NixStringContext context; NixStringContext context;
@ -2614,13 +2615,13 @@ static void prim_path(EvalState & state, const PosIdx pos, Value * * args, Value
expectedHash = newHashAllowEmpty(state.forceStringNoCtx(*attr.value, attr.pos, "while evaluating the `sha256` attribute passed to builtins.path"), HashAlgorithm::SHA256); expectedHash = newHashAllowEmpty(state.forceStringNoCtx(*attr.value, attr.pos, "while evaluating the `sha256` attribute passed to builtins.path"), HashAlgorithm::SHA256);
else else
state.error<EvalError>( state.error<EvalError>(
"unsupported argument '%1%' to 'addPath'", "unsupported argument '%1%' to 'builtins.path'",
state.symbols[attr.name] state.symbols[attr.name]
).atPos(attr.pos).debugThrow(); ).atPos(attr.pos).debugThrow();
} }
if (!path) if (!path)
state.error<EvalError>( state.error<EvalError>(
"missing required 'path' attribute in the first argument to builtins.path" "missing required 'path' attribute in the first argument to 'builtins.path'"
).atPos(pos).debugThrow(); ).atPos(pos).debugThrow();
if (name.empty()) if (name.empty())
name = path->baseName(); name = path->baseName();

View file

@ -44,6 +44,8 @@ StorePath fetchToStore(
: store.addToStore( : store.addToStore(
name, path, method, HashAlgorithm::SHA256, {}, filter2, repair); name, path, method, HashAlgorithm::SHA256, {}, filter2, repair);
debug(mode == FetchMode::DryRun ? "hashed '%s'" : "copied '%s' to '%s'", path, store.printStorePath(storePath));
if (cacheKey && mode == FetchMode::Copy) if (cacheKey && mode == FetchMode::Copy)
fetchers::getCache()->upsert(*cacheKey, store, {}, storePath); fetchers::getCache()->upsert(*cacheKey, store, {}, storePath);

View file

@ -52,15 +52,15 @@ sources = files(
'fetch-to-store.cc', 'fetch-to-store.cc',
'fetchers.cc', 'fetchers.cc',
'filtering-source-accessor.cc', 'filtering-source-accessor.cc',
'git.cc',
'git-utils.cc', 'git-utils.cc',
'git.cc',
'github.cc', 'github.cc',
'indirect.cc', 'indirect.cc',
'mercurial.cc', 'mercurial.cc',
'mounted-source-accessor.cc', 'mounted-source-accessor.cc',
'path.cc', 'path.cc',
'store-path-accessor.cc',
'registry.cc', 'registry.cc',
'store-path-accessor.cc',
'tarball.cc', 'tarball.cc',
) )
@ -71,10 +71,10 @@ headers = files(
'cache.hh', 'cache.hh',
'fetch-settings.hh', 'fetch-settings.hh',
'fetch-to-store.hh', 'fetch-to-store.hh',
'fetchers.hh',
'filtering-source-accessor.hh', 'filtering-source-accessor.hh',
'git-utils.hh', 'git-utils.hh',
'mounted-source-accessor.hh', 'mounted-source-accessor.hh',
'fetchers.hh',
'registry.hh', 'registry.hh',
'store-path-accessor.hh', 'store-path-accessor.hh',
'tarball.hh', 'tarball.hh',