Repository navigation
Closed
Labels
capability:platformFramework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)capability:reassessRe-run historical issues against current codeRe-run historical issues against current codefamily:ci.github workflows, prek, validators.github workflows, prek, validatorsfamily:setupsetup-* skillssetup-* skillsfamily:toolstools/*tools/*substrate:framework-devTool substrate: build / validate / eval the framework itselfTool substrate: build / validate / eval the framework itself
Description
What's broken
Commit d23116e2 (#1764) updated the workspace-pytest pre-commit hook to selectively test only changed workspace members by piping changed paths to tools/dev/ci-pytest-batches.py --changed-file /dev/stdin --paths.
On Windows (under Git Bash / MSYS2 with native Python), this breaks:
ci-pytest-batches.pyfails withFileNotFoundError: [Errno 2] No such file or directory: '\\proc\\self\\fd\\0'because/dev/stdinis a POSIX-only virtual path that native Windows Python cannot open with Win32 APIs, and--changed-file -is not supported.- In
ci-pytest-batches.py, path separators in--changed-fileare not normalized from\to/. Any Windows-style paths failc.startswith(prefixes), causingselect()to return[]and silently skip running tests for modified workspace packages. - In
run-workspace-check.sh, multi-line output from Windows Python contains CRLF (\r\n). In bash,applicable=$(...)retains\ron intermediate tokens (e.g.tools/agent-guard\r), causinguv run --directoryto fail withos error 123(syntax error in filename). test_a_change_behind_a_member_symlink_picks_the_memberintest_ci_pytest_batches.pyfails on Windows withWinError 1314(privilege not held) because it lackstry/except OSError: pytest.skip(...).
Which layer
tools/dev/ci-pytest-batches.pytools/dev/run-workspace-check.shtools/dev/tests/test_ci_pytest_batches.py
How to reproduce
On Windows, run the workspace check against a modified file:
tools/dev/run-workspace-check.sh pytest "pytest --version" tools/agent-guard/src/agent_guard/__init__.pyTraceback:
Traceback (most recent call last):
File "tools/dev/ci-pytest-batches.py", line 236, in <module>
raise SystemExit(main())
File "tools/dev/ci-pytest-batches.py", line 219, in main
for line in args.changed_file.read_text(encoding="utf-8").splitlines()
File "pathlib.py", line 1027, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
FileNotFoundError: [Errno 2] No such file or directory: '\\proc\\self\\fd\\0'
Additionally, running uv run --directory tools/dev --project . python -m pytest tests/test_ci_pytest_batches.py on Windows raises:
FAILED tests/test_ci_pytest_batches.py::test_a_change_behind_a_member_symlink_picks_the_member
OSError: [WinError 1314] A required privilege is not held by the client
Expected vs actual
- Expected:
run-workspace-check.shandci-pytest-batches.pyshould portably accept changed files throughstdin(via standard-) across Linux, macOS, and Windows without crashing, normalize backslashes so Windows path separators match package prefixes, strip\rin bash command substitution, and guard symlink tests against missing OS symlink privileges. - Actual: Crashes on Windows with
FileNotFoundError, silently bypasses tests when backslash paths are passed, breaks bash subshell tokenization with\r, and fails unit tests on unprivileged Windows runners.
Surface area (optional)
Local pre-commit run workspace-pytest, local commit git hooks on Windows, and tools/dev/ci-pytest-batches.py.
Environment (optional)
Windows 10/11, Git Bash / MSYS2, Python 3.12 (native Windows CPython).
Metadata
Metadata
Assignees
Labels
capability:platformFramework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)Framework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)capability:reassessRe-run historical issues against current codeRe-run historical issues against current codefamily:ci.github workflows, prek, validators.github workflows, prek, validatorsfamily:setupsetup-* skillssetup-* skillsfamily:toolstools/*tools/*substrate:framework-devTool substrate: build / validate / eval the framework itselfTool substrate: build / validate / eval the framework itself
Activity