build(windows): UploadCacheReadOnlyFlush.cpp fails to compile due to POSIX setenv #22358

Closed
opened 2026-11-17 12:47:23 +00:00 by Rony1611 · 0 comments
Rony1611 commented 2026-11-17 12:47:23 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Rony1611 on 2026-11-17T12:47:23Z.


What happens

Building with -DBUILD_TESTING=ON on Windows fails in core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp with error: 'setenv' was not declared in this scope; did you mean 'getenv'?.

Title, test or build step

cmake --build build --parallel (target: agc_driver_upload_cache_read_only_flush_tests)

AnyPS5 commit

e369d932fd

System

  • OS: Windows 11 Home Single Language (Build 26300) - CPU: Intel Core i7-14700HX - GPU: NVIDIA GeForce RTX 5050 Laptop GPU (8GB) - GPU Driver: 621.01 - Compiler: WinLibs MinGW-w64 GCC 16.2.0 (x86_64-ucrt-posix-seh)

Host report

Not applicable — build fails at compile time before any executable or test binary is produced.

Steps to reproduce

  1. Configure the full Windows build with testing enabled (default environment variables):
    cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON

  2. Compile the build:
    cmake --build build --parallel

  3. Compilation stops in under 1 minute (around step 1331/6711) on UploadCacheReadOnlyFlush.cpp with 'setenv' was not declared in this scope.

Log

[1331/6711] Building CXX object core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_upload_cache_read_only_flush_tests.dir/tests/execution/UploadCacheReadOnlyFlush.cpp.obj
FAILED: [code=1] core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_upload_cache_read_only_flush_tests.dir/tests/execution/UploadCacheReadOnlyFlush.cpp.obj
core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp: In function 'int main()':
core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp:177:9: error: 'setenv' was not declared in this scope; did you mean 'getenv'?
  177 |         setenv("APS5_NO_LEASE_MIRROR", "1", 1);
      |         ^~~~~~
      |         getenv
ninja: build stopped: subcommand failed.

What was checked

  • Reproduced consistently across multiple cmake --build build runs (both parallel and single-threaded).
  • Verified locally that replacing setenv("APS5_NO_LEASE_MIRROR", "1", 1); with _putenv_s("APS5_NO_LEASE_MIRROR", "1"); under #ifdef _WIN32 in core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp allows the target to compile cleanly on Windows.
  • Tested only on this Windows 11 machine and commit; no other devices or commits were tried.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6444868709 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/22358). Originally posted by [Rony1611](https://github.com/Rony1611) on 2026-11-17T12:47:23Z. --- ### What happens Building with `-DBUILD_TESTING=ON` on Windows fails in `core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp` with `error: 'setenv' was not declared in this scope; did you mean 'getenv'?`. ### Title, test or build step cmake --build build --parallel (target: agc_driver_upload_cache_read_only_flush_tests) ### AnyPS5 commit e369d932fd ### System - OS: Windows 11 Home Single Language (Build 26300) - CPU: Intel Core i7-14700HX - GPU: NVIDIA GeForce RTX 5050 Laptop GPU (8GB) - GPU Driver: 621.01 - Compiler: WinLibs MinGW-w64 GCC 16.2.0 (x86_64-ucrt-posix-seh) ### Host report ```text Not applicable — build fails at compile time before any executable or test binary is produced. ``` ### Steps to reproduce 1. Configure the full Windows build with testing enabled (default environment variables): cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON 2. Compile the build: cmake --build build --parallel 3. Compilation stops in under 1 minute (around step 1331/6711) on `UploadCacheReadOnlyFlush.cpp` with `'setenv' was not declared in this scope`. ### Log ```text [1331/6711] Building CXX object core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_upload_cache_read_only_flush_tests.dir/tests/execution/UploadCacheReadOnlyFlush.cpp.obj FAILED: [code=1] core/libs/prx/libSceAgcDriver/CMakeFiles/agc_driver_upload_cache_read_only_flush_tests.dir/tests/execution/UploadCacheReadOnlyFlush.cpp.obj core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp: In function 'int main()': core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp:177:9: error: 'setenv' was not declared in this scope; did you mean 'getenv'? 177 | setenv("APS5_NO_LEASE_MIRROR", "1", 1); | ^~~~~~ | getenv ninja: build stopped: subcommand failed. ``` ### What was checked - Reproduced consistently across multiple `cmake --build build` runs (both parallel and single-threaded). - Verified locally that replacing `setenv("APS5_NO_LEASE_MIRROR", "1", 1);` with `_putenv_s("APS5_NO_LEASE_MIRROR", "1");` under `#ifdef _WIN32` in `core/libs/prx/libSceAgcDriver/tests/execution/UploadCacheReadOnlyFlush.cpp` allows the target to compile cleanly on Windows. - Tested only on this Windows 11 machine and commit; no other devices or commits were tried.
Sign in to join this conversation.
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#22358
No description provided.