Skip to content

treewide: Remove getUri and replace with getHumanReadableURI where appropriate#13755

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
xokdvium:concise-uri-logs
Aug 14, 2025
Merged

treewide: Remove getUri and replace with getHumanReadableURI where appropriate#13755
Ericson2314 merged 2 commits intoNixOS:masterfrom
xokdvium:concise-uri-logs

Conversation

@xokdvium
Copy link
Contributor

Motivation

The problem with old code was that it used getUri for both the diskCache
as well as logging. This is really bad because it mixes the textual human
readable representation with the caching.

Also using getUri for the cache key is really problematic for the S3 store,
since it doesn't include the endpoint in the cache key, so it's totally broken.

This starts separating the logging / cache concerns by introducing a
getHumanReadableURI that should only be used for logging. The caching
logic now instead uses getReference().render(/*withParams=*/false) exclusively.
This would need to be fixed in follow-ups, because that's really fragile and
broken for some store types (but it was already broken before).

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

…propriate

The problem with old code was that it used getUri for both the `diskCache`
as well as logging. This is really bad because it mixes the textual human
readable representation with the caching.

Also using getUri for the cache key is really problematic for the S3 store,
since it doesn't include the `endpoint` in the cache key, so it's totally broken.

This starts separating the logging / cache concerns by introducing a
`getHumanReadableURI` that should only be used for logging. The caching
logic now instead uses `getReference().render(/*withParams=*/false)` exclusively.
This would need to be fixed in follow-ups, because that's really fragile and
broken for some store types (but it was already broken before).
@github-actions github-actions bot added new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store repl The Read Eval Print Loop, "nix repl" command and debugger c api Nix as a C library with a stable interface labels Aug 14, 2025
@xokdvium xokdvium requested a review from Mic92 August 14, 2025 18:57
@xokdvium
Copy link
Contributor Author

@Mic92, this addresses your concerns from #13734 (comment).

@Ericson2314 Ericson2314 merged commit 4b4895e into NixOS:master Aug 14, 2025
14 checks passed
@xokdvium xokdvium deleted the concise-uri-logs branch August 14, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c api Nix as a C library with a stable interface new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants