Repository navigation
common,auth,msg: fix portability problems a stricter toolchain turns up - #71883
Merged
Merged
Conversation
This was referenced Sep 18, 2026
wjwithagen
reviewed
Sep 18, 2026
tchaikov
reviewed
Sep 24, 2026
wjwithagen
approved these changes
Sep 25, 2026
wjwithagen
reviewed
Sep 26, 2026
wjwithagen
left a comment
Member
There was a problem hiding this comment.
Works on FreeBSD 14.1 as expected
dvanders
force-pushed
the
wip-macos-1-portability
branch
from
October 1, 2026 21:55
1297d2d to
a983419
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
std::exception_ptr and std::string/std::string_view were being used without including the headers that declare them, which happens to work with libstdc++ because other headers pull them in, but fails with libc++. Assisted-by: claude-code:claude-opus-5 Signed-off-by: Dan van der Ster <[email protected]>
CephxKeyServer.h holds a boost::intrusive_ptr<CephContext>, so intrusive_ptr_release(CephContext*) has to be visible where the smart pointer's destructor is instantiated. Only common_fwd.h was included, which merely forward declares CephContext, so the lookup succeeded by accident whenever another header happened to pull ceph_context.h in first. Assisted-by: claude-code:claude-opus-5 Signed-off-by: Dan van der Ster <[email protected]>
const_pointer_iterator adapts the map's const_iterator so that dereferencing
yields a pointer, and inherits everything else - including the increment and
decrement, which therefore return the base iterator rather than this type.
weakly_incrementable requires "{ ++i } -> same_as<I&>", so the adapter is not
an input_iterator, and get_highest()'s std::vector::assign is ill-formed.
libstdc++ never noticed, because its assign() does not go through the
constrained algorithms. libc++ dispatches to ranges::copy_n, which checks,
and rejects the iterator with a diagnostic pointing deep inside <vector>.
Respell the four operators to return const_pointer_iterator.
Assisted-by: claude-code:claude-opus-5
Signed-off-by: Dan van der Ster <[email protected]>
Apple clang emits the thread-local initialization routine of an
`inline static thread_local` data member with non-weak linkage. Every
other symbol the member generates comes out weak - the guard variable
and both Cache constructors are `weak private external` - but
__ZTHN23CachedStackStringStream5cacheE
is plain `private external`, so any two translation units that both
instantiate it collide:
duplicate symbol 'thread-local initialization routine for
CachedStackStringStream::cache' in:
SimpleRADOSStriper.cc.o
libcephsqlite.cc.o
Most link units get away with it because only one of their translation
units touches the cache; libcephsqlite.dylib is built from exactly two
and both log.
Hold the cache as a function-local thread_local inside an inline
accessor instead. That has the vague linkage the data member was meant
to have, on every compiler, and the initialization routine stops being
emitted as a distinct external symbol altogether.
Assisted-by: claude-code:claude-opus-5
Signed-off-by: Dan van der Ster <[email protected]>
The header says `int truncate(size_t size)` and the definition says `int SimpleRADOSStriper::truncate(uint64_t size)`. LP64 Linux makes those one type, so nothing notices; on Darwin size_t is `unsigned long` and uint64_t is `unsigned long long`, and they are distinct: SimpleRADOSStriper.cc:144:25: error: out-of-line definition of 'truncate' does not match any declaration in 'SimpleRADOSStriper' Take uint64_t, which the definition already uses and which is what the rest of the class spells for a position or a size of the striped file - stat() reports into a uint64_t, and read() and write() take their offsets as one. size_t is left for the buffer lengths, which is what it describes. Assisted-by: claude-code:claude-opus-5 Signed-off-by: Dan van der Ster <[email protected]>
ObjectModel.cc passes std::execution::seq to nine std::generate calls. libc++ installs <execution>, so the include is satisfied, but it implements no parallel algorithms and so defines none of the policy objects: error: no member named 'seq' in namespace 'std::execution' std::execution::seq asks for the algorithm to run on the calling thread, in the calling thread's order - which is what the overload taking no policy at all already guarantees. Dropping the argument therefore keeps the behaviour identical on every platform, rather than trading anything away for the sake of one, and the header goes with it as it has no other use here. The TBB link in CMakeLists.txt existed only because libstdc++ implements <execution> with TBB, so drop it too. Assisted-by: claude-code:claude-opus-5 Signed-off-by: Dan van der Ster <[email protected]>
dvanders
force-pushed
the
wip-macos-1-portability
branch
from
October 5, 2026 22:36
a983419 to
b32e771
Compare
Contributor
Author
|
jenkins test make check |
4 of 14 tasks
Contributor
|
This PR has been added to wip-bharath5-testing-20261012.095720-main. |
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.
Split out of #71232, which reviewers asked to see in smaller batches.
This is the first of seven; it is based on main and does not depend on
any of the others.
Nothing here is macOS-specific — there is not a single platform
conditional in the series. These are things the tree gets away with under
libstdc++ and a slightly older clang, and which a stricter standard
library or a newer compiler rejects:
BoundedKeyCounter's nested iterator not satisfying the C++20 iteratorconcepts it is used through
SimpleRADOSStriper::truncatedeclared with a signature the definitiondoes not match
CachedStackStringStream's cache as a function-local static in a headerstd::execution::seqpassed to an algorithm overload that does not takean execution policy
Each is a single self-contained commit. (A seventh, making
platform_errno.hincludable from C, was dropped: #71442 made the samechange.)
Checklist
🤖 Generated with Claude Code