1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

libstore: Fix makeCopyPathMessage

Old code completely ignored query parameters and it seems ok to keep
that behavior. There's a lot of code out there that parses nix code
like nix-output-monitor and it can't parse messages like:

> copying path '/nix/store/wha2hi4yhkjmccqhivxavbfspsg1wrsj-source' from 'https://cache.nixos.org' to 'local://'...

Let's not break these tools without a good reason. This goes in line
with what other code does by ignoring parameters in logs.

The issue is just in detecting the shorthand notations for the store
reference - not in printing the url in logs.

By default the daemon opens a local store with ?path-info-cache-size=0,
so that leads to the erronenous 'local://'.
This commit is contained in:
Sergei Zimmerman 2025-08-15 00:55:03 +03:00
parent 4b4895e750
commit e74ef417db
No known key found for this signature in database

View file

@ -803,7 +803,7 @@ makeCopyPathMessage(const StoreConfig & srcCfg, const StoreConfig & dstCfg, std:
/* At this point StoreReference **must** be resolved. */ /* At this point StoreReference **must** be resolved. */
const auto & specified = std::get<StoreReference::Specified>(ref.variant); const auto & specified = std::get<StoreReference::Specified>(ref.variant);
const auto & scheme = specified.scheme; const auto & scheme = specified.scheme;
return (scheme == "local" || scheme == "unix") && specified.authority.empty() && ref.params.empty(); return (scheme == "local" || scheme == "unix") && specified.authority.empty();
}; };
if (isShorthand(src)) if (isShorthand(src))