Skip to content

fix(wslc): clarify WSL runtime prerequisite - #656

Merged
Huzaifa Danish (huzaifa-d) merged 2 commits into
mainfrom
huzaifa-d-investigate-issue-553
Jul 31, 2026
Merged

Huzaifa Danish (huzaifa-d) merged 2 commits into
mainfrom
huzaifa-d-investigate-issue-553

Conversation

@huzaifa-d

@huzaifa-d Huzaifa Danish (huzaifa-d) commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Clarifies the WSLC error when WSL is too old. The error now points users to WSL 2.8.1+ and wsl --update; the getting-started guide is aligned.

🔗 References

Resolves #553

🔍 Validation

  • cargo fmt --all -- --check
  • cargo test -p wslc_common (45 passed)

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • Updated documentation (if applicable)
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes

📋 Issue Type

  • Bug fix
  • Feature
  • Task

Copilot AI review requested due to automatic review settings July 16, 2026 20:08
@huzaifa-d
Huzaifa Danish (huzaifa-d) requested a review from a team as a code owner July 16, 2026 20:08
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR clarifies WSLC prerequisite failures when WslcCanRun reports missing components, aligning runtime requirements (WSL runtime package minimum) with the getting-started documentation and adding a regression test for the new message.

Changes:

  • Add a helper to produce a more specific WSLC prerequisite error when WslcCanRun reports WslPackage missing, and add a unit test covering the message contents.
  • Update the WSLC getting-started guide to consistently document the minimum WSL runtime version (2.8.0+) and clarify that wslcsdk.dll is a separate dependency.
Show a summary per file
File Description
src/backends/wslc/common/src/wsl_container_runner.rs Improves prerequisite failure messaging from WslcCanRun and adds a unit test for the updated message.
docs/wsl/wsl-container-getting-started.md Updates prerequisite and troubleshooting documentation to consistently state the WSLC minimum WSL runtime version and separate SDK DLL requirement.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Low

}

fn wslc_prerequisite_error(missing: WslcComponentFlags) -> String {
if missing as u32 & WslcComponentFlags::WslPackage as u32 != 0 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WslcComponentFlags is a fieldless repr(u32) enum, but wslcsdk.h declares it as combinable flags. WslcCanRun can therefore return 3 when both components are missing, which is not a valid Rust enum discriminant and causes undefined behavior when read here. Please represent this FFI type as a transparent integer-backed bitmask and add coverage for combined values.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Waiting for additional information or action from the issue or pull-request author. label Jul 17, 2026
huzaifa-msft and others added 2 commits July 28, 2026 12:01
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f46e1b1d-d428-4d1b-b9c3-b83ca7b35ec2
- Branch remediation guidance by missing component: VirtualMachinePlatform
  now tells the user to enable the Windows optional feature instead of
  incorrectly suggesting a WSL update, per review feedback (updating WSL
  does not enable Virtual Machine Platform).
- Standardize on 'WSLC runtime unavailable' wording across code and docs
  (was inconsistent with 'runtime not available' in some places).
- Add table-driven tests covering WslPackage, VirtualMachinePlatform,
  their combined value, and SdkNeedsUpdate, asserting the version and
  remediation guidance selected for each case.
- Align remaining docs mentions in wsl-container-support-plan.md with the
  same wording.

Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 28, 2026 19:06
@huzaifa-d
Huzaifa Danish (huzaifa-d) force-pushed the huzaifa-d-investigate-issue-553 branch from e0681ed to a30461e Compare July 28, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Comments suppressed due to low confidence (4)

src/backends/wslc/common/src/wsl_container_runner.rs:343

  • WSLC_COMPONENT_FLAG_SDK_NEEDS_UPDATE is not handled here. When it is the only bit, the message merely says to ensure the SDK is installed; when combined with another bit, SDK guidance disappears entirely. Add a dedicated branch with an actionable SDK-update remedy, leaving the generic fallback only for unknown flags.
    if guidance.is_empty() {
        guidance.push("ensure WSL2 and the WSLC SDK are installed".to_string());

docs/wsl/wsl-container-getting-started.md:303

  • This troubleshooting row omits the SdkNeedsUpdate condition that WslcGetMissingComponents can report. Add the outdated/incompatible WSLC SDK case and its actionable remedy; otherwise users receiving that named component still cannot resolve the error from this guide.
| `WSLC runtime unavailable` | WSL runtime package is missing, older than 2.9.3, or the Virtual Machine Platform optional component is disabled | Update WSL with `wsl --update --pre-release`, verify the installed version with `wsl --version`, and enable the Virtual Machine Platform optional component if required. The WSLC SDK DLL is a separate dependency and does not replace the WSL runtime package. |

docs/wsl/wsl-container-getting-started.md:14

  • This newly added row duplicates the identical Windows 11 prerequisite immediately above it. Remove the duplicate so the table lists each requirement once.

This issue also appears on line 303 of the same file.

| **Windows 11** | Required for WSL2 and the WSLC SDK |

src/backends/wslc/common/src/wsl_container_runner.rs:340

  • This contradicts the PR description, which says the error should direct users to WSL 2.8.1+ and the stable wsl --update command. Requiring 2.9.3 from the pre-release channel is materially different. Confirm the actual runtime floor and align this message, its tests, the getting-started guide, and the PR description.

This issue also appears on line 342 of the same file.

            .push("install WSL 2.9.3 or newer and run `wsl --update --pre-release`".to_string());
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

@huzaifa-d
Huzaifa Danish (huzaifa-d) merged commit d366fed into main Jul 31, 2026
23 checks passed
@huzaifa-d
Huzaifa Danish (huzaifa-d) deleted the huzaifa-d-investigate-issue-553 branch July 31, 2026 19:23
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the Needs-Author-Feedback Waiting for additional information or action from the issue or pull-request author. label Jul 31, 2026
Carlos Alexandro Becker (caarlos0) added a commit to caarlos0/mxc that referenced this pull request Jul 31, 2026
Two conflicts, both resolved by keeping each side's intent:

* src/backends/wslc/common/src/wsl_container_runner.rs -- both sides appended
  to `mod tests`, so both blocks are kept: this branch's teardown/pump tests
  and main's `wslc_prerequisite_error` tests (microsoft#656).

* docs/wsl/wsl-container-getting-started.md -- takes main's clarified WSL
  runtime and WSLC SDK prerequisite wording, with this branch's note that the
  DLL sits next to *the running executable* (which is now the caller's own
  binary when using the Rust SDK), not only wxc-exec.exe.

One deliberate deviation in that table: microsoft#656 landed the `Windows 11` row
twice, and the merge offered to bring the duplicate along. The resolution
keeps a single row -- adjacent identical rows are plainly accidental, and
restating one here would make it look intentional. Flagging it since it is
technically an upstream line this merge does not reproduce.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 1cfac031-7051-4559-8c4e-9f76fa8605c2
Signed-off-by: Carlos Alexandro Becker <[email protected]>
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.

wslc setup failed: WSLC runtime not available. Missing components: WslPackage. Ensure WSL2 and the WSLC SDK are installed.

5 participants