Skip to content

Improve Visual Studio toolchain detection for Windows builds#766

Open
johnml1135 wants to merge 2 commits intomainfrom
improve-vs-toolchain-detection
Open

Improve Visual Studio toolchain detection for Windows builds#766
johnml1135 wants to merge 2 commits intomainfrom
improve-vs-toolchain-detection

Conversation

@johnml1135
Copy link
Contributor

@johnml1135 johnml1135 commented Mar 16, 2026

This PR splits out the Windows build-toolchain reliability work from the local liblcm source-mode changes.

Included in this PR:

  • prefer the Visual Studio HostX64/x64 MSVC tool directory in the build environment
  • improve nmake.exe discovery in the custom Make MSBuild task
  • align dependency verification with the current Windows toolchain expectations

Not included:

  • any liblcm source-mode wiring
  • VS Code local-mode launch/build flow changes
  • DistFiles/Parts/StandardParts.xml

StandardParts.xml was reviewed during the split and left out intentionally. It is not part of the toolchain work, and the added part IDs are not referenced elsewhere on the branch, so it does not belong in this standalone PR.

This PR does not change how FieldWorks resolves liblcm.

Validation:

  • split contains only Build/Agent/FwBuildEnvironment.psm1, Build/Agent/Verify-FwDependencies.ps1, and Build/Src/FwBuildTasks/Make.cs
  • branch reviewed to keep the split independent of local liblcm workflow changes

This change is Reviewable

Copilot AI review requested due to automatic review settings March 16, 2026 20:35
Copy link
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

This PR improves Windows build-toolchain reliability by preferring the correct MSVC host tool bin directory, making nmake.exe discovery more robust, and updating dependency verification to match current expectations.

Changes:

  • Prefer Visual Studio MSVC Hostx64\x64 tool bin directories when resolving build tools.
  • Improve dependency verification UX (compact vs detailed) and add an opt-in structured results mode.
  • Update WiX dependency detection logic to be more structured (XML-based) and remove legacy NuGet CLI checks.

Reviewed changes

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

File Description
Build/Src/FwBuildTasks/Make.cs Adds MSVC tool-bin discovery under VCINSTALLDIR\Tools\MSVC\*\bin\... and prefers Hostx64/x64 for tool resolution.
Build/Agent/Verify-FwDependencies.ps1 Adds -Detailed / -PassThru, adjusts summary output, and updates WiX detection; removes NuGet CLI check.
Build/Agent/FwBuildEnvironment.psm1 Ensures the preferred MSVC HostX64\x64 bin path is moved to the front of PATH during VS env initialization.

@github-actions
Copy link

github-actions bot commented Mar 16, 2026

NUnit Tests

    1 files  ±0      1 suites  ±0   5m 25s ⏱️ -19s
4 058 tests ±0  3 987 ✅ ±0  71 💤 ±0  0 ❌ ±0 
4 067 runs  ±0  3 996 ✅ ±0  71 💤 ±0  0 ❌ ±0 

Results for commit 42e67f1. ± Comparison against base commit d58727c.

♻️ This comment has been updated with latest results.

@johnml1135 johnml1135 force-pushed the improve-vs-toolchain-detection branch from 98915ea to 42e67f1 Compare March 17, 2026 00:24
@jasonleenaylor
Copy link
Contributor

I think that this change should be redone to use the microsoft provide vswhere package.

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.

3 participants