fix(tests): set the upload cache test's environment with _putenv_s on Windows #19899

Merged
Sankalp7317 merged 1 commit from upstream-pr/19899 into main 2026-11-25 15:26:42 +00:00
Sankalp7317 commented 2026-11-14 07:16:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Sankalp7317 on 2026-11-14T07:16:52Z.


What

UploadCacheReadOnlyFlush.cpp calls setenv, which MinGW does not declare, so the Windows build of main stops at agc_driver_upload_cache_read_only_flush_tests ('setenv' was not declared in this scope). The test now sets APS5_NO_LEASE_MIRROR with _putenv_s on Windows and keeps setenv elsewhere, as AddressPasses.cpp already does. No library code changes.

Tested

Windows 11, WinLibs GCC 15.2.0, NVIDIA GeForce RTX 3050 (driver 610.88), Khronos validation layer 1.4.363.1. The full build now completes. ctest --test-dir build -R "^agc_driver_upload_cache_read_only_flush$" -V with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer passes in 4 of 4 runs; each log shows Insert instance layer "VK_LAYER_KHRONOS_validation", none contains was not found but was requested by env var VK_INSTANCE_LAYERS, and none contains a VUID-, UNASSIGNED- or SYNC-HAZARD message. There is no main log to compare: on Windows main does not compile this test, which is what this PR fixes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • 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: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3050, driver 610.88, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5308605388 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19899). Originally posted by [Sankalp7317](https://github.com/Sankalp7317) on 2026-11-14T07:16:52Z. --- ### What `UploadCacheReadOnlyFlush.cpp` calls `setenv`, which MinGW does not declare, so the Windows build of `main` stops at `agc_driver_upload_cache_read_only_flush_tests` (`'setenv' was not declared in this scope`). The test now sets `APS5_NO_LEASE_MIRROR` with `_putenv_s` on Windows and keeps `setenv` elsewhere, as `AddressPasses.cpp` already does. No library code changes. ### Tested Windows 11, WinLibs GCC 15.2.0, NVIDIA GeForce RTX 3050 (driver 610.88), Khronos validation layer 1.4.363.1. The full build now completes. `ctest --test-dir build -R "^agc_driver_upload_cache_read_only_flush$" -V` with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `VK_LOADER_DEBUG=layer` passes in 4 of 4 runs; each log shows `Insert instance layer "VK_LAYER_KHRONOS_validation"`, none contains `was not found but was requested by env var VK_INSTANCE_LAYERS`, and none contains a `VUID-`, `UNASSIGNED-` or `SYNC-HAZARD` message. There is no `main` log to compare: on Windows `main` does not compile this test, which is what this PR fixes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [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: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3050, driver 610.88, Windows 11 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-21 10:01:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T10:01:12Z.

Review: APPROVED


Reviewed — looks good

The change uses the platform-specific environment setter already present in a neighboring execution test; source review is complete, but no build or test was run here.

What I ran

Reviewed head 4d4484d456456dfe044c4edf9eeae40356147bff. Read description.md, commits.md, manifest.json, diff.patch, and the full changed UploadCacheReadOnlyFlush.cpp; also read the corresponding platform conditional in AddressPasses.cpp. No commands or tests were run.

Results

Check Result Note
Source review passed Changed file and analogous setter read
Build and tests not run No local execution

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author reports a Windows build and four passing test runs; these were not independently verified. files.json was not available through the reader, so its exclusions were not confirmed. No other files were excluded according to the manifest, whose sole changed file was read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6004511158 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19899#pullrequestreview-6004511158). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T10:01:12Z. **Review:** APPROVED --- # Reviewed — looks good The change uses the platform-specific environment setter already present in a neighboring execution test; source review is complete, but no build or test was run here. ## What I ran Reviewed head `4d4484d456456dfe044c4edf9eeae40356147bff`. Read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, and the full changed `UploadCacheReadOnlyFlush.cpp`; also read the corresponding platform conditional in `AddressPasses.cpp`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Changed file and analogous setter read | | Build and tests | not run | No local execution | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The author reports a Windows build and four passing test runs; these were not independently verified. `files.json` was not available through the reader, so its exclusions were not confirmed. No other files were excluded according to the manifest, whose sole changed file was read. ## To get this to a good state Nothing is required.
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!19899
No description provided.