Skip to content

[Settings] Eliminate XamlIndexBuilder parallel build race - #50347

Draft
Yu Leng (moooyo) wants to merge 1 commit into
microsoft:mainfrom
moooyo:codex/fix-xaml-index-builder-race
Draft

[Settings] Eliminate XamlIndexBuilder parallel build race#50347
Yu Leng (moooyo) wants to merge 1 commit into
microsoft:mainfrom
moooyo:codex/fix-xaml-index-builder-race

Conversation

@moooyo

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Eliminates the Settings XamlIndexBuilder parallel-build race by making the tool a build-only ProjectReference owned by PowerToys.Settings.

The change also:

  • removes the nested MSBuild invocation and cross-platform obj directory deletion
  • isolates tool and generated-index outputs by platform and configuration
  • generates and registers the index before AssignTargetPaths so clean builds embed it on the first pass
  • models inputs and outputs for MSBuild incrementality and Visual Studio's fast up-to-date check
  • prevents build-tool assets from flowing into the Settings product output

PR Checklist

  • Tests: targeted Settings solution-filter builds pass
  • Localization: no end-user-facing strings changed
  • Dev docs: no documentation change required
  • New binaries: no new binaries added

Detailed Description of the Pull Request / Additional comments

PowerToys.Settings and Settings.UI.XamlIndexBuilder were both scheduled independently by the solution, while Settings also invoked a second AnyCPU build of the same project. The nested build's AfterBuild target deleted obj/x64 while the solution build was still using it, causing MSB3231 and CS2012 failures.

The builder is now a pure build tool. A non-runtime ProjectReference establishes one dependency in the MSBuild graph and exposes the tool output to a Settings-owned generation target. Generated JSON is kept under a platform/configuration-specific obj directory and copied to the same Assets/Settings destination as before.

Validation Steps Performed

  • Built src/settings-ui/PowerToys.Settings.slnf in Debug x64 with parallel MSBuild and restore using the configured host NuGet source.
  • Repeated the Debug x64 build to verify the generation target is skipped when its inputs and output are up to date.
  • Confirmed build.debug.x64.errors.log is empty and the logs contain no MSB3231, CS2012, or NETSDK1150 errors.
  • Confirmed the generated JSON parses with 467 entries and matches the copied output byte-for-byte.
  • Confirmed PowerToys.Settings.dll contains Microsoft.PowerToys.Settings.UI.Assets.search.index.json.
  • Confirmed no XamlIndexBuilder DLL, deps.json, runtimeconfig.json, or PDB is copied into the Settings product output.

@github-actions github-actions Bot added Product-Settings The standalone PowerToys Settings application Ready for review labels Sep 3, 2026
@moooyo
Yu Leng (moooyo) marked this pull request as draft September 3, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Settings The standalone PowerToys Settings application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant