Skip to content

Detect stale FwBuildTasks bootstrap outputs#880

Open
johnml1135 wants to merge 2 commits into
mainfrom
fix_build_warnings_immutable
Open

Detect stale FwBuildTasks bootstrap outputs#880
johnml1135 wants to merge 2 commits into
mainfrom
fix_build_warnings_immutable

Conversation

@johnml1135
Copy link
Copy Markdown
Contributor

@johnml1135 johnml1135 commented May 12, 2026

Summary

  • rebuild FwBuildTasks when the bootstrapped output is older than its source or package/props inputs
  • keep the freshness decision in build.ps1 to avoid paying for a second MSBuild bootstrap invocation on the common up-to-date path
  • clarify -ForceBuildBuildTasks help text

Origin

The change started from build warnings in the main build when RegFree processing tried to load managed metadata and hit an assembly mismatch in the bootstrapped FwBuildTasks output.

Root cause

FwBuildTasks was bootstrapped outside the main traversal build and the existing guard only checked whether BuildTools/FwBuildTasks/<Configuration>/FwBuildTasks.dll existed. That meant stale bootstrap outputs could survive package or build-input changes, so old dependency copies could remain in BuildTools/FwBuildTasks/<Configuration>/ and produce warnings even though the main build itself was otherwise current.

Solution

Add a targeted bootstrap freshness check in build.ps1 that rebuilds FwBuildTasks when:

  • the bootstrap output is missing
  • the companion config is missing
  • any Build/Src/FwBuildTasks source/project/targets input is newer than the bootstrapped DLL
  • key repo-level props/targets/package inputs are newer than the bootstrapped DLL

This stays as a cheap script-level preflight instead of always invoking a second MSBuild bootstrap build, which keeps the common up-to-date path faster while still fixing the stale-output case.

Validation

  • CI: Full local check
  • ./build.ps1

This change is Reviewable

Copilot AI review requested due to automatic review settings May 12, 2026 23:21
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

Note

Copilot was unable to run its full agentic suite in this review.

Adds a script-level “freshness” check to ensure the bootstrapped FwBuildTasks outputs are rebuilt when stale, avoiding runtime mismatches while keeping the common up-to-date path fast.

Changes:

  • Introduces Test-FwBuildTasksBootstrapRequired to detect stale/missing FwBuildTasks bootstrap outputs based on timestamps of source and key repo inputs.
  • Updates bootstrap decision logic to use the freshness check instead of only checking for existence.
  • Clarifies -ForceBuildBuildTasks help text.

Comment thread build.ps1 Outdated
Comment thread build.ps1 Outdated
Comment thread build.ps1 Outdated
Comment thread build.ps1 Outdated
Comment thread build.ps1
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

NUnit Tests

    1 files  ± 0      1 suites  ±0   8m 43s ⏱️ - 2m 36s
4 205 tests +18  4 134 ✅ +18  71 💤 ±0  0 ❌ ±0 
4 214 runs  +18  4 143 ✅ +18  71 💤 ±0  0 ❌ ±0 

Results for commit 3bfa7be. ± Comparison against base commit 9be9d6b.

♻️ This comment has been updated with latest results.

@johnml1135
Copy link
Copy Markdown
Contributor Author

Addressed the review notes in 3bfa7be.

  • switched the new bootstrap path checks to Test-Path -LiteralPath
  • replaced the recursive Get-ChildItem -Include scan with a single recursive file enumeration filtered by extension
  • added an explicit Build/Src/FwBuildTasks source-root check so a missing path fails with a clear error instead of a generic enumeration failure

Validation run locally:

  • ./build.ps1
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Build\Agent\commit-messages.ps1
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\Build\Agent\check-and-fix-whitespace.ps1

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.

2 participants