Repository navigation
libstore: forward runtime substituters and trusted keys to the daemon - #11
Merged
domenkozar merged 4 commits intoSep 23, 2026
Conversation
Store::addSubstituter only appends to the client process's substituter list, which serves client-side queries. Builds and substitutions run in the daemon, whose Worker reads the daemon's own list, so a substituter added at runtime through a RemoteStore never took part in any build. Store::addTrustedPublicKeys overrode the setting but never re-sent the options, so the daemon kept the old keys too. Override both on RemoteStore: update the `substituters` / `trusted-public-keys` settings and call setOptions() so the daemon receives them. The daemon applies its usual policy, keeping the substituter for trusted users or entries in `trusted-substituters` and warning otherwise, which also gives untrusted users a visible signal. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
3 of 4 tasks
EclipseIsDead
commented
Sep 10, 2026
| bool RemoteStore::addSubstituter(const std::string & uri) | ||
| { | ||
| if (!Store::addSubstituter(uri)) | ||
| return false; |
Author
There was a problem hiding this comment.
return early on dupe for the actual noop case i was hitting
EclipseIsDead
marked this pull request as ready for review
September 21, 2026 15:53
Retire pooled connections after runtime substituter or trusted-key updates so subsequent operations use fresh daemon-side caches. Track a settings generation to also retire connections returned after an update. Forward removals and clearing to the settings used by new connections, including substituter URIs with query parameters. Add daemon-backed coverage with three pooled connections for cache addition, removal, clearing, and trusted-key revocation and restoration. Validation: build, runtime-substituters, binary-cache, remote-store, and test-libstoreconsumer passed; formatting and diff checks passed. Assisted-by: OpenAI Codex (GPT-6)
Member
|
@EclipseIsDead Could you review the follow-up fix in a0471df? It retires stale pooled daemon connections after runtime cache or trusted-key updates, forwards removals and clearing, and adds daemon-backed regression coverage with three connections. The build and the runtime-substituters, binary-cache, remote-store, and test-libstoreconsumer tests passed locally. This fix and review request were prepared with OpenAI Codex (GPT-6). |
Snapshot the forwarded substituter setting per RemoteStore so updating one store cannot change the options sent by another. Remove the reference corresponding to the local substituter that was removed, including when cache URLs differ only by query parameters. Retire pooled connections without acquiring a new handle, so updates return even when the pool is full. Extend the daemon-backed test to cover separate stores, duplicate references, and full pool capacity.
EclipseIsDead
commented
Sep 23, 2026
EclipseIsDead
left a comment
Author
There was a problem hiding this comment.
Left 2 comments, but overall makes sense to me and it's a clear improvement.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happened
When running a devenv update, I built
devenv shellcompile devenv's ownrust_devenv-*2.3.1 crates, the 1.98.0 rustc toolchain anddevenv-nixpkgs-patchedfor ~15 min. However, all paths returned HTTP 200 fromhttps://devenv.cachix.org/<hash>.narinfo.devenv -v --no-tui eval cachix.pullshowed the daemon rejecting the settings devenv does forward, and nothing at all about substituters:IF the daemon received the substituters it would have printed
ignoring untrusted substituter 'https://devenv.cachix.org'(daemon.cc,setSubstituters) but doesn't because the caches never leave the client process.Verification
meson setupplus compiling the affected objects (remote-store.cc,store-api.cc,daemon.cc,nix_api_store.cc,uds-remote-store.cc,unix_daemon.cc, the libstore tests) with clang 21.1.8 on aarch64-darwin; clang-format clean.ignoring untrusted substituter 'https://devenv.cachix.org'. Draft until that is done.🤖 Generated with Claude Code