Skip to content

ci(windows): generate_win.bat — fail loudly when MSYS2 isn't installed#6082

Merged
Fedr merged 1 commit intomasterfrom
ci/generate-win-fail-loud-on-missing-msys2
May 9, 2026
Merged

ci(windows): generate_win.bat — fail loudly when MSYS2 isn't installed#6082
Fedr merged 1 commit intomasterfrom
ci/generate-win-fail-loud-on-missing-msys2

Conversation

@Fedr
Copy link
Copy Markdown
Contributor

@Fedr Fedr commented May 9, 2026

Summary

scripts/mrbind/generate_win.bat exits 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 1 after the error message, and de-nest the success path so the normal flow is the script's straight-line body rather than the else branch of the missing-MSYS2 check.

Test plan

  • When MSYS2_DIR is set to a missing directory, the script prints the error and exits with code 1 (verified locally).
  • When MSYS2_DIR exists, the script runs msys2_shell.cmd … make … exactly as before — no behavior change in the happy path.
  • CI: Windows binding-generation matrix passes (no behavior change in normal builds).

Notes

Extracted from PR #6060.

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>
@Fedr Fedr merged commit 533df24 into master May 9, 2026
1 check passed
@Fedr Fedr deleted the ci/generate-win-fail-loud-on-missing-msys2 branch May 9, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant