Conversation
Use a pinned, namespaced liburing UAPI header so old Linux headers no longer leave IORING_ENTER_EXT_ARG undefined. Preserve the existing header-based support condition and ENOTSUP behavior. Include deterministic regeneration, MIT notices, CMake installation, and CI compile checks for old, current, and missing headers plus ABI sizes, offsets, and alignment. Validation: macOS XCTest (70 cases, 2 existing skips) and Swift Testing (8 cases) pass. Linux C and Swift cross-compilation cover the original failure and fixed old/current/missing-header builds. CMake Release build, CSystem header installation, and installed consumer checks pass. Linux Swift validation used a temporary manifest source-inclusion adaptation; native Linux runtime tests remain unrun and the static SDK lacks XCTest. Full CMake installation is blocked by its Swift module output-path mismatch with the Xcode generator.
| The script verifies the original SHA-256 and makes only these adaptations: | ||
|
|
||
| - Prefix public identifiers and the include guard to coexist with system headers. | ||
| - Replace Linux integer types with fixed-width libc types, retaining explicit |
There was a problem hiding this comment.
Can you remind me why again we need to replace the integer types? Less changes to the header would be better.
There was a problem hiding this comment.
The replacements were intended to support SDKs that do not ship Linux UAPI headers: the pinned liburing header includes linux/fs.h, linux/types.h, and linux/time_types.h. I used fixed-width types plus explicit 8-byte alignment for __aligned_u64 so the private definitions can also coexist with system headers. The standalone ABI checks pass for i386, x86_64, and aarch64.
I agree that reducing the transformation would help maintenance. We could retain more of the upstream type spellings through a small compatibility layer, provided it covers headerless SDKs and avoids collisions with system headers. I have not changed that implementation while the broader vendoring direction is still under discussion.
|
I don't think we want to vendor the header wholesale. Note that in #329, we added the definition for |
glessard
left a comment
There was a problem hiding this comment.
I believe this is the wrong approach: we don't want to include a foreign header file in full.
I strongly disagree with this. It is considered a best practice to vendor this header (see Netty). It protects against compile-time vs runtime-time drift. So that you can compile on a machine with an older Kernel but deploy to one with a newer one. This is often the case if you build with the static MUSL SDK. I actually had it on my list for a long time to open a PR to vendor the |
|
I traced the #329 fallback: There are two possible scopes here: a narrow fallback for the missing constant with old-header regression coverage, or continuing the pinned vendoring approach while reducing its adaptations. Which would you prefer for this PR? One scope detail to confirm: the current patch preserves the build-header support gate, so builds with old or missing headers still return ENOTSUP even on a newer runtime kernel. Should this PR remain a compile-compatibility fix, with runtime feature detection handled separately, or is runtime decoupling part of the intended change? |
Swift System fails to compile against older Linux headers because
IORING_ENTER_EXT_ARGis missing. This affects dependent packages even when they do not use IORing.Fixes #385.
Vendor the liburing 2.12 UAPI at a pinned revision, with prefixed identifiers and fixed-width types so its definitions coexist with system headers and also work without Linux UAPI headers. Preserve the existing header-based support condition: old or missing system headers still cause IORing initialization to return
ENOTSUP.The patch includes MIT notices, deterministic regeneration, CMake header installation, and a CI compile regression covering old/current/missing headers, include order, and kernel ABI sizes, offsets, and alignment.
Validation
swift test: 70 XCTest cases with 2 existing skips and no failures; 8 Swift Testing cases pass.Linux runtime tests remain unrun. The Linux test-target build is blocked by the static SDK lacking
XCTest. Full CMake installation with the Xcode generator fails to findswift/SystemPackage.swiftdoc; a baseline installation comparison was not performed.