1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-16 05:51:05 +01:00

Relegate toRealPath to LocalFSStore

Fix #14480

This method is not well-defined for arbitrary stores, which do not have
a notion of a "real path" -- it is only well-defined for local file
systems stores, which do have exactly that notion, and so it is moved to
that sub-interface instead.

Some call-sites had to be fixed up for this, but in all cases the
changes are positive. Using `getFSSourceAccessor` allows for more other
stores to work properly. `nix-channel` was straight-up wrong in the case
of redirected local stores. And the building logic with remote building
and a non-local store is also fixed, properly gating some deletions on
store type.

Co-authored-by: Robert Hensing <robert@roberthensing.nl>
This commit is contained in:
John Ericson 2025-11-05 10:03:49 -05:00
parent 948c89b367
commit 099af7578f
12 changed files with 63 additions and 55 deletions

View file

@ -246,7 +246,7 @@ void LocalOverlayStore::optimiseStore()
if (lowerStore->isValidPath(path)) {
uint64_t bytesFreed = 0;
// Deduplicate store path
deleteStorePath(Store::toRealPath(path), bytesFreed);
deleteStorePath(toRealPath(path), bytesFreed);
}
done++;
act.progress(done, paths.size());