Skip to content

Suppress unsupported --rm in WSLC image builds - #603

Merged
Brandon Waterloo [MSFT] (bwateratmsft) merged 3 commits into
mainfrom
copilot/fix-wslc-unrecognized-option
Sep 2, 2026
Merged

Suppress unsupported --rm in WSLC image builds#603
Brandon Waterloo [MSFT] (bwateratmsft) merged 3 commits into
mainfrom
copilot/fix-wslc-unrecognized-option

Conversation

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

WSLC rejects the default image build command because it does not support --rm.

  • Runtime-aware build template
    • Omit --rm when WSLC is selected.
    • Preserve --rm for other container runtimes.
    • Leave user-defined command templates unchanged.
  • Regression coverage
    • Verify the default WSLC build command excludes --rm.

Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copilot if we don't already have a WSLC canary test for --rm, please add one. Those negative-canary tests that assert that WSLC still doesn't have the option--so that if it is added, we notice

Copilot AI changed the title [WIP] Fix unrecognized option '--rm' for WSLC image build Suppress unsupported --rm in WSLC image builds Sep 1, 2026
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Copilot if we don't already have a WSLC canary test for --rm, please add one. Those negative-canary tests that assert that WSLC still doesn't have the option--so that if it is added, we notice

Added the WSLC build --rm negative canary in commit 9b4d272. It probes wslc build --help and fails if --rm appears.

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.

🟢 Approval recommended

The change is small, scoped to the default build template, and includes targeted regression tests covering both the WSLC CLI behavior and the extension’s default command generation.

Pull request overview

This PR updates the Container Tools extension’s default image build command template to avoid passing --rm when the selected container runtime is WSLC, which currently rejects that flag, and adds regression coverage to ensure the default WSLC build command stays compatible.

Changes:

  • Introduce a runtime-aware ${rm} placeholder for the default build command template and omit it for WSLC.
  • Update selectBuildCommand to provide ${rm} based on the selected runtime client ID.
  • Add tests validating (a) WSLC CLI still does not advertise --rm for build, and (b) the extension’s default WSLC build command does not include --rm.
File summaries
File Description
packages/vscode-container-client/src/test/clients/WslcClient/WslcCanary.test.ts Adds a canary test asserting wslc build --help still lacks --rm.
extensions/vscode-containers/src/test/commands/selectCommandTemplate.test.ts Adds a unit test verifying the default WSLC build command args omit --rm.
extensions/vscode-containers/src/commands/selectCommandTemplate.ts Injects a runtime-dependent ${rm} variable for build command template resolution.
extensions/vscode-containers/package.json Updates the default build command template to use ${rm} instead of hardcoding --rm.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bwateratmsft
Brandon Waterloo [MSFT] (bwateratmsft) merged commit a14f645 into main Sep 2, 2026
3 checks passed
@bwateratmsft
Brandon Waterloo [MSFT] (bwateratmsft) deleted the copilot/fix-wslc-unrecognized-option branch September 2, 2026 18:15
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: unrecognized option '--rm' when building image

4 participants