CNA-BUG-200: The registered CTest CNAEXT_NoPosixSetenv fails at this snapshot: twelve Wayland setenv/unsetenv call lines trip the gate
Evidence basis: source-verified at the pinned commit; executed for this entry (the Evidence section names exactly what was run); tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
scripts/check_no_posix_setenv.py forbids POSIX setenv/unsetenv under modules/, tools/ and tests/, but the native Wayland backend and its tests added twelve such lines on 2026-09-15 and 2026-09-16, so the gate CNA registers in every test-enabled tree has exited 1 since 2026-09-15.
- Identifier
CNA-BUG-200- Category
- Bug
- Subsystem
- Build & CI
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Medium (a triage suggestion, not a project priority)
- Evidence basis
- Reproduced: executed for this entry (the Evidence section names exactly what was run)
- Tests touching this area
- Yes: see Current tests
- Affected contract
- CTest CNAEXT_NoPosixSetenv (modules/graphics-ext/examples/CMakeLists.txt, label CnaExt)
Expected behaviour
A gate CNA registers passes on its own tree. The rule it enforces (use System::Environment::SetEnvironmentVariable, because MinGW-w64 has no setenv/unsetenv) was introduced with the gate on 2026-08-19.
Actual behaviour at TARGET
check_no_posix_setenv.py reports twelve lines: ::unsetenv("XDG_ACTIVATION_TOKEN") in WaylandPlatform.cpp, and setenv/unsetenv of WAYLAND_SOCKET, WAYLAND_DISPLAY, LC_ALL, DBUS_SESSION_BUS_ADDRESS and XDG_ACTIVATION_TOKEN in WaylandDesktopPortalTests.cpp, WaylandProtocolTests.cpp, WaylandTestCompositor.cpp and WaylandTestEnvironment.cpp, all under modules/platform/tests/CNA/Platform/. The test is added in CMakeLists.txt inside if(CNA_BUILD_TESTS) whenever a Python 3 interpreter is found, so it is red in every test-enabled tree. The Wayland code never reaches a Windows build (CMakeLists.txt compiles src/Wayland only for CNA_PLATFORM=WAYLAND, and UnitTests.cmake drops the Wayland tests otherwise), so the MinGW breakage the gate guards against does not occur; the defect is the permanently red gate. general-tests-ci.yml runs an unfiltered ctest and its known-failure list names only EasyGL_GraphicsDevice_ReferenceStencil, so that job would classify this failure as new.
Source locations
scripts/check_no_posix_setenv.py— CALL regex and the modules/tools/tests scanmodules/graphics-ext/examples/CMakeLists.txt— add_test NAME CNAEXT_NoPosixSetenvmodules/platform/src/Wayland/WaylandPlatform.cpp— ::unsetenv("XDG_ACTIVATION_TOKEN")modules/platform/tests/CNA/Platform/WaylandProtocolTests.cpp— setenv/unsetenv of WAYLAND_SOCKET, XDG_ACTIVATION_TOKEN, LC_ALLmodules/platform/tests/CNA/Platform/WaylandTestEnvironment.cpp— setenv of DBUS_SESSION_BUS_ADDRESS, WAYLAND_DISPLAY; unsetenv WAYLAND_SOCKETmodules/platform/tests/CNA/Platform/WaylandDesktopPortalTests.cpp— unsetenv("WAYLAND_SOCKET")modules/platform/tests/CNA/Platform/WaylandTestCompositor.cpp— setenv("WAYLAND_SOCKET", ...).github/workflows/general-tests-ci.yml— unfiltered ctest and the KNOWN_FAILURES listdocs/opengl4-renderer.md— CNA's own record of the CNAEXT_NoPosixSetenv failure
Evidence
Executed: python3 scripts/check_no_posix_setenv.py . against the read-only extracted snapshot tree (a text scan, nothing built); it printed the twelve lines and exited 1. CNA's own records agree: opengl4-renderer.md lists CNAEXT_NoPosixSetenv as the one CNAEXT example failure “on every renderer”, and several plans record it as a standing failure. The Wayland sources arrived in commits 678c6a51b and 227157d2c (2026-09-15), after the gate (c9f1359e1, 2026-08-19). Not executed: ctest itself or any CI run.
Independent re-verification: Executed: python3 check_no_posix_setenv.py . against the read-only extracted snapshot tree (a text scan, nothing built); it printed the twelve lines and exited 1, and the same scan repeated for this review gave the same result. CNA's own records agree: opengl4-renderer.md lists CNAEXT_NoPosixSetenv as the one CNAEXT example failure "on every renderer", and several plans record it as a standing failure. The first Wayland lines arrived in commits 678c6a51b and 227157d2c (2026-09-15) and the last four in c6e125083 and a271ae0ef (2026-09-16), all after the gate (c9f1359e1, 2026-08-19). Not executed: ctest itself or any CI run.
Focused reproduction
# Executed against the snapshot tree (read-only text scan):
python3 scripts/check_no_posix_setenv.py .
# POSIX setenv/unsetenv found ... (12 lines under modules/platform) ; exit status 1
Current tests
The gate itself; it has been red since 2026-09-15.
Regression test
The gate becomes green when the Wayland sources use System::Environment::SetEnvironmentVariable (an empty value unsets), or when the gate scopes out POSIX-only platform directories with a stated reason.
Blast radius
Every test-enabled tree reports one failing CTest; an unfiltered CI run cannot go green, which hides new failures behind a known red one. No runtime behaviour is affected.
Workaround
ctest -E '^CNAEXT_NoPosixSetenv$' for local runs.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Deep dives
- Test populations: structural gates
- Known issues
- Bug index