Repository navigation
Closed
Description
Background
Follow-up from #2324 / #2325 / #2327.
On Windows builds the clang compile line for test DLLs contains a mix of path spellings for -I flags:
-Ici/meson/native\fastled.dll.p ← mixed: fwd then backslash
-Ici/meson/native ← fwd relative
-I..\..\ci\meson\native ← native backslash relative
-IC:/Users/niteris/dev/fastled6/. ← abs fwd, trailing /.
-IC:/Users/niteris/dev/fastled6/src ← abs fwd, clean
-IC:/Users/niteris/dev/fastled6/src/platforms/stub
-Itests ← fwd relative
-Itests\fl_audio_detector_vibe.dll.p ← mixed
Why this matters:
- Clang's
#pragma oncededuplication keys on the resolved-path string. If a header is included through two-Iflags that spell the same directory differently, clang treats them as different files and#pragma onceis silently defeated. - On Windows clang-tool-chain with MinGW, some header paths come back ALL-NATIVE backslash in diagnostics (e.g.
C:\Users\niteris\dev\fastled6\src\fl\audio\audio_processor.h) while others come back mixed. This strongly suggests the identity check is comparing raw un-normalized strings. - The
#2324 → #2325incident had vibe.h redefined because thesrcdirectory was passed as bothC:/.../fastled6/./src(tests) andC:/.../fastled6/src(fastled_lib). refactor(tests): drop _project_root_fwd indirection; align test -I paths with rest of codebase #2327 removes the./srcspelling; this issue tracks the remaining inconsistencies.
Remaining inconsistencies
Meson auto-generates relative -I flags for every target (private build dir, source subdir, etc.). On Windows these come out with native backslashes or mixed slashes:
-I..\..\ci\meson\native
-Itests\fl_audio_detector_vibe.dll.p
-Ici/meson/native\fastled.dll.p
None of these currently affect src/** header resolution (they only map into ci/meson/native/ and tests/), but they're a latent trap: if a future header is added under one of those relative roots, we'll hit the same class of bug again.
Desired end state
Every -I flag passed to the compiler is:
- Absolute
- Forward-slash normalized
- Spelled identically across PCH build, fastled_lib, crash_handler_lib, test DLLs, example DLLs
Specifically:
| Dir | Canonical spelling |
|---|---|
| project root | C:/Users/.../fastled6 |
| src | C:/Users/.../fastled6/src |
| src/platforms/stub | C:/Users/.../fastled6/src/platforms/stub |
| tests | C:/Users/.../fastled6/tests |
| build subdirs (.p) | C:/Users/.../fastled6/.build/meson-quick/... |
No ./ in the middle. No backslashes. No relative paths.
Options
- Meson-side fix: force all
include_directories(...)to be absolute and forward-slash. This requires auditing every call site and probably writing a helper inci/meson/shared/that wrapsinclude_directories()to enforce the canonical form. - Wrapper-side fix: a compiler wrapper (either the existing
zccacheor a new one ahead of it) normalizes-Iarguments before calling the real compiler. See companion issue for azccache --strict-pathsfeature request. - Both: meson-side for what's tractable; wrapper-side as a safety net for what Meson auto-generates.
Option (3) is the most robust and is what this issue proposes.
Acceptance
- A new test in
tests/orci/tests/that inspects compile_commands.json after setup and fails if any-Iflag is non-absolute or contains a backslash. bash test --cpppasses without the#ifndef FL_AUDIO_DETECTOR_VIBE_Hguard insrc/fl/audio/detector/vibe.h(i.e.#pragma oncealone is sufficient once paths are consistent).- Once the above passes, the
#ifndefguard added in fix(audio): add #ifndef guards to vibe.h for PCH-safe inclusion #2325 can be reverted.
Related
- fix(audio): add ifndef guard to vibe.h so pragma once survives mixed-slash include paths #2324 (initial wrong-fix report)
- fix(audio): add #ifndef guards to vibe.h for PCH-safe inclusion #2325 (merged defensive guard)
- refactor(tests): drop _project_root_fwd indirection; align test -I paths with rest of codebase #2327 (remove
/./srcspelling inconsistency — partial cleanup)
Metadata
Metadata
Assignees
Labels
No labels
Activity
build(meson): normalize -I paths to absolute forward-slash form (#2328)
build(meson): normalize -I paths to absolute forward-slash form (#2328)