Skip to content

libcephfs_proxy: build it on Linux only - #71886

Open
dvanders wants to merge 3 commits into
ceph:mainfrom
dvanders:wip-macos-4-cephfs-proxy
Open

dvanders wants to merge 3 commits into
ceph:mainfrom
dvanders:wip-macos-4-cephfs-proxy

Conversation

@dvanders

Copy link
Copy Markdown
Contributor

Split out of #71232, which reviewers asked to see in smaller batches.
Based on main; independent of the other six.

libcephfsd shares a single libcephfs mount between processes over a Unix
socket and is written to Linux throughout: it marshals fscrypt's UAPI
structures by size from <linux/fscrypt.h>, holds an unnamed file open
with O_TMPFILE and names it later with linkat(AT_EMPTY_PATH), and asks
recvmsg() for MSG_CMSG_CLOEXEC. None of that has a Darwin spelling, and
O_TMPFILE and AT_EMPTY_PATH are absent on FreeBSD too, so the component
cannot have been building anywhere but Linux.

Gate it the way the mount helper immediately above it in
src/CMakeLists.txt already is, rather than spreading conditionals through
it — @phlogistonjohn's suggestion on #71232, and the right one.

Two fixes come along because neither is about Darwin:

  • cephfs_proxy compiles proxy_helpers.c, which hashes with EVP, so it
    needs OpenSSL; only the daemon was being given it
  • <endian.h> was included in two files that use nothing from it, while
    <limits.h>, which proxy_mount.c takes PATH_MAX from, was not
    included at all

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

🤖 Generated with Claude Code

Two of these files include <endian.h> and neither uses anything from it:
there is no htobe*(), be*toh() or __BYTE_ORDER anywhere in the
component.  Drop it.  It is a glibc header, so this is also what stops
proxy_link.h from being included at all on Darwin, and with it every
file that reaches for the link layer.

proxy_mount.c does use PATH_MAX, for the thread-local buffer that
proxy_path_iterator_resolve() resolves symlinks into, and never
includes <limits.h>.  It is reaching the definition through some other
header on Linux; ask for it directly.

Assisted-by: claude-code:claude-opus-5
Signed-off-by: Dan van der Ster <[email protected]>
Comment thread src/libcephfs_proxy/CMakeLists.txt Resolved
Comment thread src/CMakeLists.txt Resolved
proxy_helpers.c hashes with EVP_sha256() and is built into both the
daemon and the client library, but only the daemon is told about
OpenSSL.  The client library gets away with it on Linux because
/usr/include is searched anyway and a shared library is allowed to leave
the symbols to be resolved at load time.

Neither holds everywhere.  Homebrew keeps openssl@3 keg-only, so the
headers are not on any default search path and the compile fails outright
with 'openssl/evp.h' file not found - for the client library only, the
daemon having brought the include directory in with the target it
already links.

Assisted-by: claude-code:claude-opus-5
Signed-off-by: Dan van der Ster <[email protected]>
libcephfsd shares a single libcephfs mount between processes over a Unix
socket, for the container cases that want it, and is written to Linux
throughout: it marshals fscrypt's UAPI structures by size from
<linux/fscrypt.h>, holds an unnamed file open with O_TMPFILE and names it
later with linkat(AT_EMPTY_PATH), and asks recvmsg() for MSG_CMSG_CLOEXEC.
None of that has a Darwin spelling, and O_TMPFILE and AT_EMPTY_PATH are
absent on FreeBSD too, so the component cannot have been building
anywhere but Linux.

Spreading conditionals through it to make it compile elsewhere is the
wrong answer - nothing on a macOS developer's cluster wants the daemon.
Gate it the way the mount helper immediately above it is already gated.

Suggested-by: John Mulligan <[email protected]>
Assisted-by: claude-code:claude-opus-5
Signed-off-by: Dan van der Ster <[email protected]>
@dvanders
dvanders force-pushed the wip-macos-4-cephfs-proxy branch from a86f3ff to 65cee23 Compare September 23, 2026 05:54
Comment thread src/libcephfs_proxy/CMakeLists.txt Resolved

@wjwithagen wjwithagen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on FreeBSD as well

Comment thread src/libcephfs_proxy/CMakeLists.txt Resolved

@tchaikov tchaikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@yuriw

yuriw commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri-testing-20261109.210713-main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants