-
Notifications
You must be signed in to change notification settings - Fork 842
Move bootstrap logic into MSBuild targets #19197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Created eng/targets/Bootstrap.targets with automatic bootstrap detection - Updated Directory.Build.targets to import Bootstrap.targets - Updated proto.proj with NETCORE_ENGINEERING_TELEMETRY property - Simplified .github/workflows/copilot-setup-steps.yml - Updated .github/copilot-instructions.md with new build/test commands Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
- Removed invalid /clp parameter from dotnet publish command - Tested bootstrap auto-detection and execution - Verified bootstrap skip on subsequent builds - Verified FSharp.Compiler.Service.sln doesn't trigger bootstrap - Verified error handling with proper MSBuild error messages Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
|
@copilot : Tests, which are internally also triggering builds of test projects, now also launch bootstrap and it leads to conflicts and resource exhaustion. [xUnit.net 00:10:16.41] Miscellaneous.FsharpSuiteMigrated_TypeCheckTests.type check neg29 [SKIP] |
Fixes issue where test projects in artifacts/Temp trigger bootstrap build, causing resource conflicts. Projects under artifacts/ now skip bootstrap since they are build outputs/temporary projects, not source code. Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
Fixed in commit 02fff16. Added skip condition for projects under |
✅ No release notes required |
Move Bootstrap Logic into MSBuild Targets - COMPLETE ✅
Successfully implemented automatic bootstrap execution via MSBuild targets, making
dotnet build FSharp.slnwork without scripts.Changes Made:
eng/targets/Bootstrap.targetswith automatic bootstrap detection and executionDirectory.Build.targetsto import Bootstrap.targetsproto.projto add telemetry property for AzDO error categorization.github/workflows/copilot-setup-steps.ymlto use direct dotnet commands.github/copilot-instructions.mdto remove bootstrap detection logicLatest Fix (commit 3f0a7c9):
Added condition to skip bootstrap for any project under the
artifacts/directory. This prevents temporary test projects (created inartifacts/Temp/) from triggering bootstrap builds, which was causing resource conflicts and build failures during test execution.Skip conditions now include:
Configuration=Proto(we ARE the bootstrap)BUILDING_USING_DOTNET=true(FCS solution uses SDK compiler)DisableCompilerRedirection=true(user wants SDK compiler)MSBuildProjectDirectoryunderartifacts/(test/temp projects, build outputs)Validation:
✅ Bootstrap auto-execution for source projects
✅ Bootstrap skip for subsequent builds
✅ FSharp.Compiler.Service.sln uses SDK (no bootstrap)
✅ Error handling with proper MSBuild errors
✅ Script compatibility maintained
✅ Test projects skip bootstrap (no conflicts)
Original prompt
Summary
Move bootstrap logic into MSBuild targets so that
dotnet build FSharp.slnworks without scripts, bootstrap runs automatically when needed, bootstrap output is minimal on success, and bootstrap errors surface as proper MSBuild errors.Goals
dotnet build FSharp.slnworks without scriptsdotnet test <project>works without scriptsFSharp.Compiler.Service.slnbehavior unchanged (uses SDK compiler, no bootstrap)Changes Required
1. Create
eng/targets/Bootstrap.targets(New File)Create a new MSBuild targets file (~50-80 lines) with the following structure:
Properties to define:
BootstrapDir=$(ArtifactsDir)Bootstrap\FsLexBootstrapPath=$(BootstrapDir)fslex\fslex.dllFsYaccBootstrapPath=$(BootstrapDir)fsyacc\fsyacc.dllFscBootstrapPath=$(BootstrapDir)fsc\fsc.dll_SkipBootstrap=truewhen any of:$(Configuration)==Proto$(DisableCompilerRedirection)==true$(BUILDING_USING_DOTNET)==trueTarget:
_CheckBootstrapNeededBeforeTargets="Restore;Build"'$(_SkipBootstrap)' != 'true'_BootstrapNeeded=trueif any ofFsLexBootstrapPath,FsYaccBootstrapPath,FscBootstrapPathdo not exist_RunBootstrapif_BootstrapNeeded=trueTarget:
_RunBootstrap<Message Text="Building bootstrap compiler..." Importance="high" />dotnet publish "$(RepoRoot)proto.proj" -c Proto -v:minimal /clp:NoSummary;ErrorsOnly<Error Text="Bootstrap build failed. Check output above." /><Message Text="Bootstrap complete." Importance="high" />Target:
RebuildBootstrap$(BootstrapDir)_RunBootstrap2. Modify
Directory.Build.targetsAdd one import line (before other imports):
3. Modify
proto.projAdd default verbosity and telemetry properties for proper AzDO error categorization:
4. Simplify
.github/workflows/copilot-setup-steps.ymlReplace current setup steps with:
Note:
|| trueis intentional—setup must succeed so the agent can start. Errors surface when the agent builds.5. Simplify
.github/copilot-instructions.mdReplace Section 1 (Core Command) and Section 2 (Bootstrap) with:
## 1. Builddotnet build FSharp.sln -c Release
dotnet test tests/FSharp.Compiler.ComponentTests -c Release
dotnet test tests/FSharp.Compiler.Service.Tests -c Release
Remove all bootstrap detection logic from Section 2 (the "Two-phase build" and "Error building tools" detection instructions).
Edge Cases to Handle
FSharp.Compiler.Service.slnBUILDING_USING_DOTNET=trueauto-set by existing props →_SkipBootstrap=true→ no bootstrap, uses SDK compiler. Unchanged behavior.Configuration=Proto_SkipBootstrap=true→ no bootstrap (we ARE the bootstrap). Unchanged behavior.DisableCompilerRedirection=true_SkipBootstrap=true→ no bootstrap, uses SDK compiler. Unchanged behavior._CheckBootstrapNeededseesfsc.dllexists → skips_RunBootstrap. Idempotent.build.sh) usedBootstrap.targetssees artifacts exist → skips. Both paths converge.<Error>task fires → MSBuild stops → CI shows red error annotation. No cryptic downstream errors.dotnet build /t:RebuildBootstrapor deletesartifacts/Bootstrap/.Validation
artifacts/Bootstrap/folderdotnet build FSharp.sln -c Releasedotnet build FSharp.sln -c Releaseagaindotnet build FSharp.Compiler.Service.slnproto.proj(e.g., invalid syntax)dotnet build FSharp.sln -c ReleaseThis pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.