CNA-BUG-198: Link-closure tests pass --build-dir ${CMAKE_BINARY_DIR}, so when CNA is added as a subproject they look for link.txt in the consumer's build root and always skip
Evidence basis: source-verified at the pinned commit. 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.
The probe targets are defined in CNA's own root directory, whose binary directory is a subdirectory of the consumer's build tree; the checker is pointed at the top-level build root instead and never finds CMakeFiles/<probe>.dir/link.txt.
- Identifier
CNA-BUG-198- Category
- Bug
- Subsystem
- Build & CI
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- None
- Affected contract
- cmake/Tests/ModuleProbes.cmake ModuleLinkClosure_* --build-dir argument
Expected behaviour
A gate registered by CNA should evaluate the same way whether CNA is the top-level project or consumed with add_subdirectory (a consumer shape CNA supports; see the CNA_SOURCE_DIR comment in CMakeLists.txt).
Actual behaviour at TARGET
Every add_test(NAME ModuleLinkClosure_... --build-dir "${CMAKE_BINARY_DIR}" ...) in ModuleProbes.cmake uses the top-level binary directory. The probes are created by the include(cmake/Tests/ModuleProbes.cmake) in CNA's root CMakeLists.txt, so their CMakeFiles/<probe>.dir/link.txt lives under CMAKE_CURRENT_BINARY_DIR. In a subproject build the two differ, and every closure gate returns 77 (SKIP) even under a Makefiles generator.
Source locations
cmake/Tests/ModuleProbes.cmake— --build-dir ${CMAKE_BINARY_DIR} in every link-closure registrationCMakeLists.txt— include(cmake/Tests/ModuleProbes.cmake) in CNA's root directory
Evidence
Checked by reading the named sources at 009d40f5; nothing was built or executed for this entry. The failure mode is a silent SKIP, not a false pass or fail.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
None; no configuration tests CNA as a subproject with tests on.
Regression test
Pass ${CMAKE_CURRENT_BINARY_DIR} (or the probe target's BINARY_DIR property) and add a subproject fixture that runs one closure gate.
Blast radius
Consumers that embed CNA with CNA_BUILD_TESTS=ON; top-level builds are unaffected.
Workaround
Run the closure gates from a top-level CNA build.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- Deep dives
- Dependency boundaries: link probes
- Known issues
- Bug index