-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add exit code check after bootstrap build in eng/build.ps1 #122665
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
Conversation
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
This change adds an exit code check immediately after the bootstrap build invocation to halt the build process if the bootstrap build fails. This prevents the script from continuing to cleanup and main build stages when the bootstrap has failed, providing clear and immediate feedback to developers. Fixes issue where bootstrap build failures were silently ignored and the script would continue with cleanup and main build, leading to confusing failures and wasted build time. Co-authored-by: ericstj <8918108+ericstj@users.noreply.github.com>
There was a problem hiding this 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 adds a critical exit code check after the bootstrap build in eng/build.ps1 to prevent the script from continuing with artifact cleanup and main build stages when the bootstrap build fails. Previously, bootstrap build failures were silently ignored, leading to confusing downstream errors and wasted build time.
Key Changes
- Added
$lastExitCodevalidation immediately after bootstrap build invocation (lines 401-404) - Ensures script halts with clear error message on bootstrap failure
- Aligns with existing error handling patterns used elsewhere in the same file
Description
Bootstrap build failures in
eng/build.ps1were silently ignored, allowing the script to proceed to artifact cleanup and main build stages. This caused confusing downstream failures and wasted build time.Added
$lastExitCodecheck after bootstrap build invocation (line 399) to halt immediately on failure:Pattern matches existing failure handling in the script (lines 196-199, 215-218, 420-426) and aligns with
build.shbehavior (set -ue).Customer Impact
Developers see clear, immediate failure messages instead of confusing errors from subsequent build stages attempting to use broken bootstrap artifacts.
Regression
No. This fixes a long-standing issue in the bootstrap build path.
Testing
build.ps1Risk
Low. Adds defensive check that only triggers on actual bootstrap failures. No changes to success paths or build logic.
Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.