Skip to content

Update dev build cycle time#1578

Open
jonwis wants to merge 1 commit intomicrosoft:masterfrom
jonwis:user/jonwis/cppwinrt3
Open

Update dev build cycle time#1578
jonwis wants to merge 1 commit intomicrosoft:masterfrom
jonwis:user/jonwis/cppwinrt3

Conversation

@jonwis
Copy link
Copy Markdown
Member

@jonwis jonwis commented Apr 28, 2026

Noodling on some quality-of-life enhancements for dev builds.

  • Enable running from a "plain" cmd window - finds VsDevCmd using vswhere.exe
  • Combine msbuild invocations into one for multithreaded build
  • Track errors in each invocation and stop if anything broke

Co-authored-by: Copilot <copilot@github.com>
@jonwis
Copy link
Copy Markdown
Member Author

jonwis commented Apr 28, 2026

(Ignore the branch name, it's the third cppwinrt branch I have locally...)

@jonwis jonwis requested review from DefaultRyan and dunhor May 1, 2026 22:48
Comment thread cppwinrt/cppwinrt.vcxproj
Comment thread ensure_vsbuild.cmd
if "%target_platform%"=="" set "target_platform=x64"

set "vsdevcmd_arch="
if /I "%target_platform%"=="x86" set "vsdevcmd_arch=x86"
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.

If host architecture is x64, it's probably best to use x64_x86 to use the x64 compiler and get the advantage of a larger address space.

And if you want to go the extra mile, you should probably do the same for arm64 so that you can cross-compile arm64 on Windows (though this may not be super useful given that it's called from the 'build_test_all' script, so the testing part wouldn't work out so well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure, I'll check it out. I agree that the 'run tests cross arch' probably isn't going to work out a certain matrix.

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.

Though I do realize now this is calling VsDevCmd instead of vcvarsall, so maybe it's handled differently there.

Copy link
Copy Markdown

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

This PR updates the local Windows build workflow for C++/WinRT development by adding Visual Studio environment bootstrapping, consolidating some MSBuild invocations, and wiring cppwinrt to depend on fast_fwd. It fits into the repo’s existing command-driven build/test pipeline for producing _build artifacts and running native test binaries.

Changes:

  • Added ensure_vsbuild.cmd to locate Visual Studio/MSBuild tooling from a plain cmd.exe session.
  • Refactored build_test_all.cmd to stop on errors and combine multiple solution target builds into a single MSBuild invocation.
  • Added a fast_fwd project reference to cppwinrt and ignored the _build output directory in Git.

Reviewed changes

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

File Description
ensure_vsbuild.cmd New helper script to locate vswhere, run VsDevCmd, and resolve MSBuild.
cppwinrt/cppwinrt.vcxproj Adds a project reference from cppwinrt to fast_fwd.
build_test_all.cmd Uses the new environment helper, adds fail-fast checks, and consolidates test-target builds.
.gitignore Ignores the _build artifact directory used by build scripts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build_test_all.cmd
call .nuget\nuget.exe restore natvis\cppwinrtvisualizer.sln
call .nuget\nuget.exe restore test\nuget\NugetTest.sln

call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln /t:fast_fwd
Comment thread build_test_all.cmd
Comment on lines +43 to 46
call msbuild /m /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% cppwinrt.sln "/t:%cppwinrt_targets%"
if errorlevel 1 exit /b %errorlevel%

call msbuild /p:Configuration=%target_configuration%,Platform=%target_platform%,CppWinRTBuildVersion=%target_version% test\nuget\NugetTest.sln
Comment thread build_test_all.cmd
Comment on lines 25 to 28
call msbuild /p:Configuration=%target_configuration%,Platform=%target_platform%,Deployment=Component;CppWinRTBuildVersion=%target_version% natvis\cppwinrtvisualizer.sln
if errorlevel 1 exit /b %errorlevel%

call msbuild /p:Configuration=%target_configuration%,Platform=%target_platform%,Deployment=Standalone;CppWinRTBuildVersion=%target_version% natvis\cppwinrtvisualizer.sln
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.

4 participants