From e133abb3e0dab21627b98bbc8512abc86d53efb0 Mon Sep 17 00:00:00 2001 From: Jonathan Flat Date: Mon, 3 Nov 2025 18:05:50 -0700 Subject: [PATCH 1/3] Fix Stat build on Android --- Sources/System/FileSystem/Stat.swift | 16 ++++++++-------- Sources/System/Internals/CInterop.swift | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/System/FileSystem/Stat.swift b/Sources/System/FileSystem/Stat.swift index c335cf80..e30e2b16 100644 --- a/Sources/System/FileSystem/Stat.swift +++ b/Sources/System/FileSystem/Stat.swift @@ -280,8 +280,8 @@ public struct Stat: RawRepresentable, Sendable { /// The corresponding C property is `st_dev`. @_alwaysEmitIntoClient public var deviceID: DeviceID { - get { DeviceID(rawValue: rawValue.st_dev) } - set { rawValue.st_dev = newValue.rawValue } + get { DeviceID(rawValue: numericCast(rawValue.st_dev)) } + set { rawValue.st_dev = numericCast(newValue.rawValue) } } /// Inode number @@ -289,8 +289,8 @@ public struct Stat: RawRepresentable, Sendable { /// The corresponding C property is `st_ino`. @_alwaysEmitIntoClient public var inode: Inode { - get { Inode(rawValue: rawValue.st_ino) } - set { rawValue.st_ino = newValue.rawValue } + get { Inode(rawValue: numericCast(rawValue.st_ino)) } + set { rawValue.st_ino = numericCast(newValue.rawValue) } } /// File mode @@ -298,8 +298,8 @@ public struct Stat: RawRepresentable, Sendable { /// The corresponding C property is `st_mode`. @_alwaysEmitIntoClient public var mode: FileMode { - get { FileMode(rawValue: rawValue.st_mode) } - set { rawValue.st_mode = newValue.rawValue } + get { FileMode(rawValue: numericCast(rawValue.st_mode)) } + set { rawValue.st_mode = numericCast(newValue.rawValue) } } /// File type for the given mode @@ -366,8 +366,8 @@ public struct Stat: RawRepresentable, Sendable { /// The corresponding C property is `st_rdev`. @_alwaysEmitIntoClient public var specialDeviceID: DeviceID { - get { DeviceID(rawValue: rawValue.st_rdev) } - set { rawValue.st_rdev = newValue.rawValue } + get { DeviceID(rawValue: numericCast(rawValue.st_rdev)) } + set { rawValue.st_rdev = numericCast(newValue.rawValue) } } /// Total size, in bytes diff --git a/Sources/System/Internals/CInterop.swift b/Sources/System/Internals/CInterop.swift index 46406631..7f85b9e7 100644 --- a/Sources/System/Internals/CInterop.swift +++ b/Sources/System/Internals/CInterop.swift @@ -21,7 +21,7 @@ import Musl #elseif canImport(WASILibc) import WASILibc #elseif canImport(Bionic) -@_implementationOnly import CSystem +import CSystem import Bionic #else #error("Unsupported Platform") From b252c123a7c07422d9b5b509b6722ed8daf94bf8 Mon Sep 17 00:00:00 2001 From: Jonathan Flat Date: Mon, 3 Nov 2025 18:11:02 -0700 Subject: [PATCH 2/3] Enable Android SDK build --- .github/workflows/pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 49f6dc9b..5d5a3d2c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -45,6 +45,7 @@ jobs: {"os_version": "focal", "swift_version": "6.2"}, {"os_version": "focal", "swift_version": "nightly-main"}, ] + enable_android_sdk_build: true build-abi-stable: name: Build ABI Stable From f9a2b9443b27437a5ba9869f861ce5494990e46f Mon Sep 17 00:00:00 2001 From: Jonathan Flat Date: Mon, 3 Nov 2025 18:29:15 -0700 Subject: [PATCH 3/3] Exclude focal for Android build --- .github/workflows/pull_request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5d5a3d2c..1b78b37d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -46,6 +46,10 @@ jobs: {"os_version": "focal", "swift_version": "nightly-main"}, ] enable_android_sdk_build: true + android_exclude_swift_versions: | + [ + {"os_version": "focal", "swift_version": "nightly-main"}, + ] build-abi-stable: name: Build ABI Stable