Skip to content

Serve WSLC GA releases and stop offering previews to users - #159

Merged
japperJ merged 1 commit into
masterfrom
japperj-wslc-3-upgrade
Sep 29, 2026
Merged

japperJ merged 1 commit into
masterfrom
japperj-wslc-3-upgrade

Conversation

@japperJ

@japperJ japperJ commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Why

WSLC 3.0.1 is the first generally available build of the WSL Containers runtime. Two things kept the app from moving users onto it:

  • OnboardingViewModel.InstallWslcAsync() hardcoded the wsl.2.9.4.0.x64.msi asset and its SHA256, so every new user installed a nine-builds-behind prerelease instead of GA 3.0.1.
  • WslcUpdateService picked the highest version on the releases page without checking the prerelease flag, so the moment the 3.1.0 preview ring opens it would offer previews to users.

For context, the machine this was developed on was itself running 2.9.13.0, which is also a preview.

What changed

  • Onboarding resolves the release instead of pinning one. InstallWslcAsync() now asks WslcUpdateService for the latest GA release and builds the same elevated-PowerShell script from the returned URL, asset filename, and SHA256. A lookup failure or an empty result is surfaced as a logged error instead of launching a script with missing values. The elevated-temp cleanup, SHA verification, and %LOCALAPPDATA%\WinContainers\wsl-install.log behavior are unchanged.
  • Prereleases are filtered. Releases with "prerelease": true are skipped in the shared release scan.
  • Asset matching is anchored. The old StartsWith($"wsl.{version}") check let version 3.0.1 also match wsl.3.0.10.0.x64.msi, which would have produced a version/URL/SHA triple that does not agree. IsX64MsiAsset now requires the version prefix, a numeric build component, and the .x64.msi suffix.
  • Release scan paging raised from 20 to 50 so a burst of preview releases cannot push the newest GA build off the first page. WslcUpdateInfo gained a FileName field so callers stop reconstructing asset names.

Notes

  • No runtime changes were needed for 3.0.1. Every wslc command this app issues is unchanged, and there are no CLI surface or JSON output changes between 2.9.13 and 3.0.1. WslcDriver and WslcCommands are untouched. Worth noting for review: 3.0.1 does add STDIN support through the SDK and impersonates the caller before filesystem operations, both of which are favorable for the host-side file identity this app relies on, but neither required a code change here.
  • The two new tests are source-text contract assertions rather than behavioral tests, because WinContainers.App is WinUI/net10.0-windows-targeted and is not referenced by the test project. This matches the existing convention in RuntimeContractTests.cs. I confirmed they are not vacuous by reverting the service to the old prefix match and no-prerelease-filter and watching the test fail.
  • I did not add visuals.

Testing

  • dotnet build WinContainers.slnx -c Debug --nologo -v q (0 warnings, 0 errors)
  • dotnet test tests/WinContainers.Tests.Unit/WinContainers.Tests.Unit.csproj -c Debug --nologo -v q (220 passed, 0 failed)
  • Negative check: reverted the service to the pre-fix behavior, confirmed WslcUpdateService_ShouldIgnorePrereleasesAndMatchAssetsExactly fails, then restored
  • Separately verified IsX64MsiAsset against 7 cases, including the 3.0.1 vs 3.0.10 collision, wrong architecture suffixes, and a trailing-suffix spoof

Not covered: no end-to-end run of the elevated MSI install against a machine without wslc, since that requires a UAC prompt and a clean host.

Onboarding hardcoded the 2.9.4 preview MSI, so new users were nine
builds behind and on a prerelease rather than the 3.0.1 GA build.

Resolve the latest generally available release through WslcUpdateService
instead, and filter prerelease releases out of the update check so the
preview ring is never offered. Also anchor the MSI asset match on the
build number: the previous prefix check let version 3.0.1 match a 3.0.10
asset and pair it with the wrong URL and hash.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@japperJ
japperJ merged commit 0a1d4d8 into master Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant