From a5f13c77b809bd42844d7cf37fa39aa6e30e66bc Mon Sep 17 00:00:00 2001 From: Jonathan Flat Date: Sun, 3 Aug 2025 10:59:47 -0600 Subject: [PATCH 1/4] Fix typedef errors on platforms with _ASM_GENERIC_INT headers --- Sources/CSystem/include/io_uring.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/CSystem/include/io_uring.h b/Sources/CSystem/include/io_uring.h index d8287b1..ce618f3 100644 --- a/Sources/CSystem/include/io_uring.h +++ b/Sources/CSystem/include/io_uring.h @@ -134,11 +134,13 @@ typedef struct __SWIFT_IORING_SQE_FALLBACK_STRUCT swift_io_uring_sqe; #define IORING_FEAT_RW_ATTR (1U << 16) #define IORING_FEAT_NO_IOWAIT (1U << 17) +#if !defined(_ASM_GENERIC_INT_LL64_H) && !defined(_ASM_GENERIC_INT_L64_H) && !defined(_UAPI_ASM_GENERIC_INT_LL64_H) && !defined(_UAPI_ASM_GENERIC_INT_L64_H) typedef uint8_t __u8; typedef uint16_t __u16; typedef uint32_t __u32; typedef uint64_t __u64; typedef int32_t __s32; +#endif #ifndef __kernel_rwf_t typedef int __kernel_rwf_t; From b1618475ccf5d901bc91b9253a707630967b5173 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Sun, 3 Aug 2025 17:11:41 -0700 Subject: [PATCH 2/4] [1.6] Fix: FileDescriptor.duplicate(as:) returns an invalid file descriptor on Windows FileDescriptor.duplicate(as:) is backed by dup2 on Unix, and _dup2 on Windows. On Unix, dup2 returns its second argument. On Windows, _dup2 instead returns 0 on success and -1 on error. This results in the newly returned FileDescriptor object always containing a '0' file descriptor rather than the newly created file descriptor, in violation of the documented behavior. Account for the platform difference in the syscall wrapper to fix this. Closes #192 (cherry picked from commit b2711a872a8f5ae979cc326f75d7548175376663) --- Sources/System/Internals/WindowsSyscallAdapters.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/System/Internals/WindowsSyscallAdapters.swift b/Sources/System/Internals/WindowsSyscallAdapters.swift index 6437d16..da5dfb8 100644 --- a/Sources/System/Internals/WindowsSyscallAdapters.swift +++ b/Sources/System/Internals/WindowsSyscallAdapters.swift @@ -135,7 +135,11 @@ internal func dup(_ fd: Int32) -> Int32 { @inline(__always) internal func dup2(_ fd: Int32, _ fd2: Int32) -> Int32 { - _dup2(fd, fd2) + // _dup2 returns 0 to indicate success. + if _dup2(fd, fd2) == 0 { + return fd2 + } + return -1 } @inline(__always) From 1c1ad1d3f486667658b28a8f3bd6ae334e6f11ec Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Wed, 17 Sep 2025 12:33:32 -0700 Subject: [PATCH 3/4] [workflows] change ubuntus to test against --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 35d5022..a5b2889 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,7 +9,7 @@ jobs: name: Test uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: - linux_os_versions: '["jammy", "focal"]' + linux_os_versions: '["noble", "jammy", "focal"]' enable_macos_checks: true # FIXME: https://github.com/swiftlang/github-workflows/pull/140 # Xcode 16.0 and 16.1 are not actually available From 18a52c47292e4c0dcced61dc47ef13b8fe857b81 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Thu, 18 Sep 2025 10:47:41 -0700 Subject: [PATCH 4/4] [workflows] declare 2D exclusions --- .github/workflows/pull_request.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a5b2889..4c3a66c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,6 +10,7 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: linux_os_versions: '["noble", "jammy", "focal"]' + linux_exclude_swift_versions: '[{"os_version": "focal", "swift_version": "nightly-main"}, {"os_version": "focal", "swift_version": "nightly-6.2"}, {"os_version": "focal", "swift_version": "6.2"}, {"os_version": "noble", "swift_version": "5.9"}, {"os_version": "noble", "swift_version": "5.10"}]' enable_macos_checks: true # FIXME: https://github.com/swiftlang/github-workflows/pull/140 # Xcode 16.0 and 16.1 are not actually available @@ -19,6 +20,10 @@ jobs: {"xcode_version": "16.1"}, ] swift_flags: "-Xbuild-tools-swiftc -DSYSTEM_CI" + enable_linux_static_sdk_build: true + linux_static_sdk_exclude_swift_versions: '[{"os_version": "focal", "swift_version": "nightly-main"}, {"os_version": "focal", "swift_version": "nightly-6.2"}, {"os_version": "focal", "swift_version": "6.2"}]' + enable_wasm_sdk_build: true + wasm_exclude_swift_versions: '[{"os_version": "focal", "swift_version": "nightly-main"}, {"os_version": "focal", "swift_version": "nightly-6.2"}, {"os_version": "focal", "swift_version": "6.2"}]' build-abi-stable: name: Build ABI Stable