CNA-BUG-269: cna_validate_renderer_identity_selection says it checks the per-identity CNA_RENDERER_<X> switches, but only retired names are checked: a misspelled or unknown switch is never read and the platform's default renderer is configured silently
Evidence basis: source-verified at the pinned commit; 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.
The validator's comment promises to check the CNA_RENDERER_<X> switches, but it only loops over retired names; -DCNA_RENDERER_D3D9=ON or a typo is neither an error nor honoured, and the platform's default renderer is configured without a diagnostic.
- Identifier
CNA-BUG-269- 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
- Yes: see Current tests
- Affected contract
- cmake/RendererIdentities.cmake::cna_validate_renderer_identity_selection and the per-identity CNA_RENDERER_<X> configure switches
Expected behaviour
The comment above the function says it “checks every route that can name a renderer: CNA_GRAPHICS_RENDERER, each member of CNA_GRAPHICS_RENDERERS, and the per-identity CNA_RENDERER_<X> switches”, and the other two routes report an unknown name at configure time (cna_require_public_renderer_identity: “unknown graphics renderer … (requested through …)”). A misspelled switch should get the same error instead of a silent fallback.
Actual behaviour at TARGET
RendererIdentities.cmake tests CNA_RENDERER_<X> only inside a loop over the list of retired identities, and for those it requires a public one. For any other name, such as an old renderer spelling or a typo, the variable is never read: RendererSelection.cmake consults a switch only for the names in the public identity list, so the configure succeeds and the platform's default renderer is selected. The only diagnostic is CMake's own generic 'Manually-specified variables were not used by the project' warning, printed after the configure summary and only for values given with -D or a preset; it names the variable but not the cause, and CNA's own header, plan and tests treat an unread selector as the silent fallback this file exists to close.
Source locations
cmake/RendererIdentities.cmake— cna_validate_renderer_identity_selection: the CNA_RENDERER_<X> route is checked only for retired namescmake/RendererSelection.cmake— the switch loop over CNA_RENDERER_PUBLIC_IDENTITIEScmake/Tests/RendererRetiredIdentityCase.cmake— the retired-name case is tested; an unknown name is not
Evidence
Read at 009d40f5; nothing was configured. Found by the C13 conservation reviewer (glossary appendix) and re-verified by the orchestrator against the validator, the selection loop and the tests under cmake/Tests.
Focused reproduction
No focused reproduction is known. Nothing has been invented here; the evidence above is what exists.
Current tests
cmake/Tests/RendererRetiredIdentityCase.cmake pins the error for a retired name; nothing exercises an unknown or misspelled CNA_RENDERER_<X> switch.
Regression test
Configure with -DCNA_RENDERER_NOSUCH=ON and expect a configure-time error naming the switch and the supported identities, next to the existing retired-identity case.
Blast radius
Builds that select a renderer with an -DCNA_RENDERER_<X>=ON switch and misspell or use a stale name (for example a pre-rename spelling): the build succeeds with the host's default renderer instead of the intended one.
Workaround
Select the renderer with CNA_GRAPHICS_RENDERER (or CNA_GRAPHICS_RENDERERS), which reject unknown names at configure time.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Building CNA
- Deep dives
- Glossary: identity
- Known issues
- Bug index