Repository navigation
cmake: correct build dependencies that are not present on every platform - #71885
Merged
Merged
Conversation
This was referenced Sep 18, 2026
idryomov
approved these changes
Sep 18, 2026
idryomov
left a comment
Contributor
There was a problem hiding this comment.
Ack from the RBD perspective
wjwithagen
reviewed
Sep 18, 2026
wjwithagen
reviewed
Sep 18, 2026
wjwithagen
reviewed
Sep 18, 2026
wjwithagen
reviewed
Sep 18, 2026
wjwithagen
reviewed
Sep 18, 2026
wjwithagen
reviewed
Sep 18, 2026
wjwithagen
reviewed
Sep 18, 2026
wjwithagen
reviewed
Sep 18, 2026
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
dvanders
force-pushed
the
wip-macos-3-builddeps
branch
from
September 23, 2026 05:40
6121618 to
ed06323
Compare
tchaikov
reviewed
Sep 24, 2026
libnbd is not packaged for macOS or FreeBSD, so requiring it there fails the configure step. librbd guards every use of libnbd behind HAVE_LIBNBD, and rbd-nbd, which does need it, is only built on Linux. Exclude both alongside Windows. Suggested-by: Ilya Dryomov <[email protected]> Suggested-by: Willem Jan Withagen <[email protected]> Signed-off-by: Dan van der Ster <[email protected]> Assisted-by: Claude Opus 5.5 <[email protected]>
fcm includes <blkid/blkid.h>, but it was added to the build unconditionally, so configuring anywhere without libblkid failed to compile it. The top-level CMakeLists.txt sets HAVE_BLKID OFF everywhere but Linux, FreeBSD included, so key the plugin on that rather than on the platform. vdo needs nothing Linux-specific to build - it only looks for /sys/kvdo at run time, and finds nothing where there is none - so it stays in the build everywhere. Suggested-by: Willem Jan Withagen <[email protected]> Assisted-by: claude-code:claude-opus-5.5 Signed-off-by: Dan van der Ster <[email protected]>
The osd library includes common/ceph_crypto.h, which includes <openssl/evp.h>, but never declared the dependency. That only works where OpenSSL happens to sit in a default include path. Assisted-by: claude-code:claude-opus-5 Signed-off-by: Dan van der Ster <[email protected]>
ZlibCompressor.cc guarded its ISA-L paths with a repeated (__x86_64__ && HAVE_NASM_X64_AVX2) || __aarch64__ || HAVE_RISCV_RVV condition, and included igzip_lib.h unconditionally. That is not the condition CMakeLists.txt uses to decide whether to compile the ISA-L sources: the x86 branch there also requires HAVE_INTEL_SSE4_1 and is skipped entirely on APPLE, and the ARM branch keys off HAVE_ARMV8_SIMD rather than the architecture macro. Where the two disagree the plugin does not link. An Intel Mac with nasm installed is the plainest case: CMake compiles no ISA-L object, but __x86_64__ && HAVE_NASM_X64_AVX2 holds, so the compressor still calls isal_deflate(). An aarch64 target whose compiler rejects -march=armv8-a+simd fails the same way through __aarch64__. Set have_isal in the branches that actually compile the ISA-L sources and have them define HAVE_ISAL, then key the compressor off that one macro, so the code and the build cannot drift apart again. Where ISA-L was not built, compressor_zlib_isal=true degrades to plain zlib with the existing warning. Assisted-by: claude-code:claude-opus-5 Signed-off-by: Dan van der Ster <[email protected]>
…ntry point rgw_common named keyring and rt on its link line unconditionally. On Darwin the keyring target was not built, since it depended on HAVE_KEYUTILS, and there is no librt. keyring.cc already includes <keyutils.h> only on Linux, and Keyring::get_best() returns UnsupportedKeyring elsewhere, so build it everywhere and make only the keyutils link conditional. Link librt through RT_LIBRARY, which CephChecks.cmake finds wherever POSIX timers need it, and leaves empty elsewhere. rgw_main.cc called LinuxKeyringSecret::initialize_process_keyring() unguarded, although it is only defined on Linux. Guard it the same way, and elsewhere log at level 0 that the SSE-KMS key cache is disabled, since that cache needs the kernel keyring. Suggested-by: Willem Jan Withagen <[email protected]> Suggested-by: Kefu Chai <[email protected]> Signed-off-by: Dan van der Ster <[email protected]> Assisted-by: Claude Opus 5.5 <[email protected]>
ceph_bench_log linked rt on everything but Windows, but Darwin has no librt. Use RT_LIBRARY from CephChecks.cmake, which is empty wherever librt is not needed. Suggested-by: Kefu Chai <[email protected]> Signed-off-by: Dan van der Ster <[email protected]> Assisted-by: Claude Opus 5.5 <[email protected]>
The ten target_link_options() calls adding -Wl,--copy-dt-needed-entries are guarded with if(NOT WIN32), but the flag is GNU ld's. The comment at the top of test/libcephfs/CMakeLists.txt records what it is for: GNU ld refusing to look past the libraries named on the command line and reporting "DSO missing from command line" for a symbol libcephfs.so needs from libceph-common.so. Apple's linker has neither the behaviour nor the option, and says so:: ld: unknown options: --copy-dt-needed-entries which fails eight of these test binaries. Exclude macOS alongside Windows. Narrowing to LINUX instead would take FreeBSD with it; the answer there may well be that it does not want the flag either, its linker being lld rather than GNU ld, but that is for someone who can run the build to say. Assisted-by: claude-code:claude-opus-5 Signed-off-by: Dan van der Ster <[email protected]>
dvanders
force-pushed
the
wip-macos-3-builddeps
branch
from
October 1, 2026 22:08
ed06323 to
b0424c3
Compare
wjwithagen
approved these changes
Oct 4, 2026
Contributor
Author
|
jenkins test api |
Contributor
|
This PR has been added to main integration testing by anuchaithra started 2026-10-08-10:48. |
Contributor
pr testing completed and approved by @ivancich, more details in https://tracker.ceph.com/issues/81545. |
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.
Based on main; independent of the other six.
Libraries and plugins named on a link line or added to the build
unconditionally, where they are not available, or not built, everywhere:
libnbdis required only where rbd-nbd is builtextblkdevvdo and fcm plugins are Linux-specificcephfs-toolnamesuring::uringwhether or not liburing was builtosdusescommon/ceph_crypto.hwithout linking OpenSSLcompressor/zlibcompiles its ISA-L path without checking it was builtrgw_commonnameskeyring, which is built only underHAVE_KEYUTILS,though
keyring.ccis already portable and falls back toUnsupportedKeyringceph_bench_logand ten test binaries name librt and-Wl,--copy-dt-needed-entriesOn the last two points, and on libnbd: the guards name
APPLErather thannarrowing to
LINUX, per review on #71232 — FreeBSD has librt and shouldkeep linking it.
extblkdevis the one place that does nameLINUX, andthe commit message says why: libblkid is util-linux', and the top-level
CMakeLists.txt already sets
HAVE_BLKID OFFon FreeBSD.Thanks to @idryomov and @wjwithagen for the review that shaped these.
Checklist
🤖 Generated with Claude Code