Skip to content

Add dev environment setup with WinGet Configuration#40117

Open
benhillis wants to merge 2 commits intomasterfrom
user/benhill/setup-dev-env
Open

Add dev environment setup with WinGet Configuration#40117
benhillis wants to merge 2 commits intomasterfrom
user/benhill/setup-dev-env

Conversation

@benhillis
Copy link
Copy Markdown
Member

@benhillis benhillis commented Apr 6, 2026

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

tools\setup-dev-env.ps1

Or run a WinGet configuration directly:

winget configure -f .config/configuration.winget                   # Community (default)
winget configure -f .config/configuration.vsProfessional.winget    # Professional
winget configure -f .config/configuration.vsEnterprise.winget      # Enterprise

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 .vsconfig using DSC resources. Idempotent and safe to re-run.

Smart detection script (tools/setup-dev-env.ps1): Uses vswhere to 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 by winget configure.

What gets installed

Prerequisite Method
Developer Mode Microsoft.Windows.Settings/WindowsSettings DSC resource
CMake Microsoft.WinGet.DSC/WinGetPackage DSC resource
VS 2022 + components Microsoft.WinGet.DSC/WinGetPackage + Microsoft.VisualStudio.DSC/VSComponents with .vsconfig

Files

  • .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/components
  • tools/setup-dev-env.ps1 — Smart edition detection + winget configure
  • doc/docs/dev-loop.md — Updated prerequisites documentation

Developer flow

Fork -> Clone -> tools\setup-dev-env.ps1 -> cmake . -> cmake --build . -- -m

Copilot AI review requested due to automatic review settings April 6, 2026 02:42
@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from 9d13a2f to e7e465d Compare April 6, 2026 02:45
@benhillis benhillis requested a review from a team as a code owner April 6, 2026 02:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.ps1 to validate core build prerequisites (CMake, VS, SDK, symlink capability) and optionally WinDbg/Python.
  • Update tools/test/run-tests.ps1 to implement /attachdebugger by 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

@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from e7e465d to ba60a0f Compare April 6, 2026 02:50
Copilot AI review requested due to automatic review settings April 6, 2026 02:53
@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from ba60a0f to f335c0b Compare April 6, 2026 02:53
@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from f335c0b to a08d8e9 Compare April 6, 2026 02:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Copilot AI review requested due to automatic review settings April 6, 2026 04:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from d49e820 to c89c9e5 Compare April 6, 2026 04:21
Copilot AI review requested due to automatic review settings April 6, 2026 04:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings April 6, 2026 15:58
@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from 16079e2 to 9b4fd54 Compare April 6, 2026 15:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from 9b4fd54 to 9e42b72 Compare April 6, 2026 16:00
@denelon
Copy link
Copy Markdown

denelon commented Apr 6, 2026

Hey @benhillis this could probably be handled with a WinGet Configuration file.

@benhillis
Copy link
Copy Markdown
Member Author

Hey @benhillis this could probably be handled with a WinGet Configuration file.

Good suggestion. Let me look into it.

Copilot AI review requested due to automatic review settings April 7, 2026 16:58
@benhillis benhillis changed the title Add setup-dev-env.ps1 to validate development prerequisites Add WinGet configuration file for dev environment setup Apr 7, 2026
@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from f8c4b7a to b593245 Compare April 7, 2026 17:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

@benhillis benhillis changed the title Add WinGet configuration file for dev environment setup Add dev environment setup with WinGet Configuration Apr 7, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 17:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings April 8, 2026 13:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

@benhillis
Copy link
Copy Markdown
Member Author

benhillis commented Apr 8, 2026

Switched to WinGet Configuration files in the latest revision. Thanks for the suggestion @denelon!

yao-msft
yao-msft previously approved these changes Apr 10, 2026
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.
Copilot AI review requested due to automatic review settings April 10, 2026 02:19
@benhillis benhillis force-pushed the user/benhill/setup-dev-env branch from b3f4ca4 to 9e2f805 Compare April 10, 2026 02:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment on lines +57 to +66
$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)
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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>
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.

5 participants