build(tests): provide setenv for the AGC execution tests on Windows #22373

Merged
Ethan-Hainline merged 1 commit from upstream-pr/22373 into main 2026-11-19 09:20:10 +00:00
Ethan-Hainline commented 2026-11-17 13:17:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ethan-Hainline on 2026-11-17T13:17:27Z.


What

A full BUILD_TESTING=ON build on Windows stops on an unguarded POSIX setenv in an AGC execution test (#22358). That is not one file: 72 sources under tests/execution call setenv/unsetenv, but the CI Windows job builds ExecutionTestNotBuilt.cpp stubs for every test it does not select, so it never compiles most of them. The two open per-file fixes (#19899, #22366) make the reported file compile; the next full build would stop on the next source.

This adds a Windows-only test shim and force-includes it into every agc_driver_* execution test on MinGW:

  • tests/execution/TestEnvironment.hpp maps setenv(name, value, overwrite) to _putenv_s(name, value) and unsetenv(name) to _putenv_s(name, "").
  • The execution-test loop adds -include .../TestEnvironment.hpp for WIN32 with GCC.

The per-file _putenv_s changes remain correct and compatible; the shim simply makes the other 71 sources build too.

Tested

  • The exact compile command of UploadCacheReadOnlyFlush.cpp on main fails with 'setenv' was not declared in this scope; the same command with -include TestEnvironment.hpp produces the object (20,701 bytes).
  • Reconfigured the build tree and confirmed the generated compile command for agc_driver_upload_cache_read_only_flush_tests contains the forced include.
  • Building that target in this tree then stopped later in unrelated shader generation (Missing entry point), after the compile step this change covers.
  • python tools/check_conventions.py --base upstream/main --head HEAD passes.

Checklist

  • Based on current main; no other open PR implements the same change
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: #22358
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5357575563 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22373). Originally posted by [Ethan-Hainline](https://github.com/Ethan-Hainline) on 2026-11-17T13:17:27Z. --- ### What A full `BUILD_TESTING=ON` build on Windows stops on an unguarded POSIX `setenv` in an AGC execution test (#22358). That is not one file: **72** sources under `tests/execution` call `setenv`/`unsetenv`, but the CI Windows job builds `ExecutionTestNotBuilt.cpp` stubs for every test it does not select, so it never compiles most of them. The two open per-file fixes (#19899, #22366) make the reported file compile; the next full build would stop on the next source. This adds a Windows-only test shim and force-includes it into every `agc_driver_*` execution test on MinGW: - `tests/execution/TestEnvironment.hpp` maps `setenv(name, value, overwrite)` to `_putenv_s(name, value)` and `unsetenv(name)` to `_putenv_s(name, "")`. - The execution-test loop adds `-include .../TestEnvironment.hpp` for `WIN32` with GCC. The per-file `_putenv_s` changes remain correct and compatible; the shim simply makes the other 71 sources build too. ### Tested - The exact compile command of `UploadCacheReadOnlyFlush.cpp` on `main` fails with `'setenv' was not declared in this scope`; the same command with `-include TestEnvironment.hpp` produces the object (20,701 bytes). - Reconfigured the build tree and confirmed the generated compile command for `agc_driver_upload_cache_read_only_flush_tests` contains the forced include. - Building that target in this tree then stopped later in unrelated shader generation (`Missing entry point`), after the compile step this change covers. - `python tools/check_conventions.py --base upstream/main --head HEAD` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same change - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: #22358 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!22373
No description provided.