Skip to content

Conversation

@jrflat
Copy link
Contributor

@jrflat jrflat commented Jul 29, 2025

System currently fails to build on Ubuntu 20.04 (Linux kernel v5.4) as shown in #243, but those same tests should now pass with this PR. I verified locally that System now builds on a Swift 6.2 Ubuntu 20.04 image.

The issue is that struct io_uring_sqe has added new properties in later kernel versions, and the Swift implementation is expecting these properties to be available on the struct.

Specifically, struct io_uring_sqe added:

  • cancel_flags in v5.5
  • open_flags in v5.6
  • file_index in v5.15

In the future, we could do something tricky to guard the availability of these features, but for now, let's just define a fallback struct for kernel versions < 5.15 so that we can build, but otherwise not support IORing initialization at runtime (such as by throwing ENOTSUP).

This PR defines a struct swift_io_uring_sqe that is just a typedef of struct io_uring_sqe on kernel versions that IORing supports. Otherwise, we use the same fallback struct that's defined when the <linux/io_uring.h> header isn't available.

We also replace the use of IORING_FEAT_NODROP with IORing.Features.nonDroppingCompletions.rawValue, which hard-codes the value for now.

@jrflat
Copy link
Contributor Author

jrflat commented Jul 29, 2025

@swift-ci please test

Copy link
Contributor

@glessard glessard left a comment

Choose a reason for hiding this comment

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

Thanks!

@jrflat
Copy link
Contributor Author

jrflat commented Jul 29, 2025

@swift-ci please test

@glessard glessard modified the milestone: 1.6.0 Jul 29, 2025
@jrflat jrflat merged commit d89ca1d into apple:main Jul 30, 2025
29 checks passed
This was referenced Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants