Repository navigation
Conversation
test_build_llvm_mc_batch invokes check-console.cmd as a bare name with cwd set, so cmd finds it only by searching the current directory. With NoDefaultCurrentDirectoryInExePath set, which some shells and hardened environments export, both subtests fail with "'check-console.cmd' is not recognized as an internal or external command" — nothing to do with the exit status and console code page they test. Pass the file's path, and let the generated script reach _build.cmd through %~dp0 for the same reason.
Kam471
left a comment
There was a problem hiding this comment.
Ran this at 8932390b on Windows 11: python -I tests/test_build_llvm_mc_batch.py -> 1 test, OK; git diff --check clean.
The test's check-console.cmd now calls "%~dp0_build.cmd" and is invoked by its absolute path, so it no longer depends on the current directory being searched for a bare batch name. That is the safer form and matches how the generated build scripts are meant to be called. No blocking issue.
sds-228
left a comment
There was a problem hiding this comment.
Code review of 8932390: no issues found. The generated batch script is invoked by absolute path and reaches its child through its own directory. Targeted suite: 1 test OK; compileall and diff check clean.
AI-assisted (OpenCode).
|
Tested 8932390 on Windows 11 Home 10.0.26200 (Python 3.13.14; CPU only, no GPU involved): pass.
#3380 changes the same lines for the same failure and also passes here ( No game files. AI-assisted (Claude Code). |
Claimed in the coordination issue as this item.
What and why
tests/test_build_llvm_mc_batch.pywritescheck-console.cmdand runs it ascmd.exe /d /c check-console.cmdwithcwdset to the temp folder. cmd resolves that name only by searching the current directory, so whereverNoDefaultCurrentDirectoryInExePathis set — it is1in this environment, andcmd /c echo %NoDefaultCurrentDirectoryInExePath%shows the value reaching the child — both subtests die with:That says nothing about what the test checks (the batch writer
build_llvm_mc.ps1keeps the caller's exit status and console code page through the bat). The generated script has the same weakness one level down: it calls_build.cmdby bare name.The change passes the file's path to the outer
subprocess.run, and has the generated script reach_build.cmdthrough%~dp0, so both levels work in a shell that does not search the current directory. Nothing else changes:cwdstays set, so thecd /dline the writer emits is still exercised, and the assertions on the written batch are untouched.Tested
Windows 11 26200, Python 3.14.6, CPU only; no GPU, no game files.
py -3 -m pytest tests/test_build_llvm_mc_batch.py -qonmainaa2988cc, variable set as here2 failed, 1 passed—SUBFAILED(exit_code=0)andSUBFAILED(exit_code=17), both with the message above1 passed, 2 subtests passedNoDefaultCurrentDirectoryInExePathunset, onmainand on this branch1 passed, 2 subtests passedboth timespy -3 -m pytest tests --ignore=tests/semantic -qonaa2988cc6 failed, 6465 passed, 97 skipped, 7640 subtests passedpy -3 -m unittest discover -s tests/semantic -qonaa2988ccRan 7456 tests,FAILED (failures=7, errors=2, skipped=1, expected failures=1)py -3 -m compileall -q make_game.py tools testsnode --test tests/test_viewer_streaming.cjsThe other five failures in the
pytestrun are separate items that already have open PRs, and this change touches none of them:test_check_no_game_data.py::test_default_mode_reads_tracked_files_only(PermissionErrorunlinking a read-only git object during teardown, #3897),test_saves.py::AtomicPackTest::test_destination_symlinks_update_the_target_and_remain_links(the link reads back with a\?\prefix, #3983), andtest_u16_high_half.py::test_d16_buffer_store_no_redundant_extract_after_shr16(#3902). Thetests/semanticfailures are the three red files every translator PR shows:test_cmp_class_f64(2, #3948/#3885),test_mutations(2, #3883),test_loop_ballot_barrier(3 failures + 2 errors, #3995).Checklist
docs/design.mdis unchanged.Depends on: nothing.