Skip to content

Fix Windows check-build failure by broadening OSTYPE detection in test.sh - #295

Merged
martinpopel merged 3 commits into
masterfrom
copilot/fix-check-build-windows-job
Jul 17, 2026
Merged

martinpopel merged 3 commits into
masterfrom
copilot/fix-check-build-windows-job

Conversation

Copilot AI commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

The check-build GitHub Actions job on windows-latest with Python 3.12 failed because test.sh did not initialize CMD on Windows Git Bash. The script matched OSTYPE only when exactly msys, while runners report values like msys_nt-*.

  • Root cause

    • Windows branch in test.sh used an exact match:
      • [[ "$OSTYPE" == "msys" ]]
    • On Actions, this condition does not match, so CMD remains unset under set -u.
  • Change

    • Updated Windows OS detection to prefix match:
      • [[ "$OSTYPE" == "msys"* ]]
    • This ensures the Windows code path consistently sets PYTHON/CMD across Git Bash variants.
  • Patch excerpt

    -elif [[ "$OSTYPE" == "msys" ]]; then
    +elif [[ "$OSTYPE" == "msys"* ]]; then
       PYTHON="python"
       CMD="$PYTHON -m sacrebleu"

Copilot AI changed the title [WIP] Fix failing GitHub Actions job check-build (windows-latest, 3.12) Fix Windows check-build failure by broadening OSTYPE detection in test.sh Jul 14, 2026
Copilot AI requested a review from martinpopel July 14, 2026 16:34
Comment thread test.sh
# OS X ships python -> python2 by default, be explicit
PYTHON=python3
CMD="$PYTHON -m sacrebleu"
fi

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see, the previous version didn't match "msys" and there is no default case.

@martinpopel

Copy link
Copy Markdown
Collaborator

@copilot The tests are still failing. Let's set the default CMD and PYTHON and override it only for "$OSTYPE" == "darwin"*:

PYTHON="python"
CMD="$PYTHON -m sacrebleu"
if [[ "$OSTYPE" == "darwin"* ]]; then
  # OS X ships python -> python2 by default, be explicit
  PYTHON=python3
  CMD="$PYTHON -m sacrebleu"
fi

Copilot AI commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot The tests are still failing. Let's set the default CMD and PYTHON and override it only for "$OSTYPE" == "darwin"*:

PYTHON="python"

...

Implemented in commit f411782.
test.sh now sets default PYTHON/CMD first and overrides only for darwin*.

@martinpopel
martinpopel marked this pull request as ready for review July 17, 2026 06:34
@martinpopel
martinpopel merged commit 3a1fbb1 into master Jul 17, 2026
32 of 91 checks passed
@martinpopel
martinpopel deleted the copilot/fix-check-build-windows-job branch July 17, 2026 06:36

This branch was previously deployed

1 inactive deployment
release — f411782c Deployed Jul 14, 2026 by Copilot via Build and publish Python distributions to PyPI #37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants