Skip to content

Use FOLLY_HAS_LIBURING instead of __has_include in SSLUtil#694

Open
Sathvik-Chowdary-Veerapaneni wants to merge 1 commit intofacebook:mainfrom
Sathvik-Chowdary-Veerapaneni:sslutil-folly-uring-check-649
Open

Use FOLLY_HAS_LIBURING instead of __has_include in SSLUtil#694
Sathvik-Chowdary-Veerapaneni wants to merge 1 commit intofacebook:mainfrom
Sathvik-Chowdary-Veerapaneni:sslutil-folly-uring-check-649

Conversation

@Sathvik-Chowdary-Veerapaneni
Copy link
Copy Markdown

Summary

Fixes #649

SSLUtil.cpp was using #if defined(__linux__) && __has_include(<liburing.h>) to guard the io_uring code path. This is an ad-hoc check that only tests whether the liburing.h header is present on the system, without verifying that Folly was actually compiled with uring support.

This PR replaces it with the FOLLY_HAS_LIBURING macro from Folly's feature test header (folly/io/async/Liburing.h), which is already available through the existing <folly/io/async/AsyncIoUringSocketFactory.h> include. This matches the pattern used consistently throughout the rest of the fbthrift codebase (e.g., ThriftServer.cpp, IOUringUtil.h, IOUringUtil.cpp, and the stresstest utilities).

Changes

  • thrift/lib/cpp2/security/SSLUtil.cpp: Replace #if defined(__linux__) && __has_include(<liburing.h>) with #if FOLLY_HAS_LIBURING

Verification

  • Grepped the full fbthrift codebase: this was the only file using __has_include(<liburing.h>) directly. All other uring-related files already use FOLLY_HAS_LIBURING.
  • No other __has_include checks for <liburing.h> remain in the codebase.

Replace the ad-hoc __has_include(<liburing.h>) check with the
FOLLY_HAS_LIBURING macro from Folly's feature test header. The macro
is already available via the existing <folly/io/async/AsyncIoUringSocketFactory.h>
include, which pulls in <folly/io/async/Liburing.h>.

This ensures the uring code path is only compiled when Folly was
actually built with uring support, matching the pattern used
throughout the rest of the fbthrift codebase.

Fixes facebook#649
@meta-cla meta-cla bot added the CLA Signed label Mar 26, 2026
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.

SSLUtil does not check whether Folly has uring support

1 participant