Repository navigation
Work around the broken libc++.modules.json packaged by Ubuntu 26.04 in CI - #113
Merged
Merged
Conversation
…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
requested review from
guominrui,
tian-lt,
tian-lt-personal and
zhihaoy
November 20, 2026 11:17
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CMAKE_CXX_STDLIB_MODULES_JSONwith/usr/lib/llvm-N/lib/libc++.modules.jsonto the default and freestanding configures of the clang compatibility jobs, becauselibc++-N-devfor LLVM 19 to 22 on Ubuntu 26.04 also ships a copy under/usr/lib/x86_64-linux-gnuwhose relative source paths only resolve from/usr/lib/llvm-N/lib, clang reports that copy, and CMake 4.5 builds thestdmodule for every target that scans for modules.import stdfor freestanding builds with libstdc++ by settingCMAKE_CXX_STDLIB_MODULES_JSONto an empty string, because libstdc++ cannot build itsstdmodule 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.