Add dev environment setup with WinGet Configuration#40117
Add dev environment setup with WinGet Configuration#40117
Conversation
9d13a2f to
e7e465d
Compare
There was a problem hiding this comment.
Pull request overview
Adds a PowerShell prerequisite-checker to help contributors validate a Windows WSL dev environment before building, and extends the test runner to support an /attachdebugger convenience option (with corresponding documentation updates).
Changes:
- Add
tools/setup-dev-env.ps1to validate core build prerequisites (CMake, VS, SDK, symlink capability) and optionally WinDbg/Python. - Update
tools/test/run-tests.ps1to implement/attachdebuggerby launching WinDbgX against the TAEF host process. - Document the new script and test option in developer docs and instructions.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/setup-dev-env.ps1 | New prerequisite checker script with install guidance for missing components |
| tools/test/run-tests.ps1 | Adds /attachdebugger handling and launches WinDbgX against the test host PID |
| doc/docs/dev-loop.md | References the new setup script and documents /attachdebugger vs /waitfordebugger |
| test/README.md | Documents test.bat/run-tests.ps1 option /attachdebugger behavior |
| .github/copilot-instructions.md | Updates repo guidance to include /attachdebugger |
e7e465d to
ba60a0f
Compare
ba60a0f to
f335c0b
Compare
f335c0b to
a08d8e9
Compare
d49e820 to
c89c9e5
Compare
16079e2 to
9b4fd54
Compare
9b4fd54 to
9e42b72
Compare
|
Hey @benhillis this could probably be handled with a WinGet Configuration file. |
Good suggestion. Let me look into it. |
f8c4b7a to
b593245
Compare
|
Switched to WinGet Configuration files in the latest revision. Thanks for the suggestion @denelon! |
| tools\setup-dev-env.ps1 | ||
| ``` | ||
|
|
||
| This uses [WinGet Configuration](https://learn.microsoft.com/windows/package-manager/configuration/) to install Developer Mode, CMake, Visual Studio 2022, and the required workloads from [`.vsconfig`](https://github.com/microsoft/WSL/blob/master/.vsconfig). If VS 2022 is already installed, the script detects your edition (Community, Professional, or Enterprise) and uses the matching configuration. If no VS 2022 is found, it defaults to Community. |
There was a problem hiding this comment.
nit: winget configure may not be enabled by default out of the box. "winget configure --enable" enables it. We could either document it here or call the command in the dev setup script.
Add a one-command developer environment setup that uses WinGet Configuration (DSC) to install all build prerequisites: Developer Mode, CMake, Visual Studio 2022, and the required VS workloads/components. New files: - tools/setup-dev-env.ps1: Detects any existing VS 2022 edition (Community/Professional/Enterprise) and runs the matching WinGet configuration. Defaults to Community when no VS 2022 is found. - .vsconfig: Declares the required VS components (MSVC, ATL, Clang, Windows SDK 26100, UWP tools, .NET desktop/WinUI workloads) so VS Installer can import them directly. - .config/configuration.winget: WinGet DSC config for VS Community. - .config/configuration.vsProfessional.winget: Same for Professional. - .config/configuration.vsEnterprise.winget: Same for Enterprise. Updated doc/docs/dev-loop.md to document the automated setup and reference the new .vsconfig and winget configuration files, while keeping manual install instructions in a collapsed details block.
b3f4ca4 to
9e2f805
Compare
| $configPath = Join-Path $configDir $configFile | ||
|
|
||
| # ── Run WinGet Configuration ──────────────────────────────────────── | ||
| Write-Host "" | ||
| Write-Host "Running WinGet Configuration ($configFile)..." -ForegroundColor Cyan | ||
| Write-Host " This will install: Developer Mode, CMake, VS 2022 + required components" | ||
| Write-Host "" | ||
|
|
||
| winget configure --enable | ||
| if ($LASTEXITCODE -ne 0) |
There was a problem hiding this comment.
Before running winget configure, consider validating prerequisites explicitly (e.g., winget is available and $configPath exists). With $ErrorActionPreference = "Stop", a missing winget binary or missing config file will terminate the script with a generic error rather than the more actionable messages below.
Address review feedback: document that 'winget configure --enable' is required before running winget configure manually, since the feature may not be enabled by default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Adds a one-command developer environment setup using WinGet Configuration with per-edition VS support, following the pattern used by microsoft/winget-cli and microsoft/terminal.
Quick start
Or run a WinGet configuration directly:
How it works
WinGet Configuration files (3 self-contained configs, one per VS edition): Each declaratively installs Developer Mode, CMake, Visual Studio 2022, and all required workloads/components from
.vsconfigusing DSC resources. Idempotent and safe to re-run.Smart detection script (
tools/setup-dev-env.ps1): Usesvswhereto detect any existing VS 2022 installation and picks the matching configuration file. If no VS 2022 is found, defaults to Community edition. The script is a thin wrapper — all the real work is done bywinget configure.What gets installed
Microsoft.Windows.Settings/WindowsSettingsDSC resourceMicrosoft.WinGet.DSC/WinGetPackageDSC resourceMicrosoft.WinGet.DSC/WinGetPackage+Microsoft.VisualStudio.DSC/VSComponentswith.vsconfigFiles
.config/configuration.winget— WinGet config (Community edition, default).config/configuration.vsProfessional.winget— WinGet config (Professional).config/configuration.vsEnterprise.winget— WinGet config (Enterprise).vsconfig— Required VS workloads/componentstools/setup-dev-env.ps1— Smart edition detection +winget configuredoc/docs/dev-loop.md— Updated prerequisites documentationDeveloper flow