hc_persist_parity.cpp calls POSIX setenv/unsetenv: target does not build with MSVC, ctest reports 2 tests Not Run
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cmake, cpp
- Domain
- build-system, testing
Research direction
Read the environment-setting code in src/kernels/hc_persist_parity.cpp and compare it with set_env in src/kernels/decode_cluster_parity.cpp. Add the Windows-specific environment handling described in the issue, then build the hc_persist_parity target on Windows and run hc_persist_parity and hc_persist_default_off through ctest; both should run successfully.
Written by the indexing model from the issue text.
Description
Context
On main at 477ac13c (2026-10-16), tag v0.1.45, the Windows build (Release, CUDA 13.4, sm_120, RTX 5090) fails to compile src/kernels/hc_persist_parity.cpp with MSVC. Lines 55-56:
if (off) unsetenv("STRATA_HC_PERSIST"); else setenv("STRATA_HC_PERSIST", "1", 1);
setenv and unsetenv are POSIX functions. MSVC does not declare them. The compiler reports:
hc_persist_parity.cpp(55): error C3861: 'unsetenv': identifier not found
hc_persist_parity.cpp(56): error C3861: 'setenv': identifier not found
Consequence
The hc_persist_parity target does not build on Windows. ctest marks hc_persist_parity and hc_persist_default_off as "Not Run" (CMakeLists.txt lines 1115-1119). The engine itself is not affected, since STRATA_HC_PERSIST is off by default. The test was added by cea3d61b, after 0.1.42.
Proposed fix
The repository already handles this case elsewhere. set_env in src/kernels/decode_cluster_parity.cpp lines 46-52 calls _putenv_s(name, value) under _WIN32 and setenv(name, value, 1) on other platforms. The same guard applies here. On Windows, _putenv_s with an empty value removes the variable (documented behavior), so the --off case maps to it:
#ifdef _WIN32
if (off) _putenv_s("STRATA_HC_PERSIST", "");
else _putenv_s("STRATA_HC_PERSIST", "1");
#else
if (off) unsetenv("STRATA_HC_PERSIST");
else setenv("STRATA_HC_PERSIST", "1", 1);
#endif
- Dominant language
- C++
- Stars
- 11.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Niko1221/Strata
-
[Other] error detected in the compilation of Strata/src/qwen35/q36_engine.cuPossibly taken A pull request linked to this issue is open or already merged. Openneeds-format
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Niko1221/Strata#3368 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-2 days Newbie friendliness 75/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Niko1221/Strata#3269 · 2 comments ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 64/100
Niko1221/Strata#3197 · 3 comments ·
Maintainers usually reply within 3 days
Similar issues
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
scp-fs2open/fs2open.github.com#7914 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
eclipse-score/inc_someip_gateway#356 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarperFast/rocksdb-js#945 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day