Repository navigation
Conversation
port_posix.h declares `using ThreadId = pid_t;` on every POSIX platform, but includes <sys/types.h> only in its AIX and BSD/Android branches. On macOS pid_t was declared only transitively, through the std::format machinery that libc++'s <thread> includes in C++23 mode. With _LIBCPP_NO_TRANSITIVE_FORMAT_INCLUDE that include is gone and 18 files fail to compile with "unknown type name 'pid_t'".
This was referenced Dec 5, 2026
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.
port/port_posix.hdeclaresusing ThreadId = pid_t;on every POSIX platform, but includes<sys/types.h>only in its AIX and BSD/Android branches. On macOS,pid_tcame only through thestd::formatmachinery that libc++'s<thread>includes in C++23 mode. ClickHouse's libc++ drops that include with_LIBCPP_NO_TRANSITIVE_FORMAT_INCLUDE(ClickHouse/llvm-project#165), and then 18 files fail on both macOS builds:Fix: include
<sys/types.h>unconditionally, next to the other C headers.Validation (
-fsyntax-onlywith ClickHouse's flags): with this change the 18 files pass for arm64 and x86_64 macOS with and without that macro, and every RocksDB file passes with it for s390x, ppc64le, riscv64 and loongarch64 Linux and for FreeBSD; a full x86_64 Linux build compiles. Upstreammeta/rocksdbmainhas the same gap.ClickHouse PR: ClickHouse/ClickHouse#137988