Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 9, 2026

The proto build step (bootstrap compiler tools) could fail without stopping execution, causing the main build to continue with broken dependencies and produce misleading errors downstream.

Root Cause

Line 312 in eng/build.sh had error handling commented out:

"$DOTNET_INSTALL_DIR/dotnet" "${args[@]}"  #$args || exit $?

In bash, # starts a comment, so || exit $? was ignored.

Changes

  • Removed #$args comment to enable error handling:

    "$DOTNET_INSTALL_DIR/dotnet" "${args[@]}" || exit $?
  • Matches error handling pattern used elsewhere in the script (e.g., line 248 in Test function)

  • Allows TrapAndReportError to properly catch and report proto build failures with "Error building tools" message

Impact

Proto build failures now halt execution immediately with clear error messages instead of cascading into confusing main build errors.

Original prompt

This section details on the original issue you should resolve

<issue_title>FSharp build shouldn't run when the proto pre-build step fails</issue_title>
<issue_description>Probably due to this line?

"$DOTNET_INSTALL_DIR/dotnet" "${args[@]}" #$args || exit $?
</issue_description>

Comments on the Issue (you are @copilot in this section)

@ViktorHofer From a GH Copilot chat session:

Yes, you are correct. In the line:

"$DOTNET_INSTALL_DIR/dotnet" "${args[@]}" #$args || exit $?

everything after the # symbol is treated as a comment in shell scripts. That means #$args || exit $? is ignored by the shell and does not affect execution.

Only this part is executed:

"$DOTNET_INSTALL_DIR/dotnet" "${args[@]}"

So, the script will not abort automatically if the command fails, because the error-handling logic (|| exit $?) is commented out. If you want the script to abort on failure, you should remove the #</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

✅ No release notes required

Remove commented-out error handling code so that the build properly exits
when the proto build step fails. Previously, the error handling was commented
out (everything after # was ignored), causing the build to continue even when
the bootstrap tools failed to build.

Fixes the issue where FSharp build would continue running when the proto
pre-build step fails, leading to confusing downstream errors instead of
clear proto build failures.

The fix changes line 312 from:
"$DOTNET_INSTALL_DIR/dotnet" "${args[@]}"  #$args || exit $?

To:
"$DOTNET_INSTALL_DIR/dotnet" "${args[@]}" || exit $?

This matches the error handling pattern used elsewhere in the script
(e.g., line 248 in the Test function).

Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix FSharp build not aborting on proto pre-build failure Fix proto build failures being silently ignored in build.sh Jan 9, 2026
Copilot AI requested a review from ViktorHofer January 9, 2026 11:35
@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Jan 9, 2026
@T-Gro T-Gro marked this pull request as ready for review January 9, 2026 11:44
@T-Gro T-Gro requested a review from a team as a code owner January 9, 2026 11:44
@T-Gro T-Gro enabled auto-merge (squash) January 9, 2026 11:45
@T-Gro T-Gro merged commit efa7c05 into main Jan 9, 2026
40 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in F# Compiler and Tooling Jan 9, 2026
@ViktorHofer ViktorHofer deleted the copilot/fix-fsharp-build-failures branch January 9, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

FSharp build shouldn't run when the proto pre-build step fails

3 participants