fix(tests): set upload cache environment on Windows #22634

Closed
paulk161 wants to merge 1 commit from upstream-pr/22634 into main
paulk161 commented 2026-11-17 23:40:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by paulk161 on 2026-11-17T23:40:57Z.


What

The UploadCacheReadOnlyFlush test enables APS5_NO_LEASE_MIRROR before creating its Vulkan test device.

It called the POSIX-only setenv unconditionally, so the test target did not compile with MSYS2 UCRT64 on Windows:

UploadCacheReadOnlyFlush.cpp:177:9: error: 'setenv' was not declared in this scope; did you mean 'getenv'?

Windows now uses _putenv_s, following the existing platform-specific environment-variable handling in other libSceAgcDriver tests. Non-Windows builds continue to use setenv.

Tested

Windows 11 (VirtualBox VM), MSYS2 UCRT64, GCC 16.2.0, Release, BUILD_TESTING=ON.

  • agc_driver_upload_cache_read_only_flush_tests: failed to compile before the change and now builds successfully.
  • agc_driver_upload_cache_read_only_flush: starts successfully and reports Skipped because the required runtime capability is unavailable in this environment.
  • Full cmake --build build-tests -j 3: passed with exit code 0.
  • git diff --check: passed.
  • tools/pr_overlap.py --branch: no overlap with 1,764 open pull requests.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5367013136 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22634). Originally posted by [paulk161](https://github.com/paulk161) on 2026-11-17T23:40:57Z. --- ### What The `UploadCacheReadOnlyFlush` test enables `APS5_NO_LEASE_MIRROR` before creating its Vulkan test device. It called the POSIX-only `setenv` unconditionally, so the test target did not compile with MSYS2 UCRT64 on Windows: UploadCacheReadOnlyFlush.cpp:177:9: error: 'setenv' was not declared in this scope; did you mean 'getenv'? Windows now uses `_putenv_s`, following the existing platform-specific environment-variable handling in other `libSceAgcDriver` tests. Non-Windows builds continue to use `setenv`. ### Tested Windows 11 (VirtualBox VM), MSYS2 UCRT64, GCC 16.2.0, Release, `BUILD_TESTING=ON`. - `agc_driver_upload_cache_read_only_flush_tests`: failed to compile before the change and now builds successfully. - `agc_driver_upload_cache_read_only_flush`: starts successfully and reports `Skipped` because the required runtime capability is unavailable in this environment. - Full `cmake --build build-tests -j 3`: passed with exit code 0. - `git diff --check`: passed. - `tools/pr_overlap.py --branch`: no overlap with 1,764 open pull requests. ### Checklist - [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 and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical 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: n/a - [x] AI-assisted: yes

Pull request closed

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!22634
No description provided.