Skip to content

ci: experimental MSYS2/MinGW test run#1122

Merged
henryiii merged 5 commits into
wntrblm:mainfrom
henryiii:ci-msys2
Jun 29, 2026
Merged

ci: experimental MSYS2/MinGW test run#1122
henryiii merged 5 commits into
wntrblm:mainfrom
henryiii:ci-msys2

Conversation

@henryiii

@henryiii henryiii commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Adding MSYS2 to help us with #1117.

🤖 AI text below 🤖

What

Adds an experimental, non-blocking (continue-on-error: true) CI job that runs the test suite under a real MSYS2 / MINGW64 Python, plus the test/noxfile changes needed for the non-uv MinGW paths to pass.

This PR is independent of #1117 (no shared commits; either can merge first).

Why

nox/virtualenv.py has MinGW-specific logic gated on _IS_MINGW that, until now, was only covered by mocked unit tests (@mock.patch("nox.virtualenv._IS_MINGW", new=True)) — nothing ever ran it with _IS_MINGW actually True. This job exercises those paths on a genuine MSYS2 runner and feeds coverage into the cover job.

What's included

  • CI job (msys2): MSYS2/MINGW64, virtualenv backend (forced, so the interpreter under test stays MinGW), uv from astral-sh/setup-uv with path-type: inherit (no uv CLI exists in MSYS2 repos — the msys uv package only ships the uv_build backend), mingw-w64-x86_64-gcc for native build deps. Python version is whatever MSYS2 ships (detected at runtime).
  • noxfile: skips installing uv into the test session on MinGW (no wheel; the uv tests @has_uv-skip when absent).
  • Test corrections for the native MinGW venv layout — these fix behavior that predates fix: support uv venv backend under MSYS2/MinGW (#1088) #1117 (the bin/ layout from correct virtualenv bin dir under mingw python #901, not the uv backend):
    • test_bin_paths / test_create — gate the Scripts/-layout assertions on not IS_MINGW; test_create gains a MinGW branch (POSIX bin/ dir holding .exe executables — python.exe/pip.exe, lowercase lib).
    • test_bin_windows — pins _IS_MINGW=False so the Windows case is unaffected by the live MinGW host.
    • All are no-ops off MinGW.

Remaining red is #1117's, by design

With this PR's corrections in place, the only remaining msys2 failures are the uv-backend tests, which fail with uv venv -p .../bin/python.EXE → Failed to inspect Python interpreter — i.e. the #1088 bug that #1117 fixes (test_uv_creation, test_create_reuse_uv_environment, test_stale_environment[uv-virtualenv-False], and the three test_noxfile_script_mode*). The job is continue-on-error, so the overall run is green; once #1117 lands it is fully green too (726 passed, 15 skipped, 100% coverage gate intact).

Caveats

henryiii added 2 commits June 27, 2026 03:52
uv ships no MinGW wheel and fails to build from source there; the uv tests
already skip via @has_uv when the command is absent.

Assisted-by: ClaudeCode:claude-opus-4.8
Runs the suite under a real MSYS2/MINGW64 Python to exercise the
nox.virtualenv._IS_MINGW code paths, previously only covered by mocked unit
tests. Non-blocking (continue-on-error) until proven stable; feeds coverage
into the cover job. uv comes from setup-uv (no uv CLI exists in MSYS2 repos),
and the session is forced onto the virtualenv backend so the interpreter
under test stays MinGW.

Assisted-by: ClaudeCode:claude-opus-4.8
henryiii added 3 commits June 29, 2026 11:31
On a real MSYS2/MinGW host sys.platform is win32 but the native venv uses a
POSIX bin/ layout (with .exe executables), so the Windows-layout assertions
must exclude MinGW. Exercised by the experimental MSYS2 CI job.

Assisted-by: ClaudeCode:claude-opus-4.8
uv can't inspect the MinGW interpreter, so creating a uv venv from it fails
(wntrblm#1088). Mark the affected uv/script-mode tests xfail on MinGW (non-strict, so
they xpass once wntrblm#1117 lands) to keep the experimental MSYS2 job green.

Assisted-by: ClaudeCode:claude-opus-4.8
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii henryiii marked this pull request as ready for review June 29, 2026 18:01
@henryiii henryiii merged commit 9b747ed into wntrblm:main Jun 29, 2026
19 checks passed
@henryiii henryiii deleted the ci-msys2 branch June 29, 2026 19:29
Comment thread .github/workflows/ci.yml
include-hidden-files: true
if-no-files-found: error

# No uv CLI exists in any MSYS2 repo (the msys `uv` package only ships the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

but what about https://packages.msys2.org/base/mingw-w64-uv? it may be broken a bit (msys2/MINGW-packages#21091), but it exists

Comment thread .github/workflows/ci.yml
persist-credentials: false
- uses: msys2/setup-msys2@v2.32.0
with:
msystem: MINGW64

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

we recommend using UCRT64 environment, because MINGW64 is about to be deprecated

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! I'll try to make a follow up soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants