Skip to content

ci: Port the w32-pthreads Digital Mars build helper to Python (#962) - #2613

Merged
zackees merged 2 commits into
masterfrom
infra/962-gen-005-w32-pthreads-builddmc-python
Oct 27, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/962-gen-005-w32-pthreads-builddmc-python

Conversation

@zackees

@zackees zackees commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Ports deps/w32-pthreads/builddmc.bat (9 lines) to deps/w32-pthreads/builddmc.py and removes its GEN-005 exception from ci.toml. Part of the #962 ci-lint burn-down.

What the script is

The vendored w32-pthreads helper that builds the library with the Digital Mars Compiler. It has no caller: the library's ChangeLog (its only reference) calls it "Windows bat file to build the library". Nothing else in the tree runs it, so no consumer changes.

RED → GREEN

  • RED 3e35a9250 — ci/test_w32_pthreads_builddmc.py pins the module (the two dmc command lines, token for token) and the wiring (.bat gone, exception gone). Fails: the module does not exist, the .bat is still present, the exception is still in ci.toml.
  • GREEN 23ea7bca1 — the port, the .bat deleted, the ci.toml exception removed. deps/w32-pthreads/builddmc.py runs the same two command lines, release then debug, from the same constants; -g is the debug build's only addition.

Behaviour kept: the batch file checked nothing between the two builds and leaves %errorlevel% at the last command's status, so main() returns the debug command's exit status.

Rebase

Rebased onto origin/master (7f4109378) after a sibling port merged. The only conflict was ci.toml (adjacent [[exceptions]] blocks); resolved as master's list minus this unit's block, so git diff origin/master -- ci.toml shows only the deps/w32-pthreads/builddmc.bat block gone. The SHAs above are the rebased ones.

Evidence

uvx --from git+https://github.com/zackees/ci.yml@a1917ce76598904ce515cd7eec83450c317ea6f2 ci-lint precheck — deps/w32-pthreads/builddmc.bat no longer appears in the GEN-005 list, and the new .py is clean.

Local (on the rebased tip): uv run python -m unittest ci.test_w32_pthreads_builddmc ci.test_ci_toml ci.test_no_sys_path_edits ci.test_uv_run ci.test_tool_guard ci.test_ci_tests_stdlib_only (56 tests) and ruff check on both new files — all pass.

Refs #962.

@zackees
zackees marked this pull request as ready for review October 27, 2026 11:37
@zackees
zackees enabled auto-merge October 27, 2026 11:37

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review: correct, and the test is the right kind for a file with no caller.

What I checked.

  • The port is token-for-token: RELEASE/DEBUG in ci/test_w32_pthreads_builddmc.py match builddmc.bat's two dmc lines exactly, including -I.;c:\dm\include and the user32.lib+kernel32.lib+wsock32.lib link list. Nothing is silently dropped.
  • The %errorlevel% behaviour is preserved and pinned: the batch left the last command's status, so returning the debug command's exit code (test_main_reports_the_last_command_status, return 7) is right, and it is tested rather than asserted in prose.
  • Wiring is complete in one PR: the .bat is deleted, ci.toml loses its GEN-005 exception, and WiringTest fails if either comes back. git grep builddmc.bat returns no caller, which matches the issue's claim that the ChangeLog is its only reference.
  • No docs/features.md line: vendored build helper, not user-visible.

Verified: uv run python -m unittest ci.test_w32_pthreads_builddmc ci.test_ci_toml ci.test_ported_sources ci.test_uv_run → 31 tests OK; ruff check clean on both new files.

One note for the burn-down, not a blocker: builddmc.py keeps the hard-coded c:\dm\bin\dmc. That is what the batch did, so this PR is faithful — but it is also why the file can never run in CI. If a later unit wants to actually exercise it, the tool path needs an argument or an env var; that would be a behaviour change and belongs in its own issue, not here.

Queuing once its checks are green.

@zackees
zackees force-pushed the infra/962-gen-005-w32-pthreads-builddmc-python branch from 8d85e97 to 23ea7bc Compare October 27, 2026 12:01
)

The RED commit: ci/test_w32_pthreads_builddmc.py pins
deps/w32-pthreads/builddmc.py (the two dmc command lines) and fails because
the module and its wiring do not exist yet.
…on (#962)

GREEN: deps/w32-pthreads/builddmc.py replaces builddmc.bat, and its GEN-005
exception leaves ci.toml. The helper runs the same two dmc command lines,
release then debug, token for token. It has no caller.
@zackees
zackees force-pushed the infra/962-gen-005-w32-pthreads-builddmc-python branch from 23ea7bc to 6e93325 Compare October 27, 2026 12:10
@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Rebased onto origin/master (which now carries #2606 and #2615) and force-pushed. The only conflict was the usual one hunk in ci.toml (every GEN-005 port deletes an adjacent [[exceptions]] block); resolved as master's list minus my block — git diff origin/master -- ci.toml shows only the six lines for deps/w32-pthreads/builddmc.bat gone. Because the rebase rewrote the commits, the RED/GREEN SHAs in the description are stale; they are now RED 0c3b8a2a6... (see the two-commit range below) — re-checked locally: ci/test_w32_pthreads_builddmc.py, ci.test_ci_toml, ci.test_uv_run, ci.test_tool_guard, ci.test_ci_tests_stdlib_only, ci.test_no_sys_path_edits (56 tests) all pass, ruff check clean on both new files.

@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Correction to the SHA I quoted above (I mistyped it): the rebased commits are RED ddbeaa405 (the failing test) and GREEN 6e9332573 (the port, the .bat deleted, the ci.toml exception removed). mergeStateStatus is now BLOCKED rather than DIRTY, i.e. the conflict is gone and only CI remains.

@zackees
zackees added this pull request to the merge queue Oct 27, 2026
Merged via the queue into master with commit 2d68bf5 Oct 27, 2026
31 checks passed
@zackees
zackees deleted the infra/962-gen-005-w32-pthreads-builddmc-python branch October 27, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant