Skip to content

fix: proper check for setting /sbin when changing populateBin from true to false - #1010

Merged
nzbr merged 2 commits into
nix-community:mainfrom
meskill:fix-wsl-hang-envfs
Mar 18, 2026
Merged

fix: proper check for setting /sbin when changing populateBin from true to false#1010
nzbr merged 2 commits into
nix-community:mainfrom
meskill:fix-wsl-hang-envfs

Conversation

@meskill

@meskill meskill commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

fix #1009

The bug 👿 introduced by https://github.com/nix-community/NixOS-WSL/pull/666/changes

If populateBin is false (i.e. when services.envfs enabled for nixos) the check verifies if the /sbin is not folder, but if the system was built before without envfs the /sbin will be populated as symlink to /bin.

After enabling envfs the check will fail because the symlink to dir is also a dir, so the sbin was always pointing to the empty bin managed by envfs.

The fix verifies that the /sbin is recreated if it's a symlink or not directory.

Verified on both latest bare nixos-wsl distro and my local setup that was previously bricking after every attempt to enable envfs.

@nzbr

nzbr commented Mar 18, 2026

Copy link
Copy Markdown
Member

Thanks!
I added a test for envfs so we don't break it again in the future and will merge this as soon as it has passed

@nzbr
nzbr enabled auto-merge (rebase) March 18, 2026 22:09
@nzbr
nzbr merged commit e58c9f4 into nix-community:main Mar 18, 2026
35 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Backport failed for release-25.05, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-25.05
git worktree add -d .worktree/backport-1010-to-release-25.05 origin/release-25.05
cd .worktree/backport-1010-to-release-25.05
git switch --create backport-1010-to-release-25.05
git cherry-pick -x 146e7c5e8e50ea9be30f7a85e7090c595a28ff06 e58c9f4b3233d63abe4dfc4f7d69704900428348

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Backport failed for release-25.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-25.11
git worktree add -d .worktree/backport-1010-to-release-25.11 origin/release-25.11
cd .worktree/backport-1010-to-release-25.11
git switch --create backport-1010-to-release-25.11
git cherry-pick -x 146e7c5e8e50ea9be30f7a85e7090c595a28ff06 e58c9f4b3233d63abe4dfc4f7d69704900428348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enabling services.envfs.enable bricks the distribution

3 participants