Skip to content

Isolate platform mocks in compiler-path tests from pathlib on Windows #684

Closed

Description

@LunaStev

Observed CI failure

The native Windows ARM64 job fails in Check native Windows process supervision, before later unit/frontend, artifact-publication and executor checks run:

ERROR: test_validate_compiler_checks_launchable_on_posix
  tools/test_check_case_sources.py:141
    checker.validate_compiler(fake_wavec)
  tools/check_case_sources.py:43
    raw = Path(raw_str)
NotImplementedError: cannot instantiate 'PosixPath' on your system
Ran 28 tests ... FAILED (errors=1)

Host: native Windows ARM64, Python 3.11.9. These tests do not require compiling Wave.

Cause and reproduction

The test patches checker.os.name to posix. This mutates the shared os module, including the platform value observed by pathlib.Path. The path created before the patch is converted to a string and reconstructed inside validate_compiler, selecting an unsupported concrete path class before the intended launchability check is reached.

Run on native Windows with the CI Python version:

python -m unittest tools.test_check_case_sources.SourceCheckTests.test_validate_compiler_checks_launchable_on_posix

The adjacent Windows-policy test also patches shared os.name; inspect both directions so a fix does not merely move the incompatibility to POSIX hosts or another supported Python version.

Scope and acceptance

Difficulty: easy; suitable for a first contribution. Isolate the platform-policy dependency used by the checker/test instead of changing the platform seen by unrelated standard-library modules. A module-local fake or a narrowly scoped policy helper is sufficient; no compiler/platform redesign is needed.

  • Both POSIX and Windows launchability-policy tests reach their intended PermissionError assertions on Windows and POSIX hosts.
  • Keep real native filesystem paths for existence/regular-file checks; do not replace the production path validation with a success stub.
  • Preserve early rejection, structured report behavior, and the assertion that no source-check subprocess runs for an unusable compiler.
  • Run python -m unittest tools.test_check_case_sources on native Windows ARM64 and a POSIX host, including the Python versions configured in CI.
  • Do not disable the test, mark it expected-failure, or remove the process-supervision gate.

Follow-up to #655/#666's early compiler validation. This is independent of the MSVC frontend target-selection failure #669 and the earlier native I/O failure #635.

Activity

  1. added
    bug
    good first issue
    cross-platform
    ci
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcicross-platformgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions