Skip to content

Work around the broken libc++.modules.json packaged by Ubuntu 26.04 in CI - #113

Merged
mingxwa merged 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/ci
Nov 20, 2026
Merged

mingxwa merged 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/ci

Conversation

@mingxwa

@mingxwa mingxwa commented Nov 20, 2026 •

Copy link
Copy Markdown
Member
  • Passed CMAKE_CXX_STDLIB_MODULES_JSON with /usr/lib/llvm-N/lib/libc++.modules.json to the default and freestanding configures of the clang compatibility jobs, because libc++-N-dev for LLVM 19 to 22 on Ubuntu 26.04 also ships a copy under /usr/lib/x86_64-linux-gnu whose relative source paths only resolve from /usr/lib/llvm-N/lib, clang reports that copy, and CMake 4.5 builds the std module for every target that scans for modules.
  • Disabled import std for freestanding builds with libstdc++ by setting CMAKE_CXX_STDLIB_MODULES_JSON to an empty string, because libstdc++ cannot build its std module with -ffreestanding (https://gcc.gnu.org/PR125460). libstdc++ is recognized by the name of the modules metadata file, because a __GLIBCXX__ check runs a try_compile after which CMake 4.5 ignores the empty value.

…n CI

- Passed `CMAKE_CXX_STDLIB_MODULES_JSON` with `/usr/lib/llvm-N/lib/libc++.modules.json` to the default and freestanding configures of the clang compatibility jobs, because `libc++-N-dev` for LLVM 19 to 22 on Ubuntu 26.04 also ships a copy under `/usr/lib/x86_64-linux-gnu` whose relative source paths only resolve from `/usr/lib/llvm-N/lib`, clang reports that copy, and CMake 4.5 builds the `std` module for every target that scans for modules.
- Disabled `import std` for freestanding builds with libstdc++ by setting `CMAKE_CXX_STDLIB_MODULES_JSON` to an empty string, because libstdc++ cannot build its `std` module with `-ffreestanding` (https://gcc.gnu.org/PR125460). libstdc++ is recognized by the name of the modules metadata file, because a `__GLIBCXX__` check runs a try_compile after which CMake 4.5 ignores the empty value.
@mingxwa
mingxwa merged commit 69f653c into ngcpp:feature/v5 Nov 20, 2026
20 checks passed
@mingxwa
mingxwa deleted the user/mingxwa/ci branch November 20, 2026 12:47
mingxwa added a commit that referenced this pull request Nov 21, 2026
…n CI (#113)

- Passed `CMAKE_CXX_STDLIB_MODULES_JSON` with `/usr/lib/llvm-N/lib/libc++.modules.json` to the default and freestanding configures of the clang compatibility jobs, because `libc++-N-dev` for LLVM 19 to 22 on Ubuntu 26.04 also ships a copy under `/usr/lib/x86_64-linux-gnu` whose relative source paths only resolve from `/usr/lib/llvm-N/lib`, clang reports that copy, and CMake 4.5 builds the `std` module for every target that scans for modules.
- Disabled `import std` for freestanding builds with libstdc++ by setting `CMAKE_CXX_STDLIB_MODULES_JSON` to an empty string, because libstdc++ cannot build its `std` module with `-ffreestanding` (https://gcc.gnu.org/PR125460). libstdc++ is recognized by the name of the modules metadata file, because a `__GLIBCXX__` check runs a try_compile after which CMake 4.5 ignores the empty value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant