ci(windows): generate_win.bat — fail loudly when MSYS2 isn't installed#6082
Merged
ci(windows): generate_win.bat — fail loudly when MSYS2 isn't installed#6082
Conversation
Before: when `%MSYS2_DIR%` doesn't exist, the script printed an error message and then exited 0, so callers (CI workflows, devs) thought binding generation succeeded with no output. After: print the error and `exit /b 1`. De-nest the success path so the success branch is the script's normal flow rather than the `else` branch of the missing-MSYS2 check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/mrbind/generate_win.batexits 0 when%MSYS2_DIR%doesn't exist — it prints an error to stdout but the implicit return code is success, so callers (CI workflows, local devs) think binding generation completed with no output and move on. The bug only surfaces when something goes wrong with MSYS2 setup; in normal operation the directory exists and the script proceeds correctly.Fix: explicitly
exit /b 1after the error message, and de-nest the success path so the normal flow is the script's straight-line body rather than theelsebranch of the missing-MSYS2 check.Test plan
MSYS2_DIRis set to a missing directory, the script prints the error and exits with code 1 (verified locally).MSYS2_DIRexists, the script runsmsys2_shell.cmd … make …exactly as before — no behavior change in the happy path.Notes
Extracted from PR #6060.