Repository navigation
fix(batteries): give the wsl-host scope its own id - #745
Merged
Merged
Conversation
sini
approved these changes
Nov 6, 2026
sini
enabled auto-merge (squash)
November 6, 2026 19:27
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.
A host with
wsl.enable = truegets awsl-hostchild scope with the same scope id as the host. Pipes then go wrong for that host:pipe.collectAllmisses its data;Reproduction
templates/ci/modules/deadbugs/wsl-host-scope-id.nix: two hosts each publish onetagand collect every host's tag.iceberguses the wsl battery, with a stub in place of NixOS-WSL.It fails on main, and on v0.19.0 once #703 is applied (v0.19.0 predates it). It passes with
wsl.enable = false.Cause
host-to-wsl-hostresolves the child with onlyhostbound:mkScopeIdbuilds an id from the context alone, so the child's id is the host's (host=iceberg).scopeEntityKindthen records that id aswsl-host, sofindMatchingAlldrops it from({ host, ... }: true)matches, and the pipe runs twice under it.Fix
The child scope gets a binding of its own, the way
system-to-flake-partsdoes, so its id becomeshost=iceberg,wsl-host=iceberg.Removing the
resolve.toline also made the reproduction pass, but I haven't checked what else relies on thewsl-hostscope. If you'd rather fix this inmkScopeId, for anyresolve.tothat adds no binding, I can rework it.Checked
On NixOS with Nix 2.34.9, against main at 2f1ae4a:
deadbugs.wsl-host-scope-idjust ci-deepjust fmtjust unit(checkmate)The same test as a bogus
bug.nixfails on main and on v0.19.0 + #703, and passes withwsl.enable = falseor with the fix.On my own config, which has a NixOS-WSL host, the fix leaves the system derivation of that host and of a non-WSL host unchanged. I also have an SSH key roster built on
pipe.collectAll. Before the fix, the other hosts missed the WSL host's key and the WSL host got every key twice; with the fix, every host gets each key once.AI-assisted: the analysis and the patch were drafted with Claude. I reproduced and checked everything above on my own machine.