fix(tests): the write-back shadow remake check builds on Windows #2868

Closed
github-sync wants to merge 1 commit from github/pr/2868 into main
Owner

@mooki000 opened this pull request on GitHub · 2026-11-12 17:59 UTC · original

What this is for: tests/test_wb_shadow_remake.py (added by #2767) does not compile on Windows, so part 2/2 of the Windows Python source checks is red on main and on every pull request merged with it. What is measured: the same check on Windows, in the project's own workflow, before and after; Linux with two compilers. Not measured: nothing else changes, so nothing else was run.

Problem

The check's fixture reads the environment through gpu/vk/compat/hookshot_env.h and getenv. With MSVC's headers getenv is deprecated, and the check compiles with -Werror:

gpu/vk/compat/hookshot_env.h:53:21: error: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead.
3 errors generated.

Linux never showed it. Main's own runs have been cancelled by the next merge all day, so no completed run of main shows it either; I found it in the Windows log of a docs-only pull request (#2778).

What changed

One flag on the fixture's command line: -D_CRT_SECURE_NO_WARNINGS, which 34 other checks already pass. The fixture and its assertions are untouched.

How it was tested

  • Windows, the project's workflow, run on my fork before opening this: with the change tests/test_wb_shadow_remake.py passes (1.1 s) and Windows part 2/2 is green. Without it, the same job fails on this test alone: #2778's run.
  • Linux: the check passes with GCC 16.2 and with Clang 23.1, before and after (the flag does nothing there).
  • A Windows-target compile here (clang against MSVC-style headers, syntax only): fails with the three errors above without the flag, passes with it.

That fork run still shows red in three other jobs. Both failing tests there are main's own and have fixes open: test_program_cache_one_variant.py (#2861) and test_readme_menu_rows.py (#2857). With those two and this one, main's source checks are green again.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 [email protected]

> [@mooki000](https://github.com/mooki000) opened this pull request on GitHub · 2026-11-12 17:59 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2868) **What this is for:** `tests/test_wb_shadow_remake.py` (added by #2767) does not compile on Windows, so **part 2/2 of the Windows Python source checks is red on main and on every pull request merged with it.** **What is measured:** the same check on Windows, in the project's own workflow, before and after; Linux with two compilers. **Not measured:** nothing else changes, so nothing else was run. ## Problem The check's fixture reads the environment through `gpu/vk/compat/hookshot_env.h` and `getenv`. With MSVC's headers `getenv` is deprecated, and the check compiles with `-Werror`: ``` gpu/vk/compat/hookshot_env.h:53:21: error: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. 3 errors generated. ``` Linux never showed it. Main's own runs have been cancelled by the next merge all day, so no completed run of main shows it either; I found it in the Windows log of a docs-only pull request (#2778). ## What changed One flag on the fixture's command line: `-D_CRT_SECURE_NO_WARNINGS`, which 34 other checks already pass. The fixture and its assertions are untouched. ## How it was tested - **Windows, the project's workflow, run on my fork before opening this:** [with the change](https://github.com/mooki000/Hookshot/actions/runs/43272379933) `tests/test_wb_shadow_remake.py` passes (1.1 s) and Windows part 2/2 is green. Without it, the same job fails on this test alone: [#2778's run](https://github.com/NotRexed/Hookshot/actions/runs/43268522989/job/131358480726). - **Linux:** the check passes with GCC 16.2 and with Clang 23.1, before and after (the flag does nothing there). - **A Windows-target compile here** (clang against MSVC-style headers, syntax only): fails with the three errors above without the flag, passes with it. That fork run still shows red in three other jobs. Both failing tests there are main's own and have fixes open: `test_program_cache_one_variant.py` (#2861) and `test_readme_menu_rows.py` (#2857). With those two and this one, main's source checks are green again. Assisted-by: Claude Fable 5.2 Co-Authored-By: Claude Fable 5.2 <[email protected]> <!-- github-sync:item:2868 -->
tests/test_wb_shadow_remake.py (#2767) compiles a fixture that reads the
environment through gpu/vk/compat/hookshot_env.h and getenv. With MSVC's
headers getenv is deprecated, and under the check's -Werror that is an
error, so the Windows part 2/2 of the Python source checks has failed on
main since the merge (3 errors, all "'getenv' is deprecated"). Linux was
never affected.

Pass -D_CRT_SECURE_NO_WARNINGS on the fixture's command line, as 34 other
checks already do. Nothing else changes; the fixture and its assertions
are untouched.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-sync closed this pull request 2026-11-12 19:03:03 +00:00
Author
Owner

@mooki000 commented on GitHub · 2026-11-12 18:42 UTC · original

Closing: #2883 has merged the same one-flag fix for this test (-D_CRT_SECURE_NO_WARNINGS on the write-back shadow remake fixture), so main's Windows check is covered. Thanks @SadTransGirl.

> [@mooki000](https://github.com/mooki000) commented on GitHub · 2026-11-12 18:42 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2868#issuecomment-6832659912) Closing: #2883 has merged the same one-flag fix for this test (`-D_CRT_SECURE_NO_WARNINGS` on the write-back shadow remake fixture), so main's Windows check is covered. Thanks @SadTransGirl. <!-- github-sync:c:6832659912 -->
Commenting is not possible because the repository is archived.
No description provided.