feat: Add versioned distributions, replace non-versioned Alpine and Debian with wsl --import#85
feat: Add versioned distributions, replace non-versioned Alpine and Debian with wsl --import#85exoego wants to merge 27 commits intoVampire:masterfrom
Conversation
Replace the stale aka.ms shortlink for Debian (which still served Debian 11 bullseye with broken backports repositories) with the Debian 13 trixie .wsl file from Salsa. Replace the Microsoft Store download for Alpine (which relied on a third-party API that now blocks automated usage) with the official Alpine minirootfs tarball. Both distributions are now installed via wsl --import instead of the AppxBundle installer. Fixes Vampire#76, fixes Vampire#82
Use a staging directory on the same drive as the download before calling cacheDir(), which handles cross-device moves properly. The direct mv() from D: (RUNNER_TEMP) to C: (tool cache) failed with EXDEV on Windows runners.
Debian 13 (trixie) ships with a default /etc/wsl.conf, similar to Ubuntu-24.04.
Alpine minirootfs lacks shadow utilities (useradd), so fall back to BusyBox adduser when useradd is not available.
|
Thanks for your effort, really appreciate it.
|
The third-party API at store.rg-adguard.net, which was used to resolve Microsoft Store download URLs, has permanently blocked automated usage. Remove all related code: productId constructors, dynamic URL resolution via HTTP client, echo endpoint debug logic, and Ktor imports. All distributions now use direct download URLs.
Replace the useWslImport boolean with an InstallMethod enum derived from the installer file extension: .exe for AppxBundle, .wsl for wsl --install --from-file (with --import fallback on older WSL), and .tar.gz for wsl --import.
Add open createUser() method to Distribution with useradd as default. Override in ApkBasedDistribution to use BusyBox adduser instead. This replaces the try-useradd-then-fallback-to-adduser approach with a direct call to the correct command for each distribution.
Keep "Debian" pointing to the old bullseye AppxBundle for backward compatibility but emit a deprecation warning. Register "Debian-11" as an alias. Add "Debian-12" (bookworm) and "Debian-13" (trixie) using .wsl files from Salsa, installed via wsl --install --from-file with --import fallback.
Remove the old "Alpine" distribution which relied on a third-party Microsoft Store API that has permanently blocked automated usage. Add versioned distributions (Alpine-3.20, Alpine-3.21, Alpine-3.22, Alpine-3.23) using official minirootfs tarballs installed via wsl --import.
Some distributions (Debian-13, Ubuntu-24.04) ship with a default /etc/wsl.conf. Log existing contents in debug mode before overwriting, document the overwrite behavior in action.yml, and update the test to accept known default content instead of suppressing per-distribution.
Use useradd-or-adduser fallback in test user creation for Alpine compatibility. Install bash dynamically for Alpine distributions in the wsl-bash scripts test instead of using a hardcoded index.
The old Debian distribution (bullseye) is deprecated and its apt-get update fails due to removed backports repositories. Debian-13 (trixie) is the appropriate new default.
Remove deprecated Debian (bullseye) from the distributions test matrix since its apt-get update fails due to removed backports. Debian-12 and Debian-13 provide full Debian test coverage. Update test_multiple_usage_with_same_distribution to use Debian-13 as the secondary distribution.
wsl --install --from-file prompts for interactive UNIX user creation which hangs in CI environments. Use wsl --import for both .wsl and .tar.gz files since it imports directly as root without prompts.
installerFile is only needed for AppxBundle distributions to locate the .exe inside the extracted archive. For .wsl and .tar.gz distributions the filename is derived from the download URL via downloadFileName, removing redundant configuration.
|
@Vampire Thanks for the review.
Tried implementing
Running the OOBE is the intended behavior.
Done. "Debian" still points to the old bullseye AppxBundle URL and emits a deprecation warning in refresh().
Done. "Alpine" is removed since the MS Store API is permanently broken and the last working version cannot be determined.
Debian-13 ships with
The wsl.conf test was rewritten to use
Done. Replaced
Done. Removed productId constructors, _downloadUrl nullable pattern, rg-adguard API calls, Ktor HTTP client, and echo debug endpoint.
Done. installerFile is now
Done. Added |
|
Wow, nice, thanks.
Don't you send me my own discussion? :-D Anyway, how about using
You also deprecated Debian-11, why? Debian-11 should then of course also be added to the tests.
But I agree that it is better to not do that for the new way but use Other apk based dists in the future could support
Why not? The "Alpine" version is "3.17" for which also a minirootfs tarball exists.
That was actually just the precondition to ensure what the action should do is not there yet.
Is ktor still used somewhere? If I start to annoy you, just tell me, then I also can do the polishings probably, after you did really great work so far, thanks again. :-) |
|
If the proper We can also support additional distributions as for example listed on https://github.com/microsoft/WSL/blob/master/distributions/DistributionInfo.json, but that should probably be done separately later. |
|
Oh, and the new dists are missing in the |
|
And the dists and doc update in the readme template |
Debian-11 is now its own object with a separate wslId ("Debian-11") rather than an alias for the unversioned "Debian".
Use --no-launch to skip the OOBE script that prompts for interactive user creation, keeping root as the default user. This properly uses the intended installation command for .wsl files while remaining compatible with CI environments.
The last Alpine version that worked via the Microsoft Store was 3.17. Restore "Alpine" as a deprecated distribution pointing to 3.17 (same pattern as "Debian"). Add Alpine-3.17, Alpine-3.18, and Alpine-3.19 using official minirootfs tarballs.
The adduser override was on ApkBasedDistribution, but other future apk-based distributions may have the shadow package and support useradd. Introduce AlpineDistribution as an intermediate subclass that overrides createUser to use BusyBox adduser, keeping ApkBasedDistribution generic.
The wsl.conf tests now use diff to verify the file content matches what the action wrote, instead of only checking that the file exists.
Ktor was only used for the rg-adguard API calls which have been removed. The distribution downloads use @actions/tool-cache downloadTool() instead. Remove the Ktor client dependencies, version catalog entries, and the build script workaround that patched abort-controller and node-fetch requires.
Older WSL versions (e.g. on windows-2022) do not support --from-file. Check wslHelp() and fall back to wsl --import for .wsl files on those environments.
Debian-11 is the same bullseye image as the old "Debian" default, preserving compatibility for users who rely on the default without specifying a distribution explicitly.
The AppxBundle installer registers the distribution as "Debian", not "Debian-11". The wslId must match the registered name for wsl --set-default and other WSL commands to work.
The default distribution test uses update=true, which fails on Debian-11 due to the broken bullseye-backports repository. Use Debian-13 for this test since it exercises the update flow with a working distribution.
The cached filename changed from installerFile to downloadFileName, so stale caches from previous runs contain files under the old name. Bump the cache key prefix from 2 to 3 to force re-download.
|
@Vampire I think the 2nd review batch were all addressed now.
Oh, I overlooked it.
Fixed. "Debian-11" is now an independent, non-deprecated distribution (not an alias for "Debian").
Done. Introduced
Done. "Alpine" is restored as a deprecated distribution pointing to Alpine 3.17 (the last working MS Store version). Alpine-3.17, 3.18, and 3.19 are added alongside the existing 3.20–3.23.
Done. The wsl.conf tests now verify content via
Done. Removed Ktor dependencies and the KTOR-6158 workaround.
Good idea.
Done. All distributions (including deprecated ones) added to action-types.yml and readme/README_template.md. The wsl.conf documentation now mentions Debian-13 alongside Ubuntu-24.04 as distributions that ship with a default wsl.conf. |
Changes
wsl --from-file --no-launchwith fallback towsl --import, instead of the AppxBundle installer.This is a breaking change as distributions get major version bumps.
I think it is a good timing to bundle with #84 (Node.js major version bump).