Repository navigation
#802: fix p7 build-harness cwd, un-skip overflow_modes on Windows - #814
Merged
Merged
Conversation
ropoctl
force-pushed
the
windows-unskip-802
branch
from
August 17, 2026 16:38
8a6a378 to
bb21e9b
Compare
…ix (#800) The pre-D p7 build harness located the repo root with `env("PWD")` and built the child-compiler path without a `.exe` suffix. Both fail on native Windows: cmd.exe never sets PWD, a bash shell sets it to a POSIX `/d/...` path Win32 rejects, and every `file_exists` probe missed the real `with-stage2.exe`/`with.exe` so the harness fell through to a nonexistent candidate and silently failed to spawn the compiler. Resolve the working directory with `rt_getcwd` (a native path, correct on cmd.exe and under bash alike) and append `.exe` on Windows. On Linux/macOS getcwd equals the former PWD and the suffix is empty, so behavior is unchanged there.
…uster) p7_cwd returned with_str_from_cstr(&buf) over a local [4096]u8 stack buffer. with_str_from_cstr forwards to make_str, which wraps the pointer without copying, so the returned str aliases the stack frame that dies on return. p7_repo_root hands that dangling str to p7_join/p7_abs, which read its bytes to build case_dir, the compiler path, and the capture paths. On Linux/darwin the reused frame happened to still hold the path bytes at read time, so the tests passed. On Windows the native-bootstrapped stage2 lays the frame out differently and clobbers buf between return and read, corrupting case_dir into a path with an interior NUL. That path is then converted to a C string for a file/spawn API and panics 'str to C string conversion: interior NUL byte' -> abort -> exit 134 with empty (block-buffered) stdout, the whole p7 cluster's signature. Copy the string off the stack with .to_owned() while buf is still alive.
…s fixed (#802) behav_project_overflow_modes drives a child `with build` through the p7 pre_d_build_runner harness. With the rt_getcwd/.exe-suffix and p7_cwd dangling-str fixes in place, the [build] overflow=wrap/saturate case evaluates correctly on native Windows, so the #802 skip no longer applies. The remaining #802 skips (behav_build_w_basic_invocation, behav_cli_test_command_args) stay gated — those p7 build/test child spawns still fail on Windows even with the cwd fix; tracked in #72.
ropoctl
force-pushed
the
windows-unskip-802
branch
from
August 17, 2026 18:54
bb21e9b to
61c1778
Compare
This was referenced Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bottom of the Windows un-skip stack (base
main).Fixes the p7 build-harness so a child
with buildinvoked throughtest/behavior/lib/pre_d_build_runner.wresolves its working directorycorrectly on native Windows:
rt_getcwdand append the.exesuffix tothe spawned compiler path (Windows has no implicit executable resolution)
p7_cwdreturning astrover a freed stack buffer (the exit-134interior-NUL cluster) by taking ownership of the path bytes
With the harness correct, un-skips
behav_project_overflow_modes(its[build] overflow=wrap/saturatecase now evaluates correctly on Windows).The other two #802 tests —
behav_build_w_basic_invocationandbehav_cli_test_command_args— stay skipped: their build/test child spawnstill fails on Windows even with the cwd fix (tracked in #72).