forked from finagolfin/swift-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswift-android-ci-except-release.patch
More file actions
112 lines (108 loc) · 4.73 KB
/
swift-android-ci-except-release.patch
File metadata and controls
112 lines (108 loc) · 4.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
diff --git a/swift-build/Sources/SWBUtil/FSProxy.swift b/swift-build/Sources/SWBUtil/FSProxy.swift
index b446d21..f88f3c3 100644
--- a/swift-build/Sources/SWBUtil/FSProxy.swift
+++ b/swift-build/Sources/SWBUtil/FSProxy.swift
@@ -49,7 +49,7 @@ public struct FileInfo: Equatable, Sendable {
#if os(Windows)
return (statBuf.st_mode & UInt16(ucrt.S_IFREG)) != 0
#else
- return (statBuf.st_mode & S_IFREG) != 0
+ return (mode_t(statBuf.st_mode) & S_IFREG) != 0
#endif
}
@@ -57,7 +57,7 @@ public struct FileInfo: Equatable, Sendable {
#if os(Windows)
return (statBuf.st_mode & UInt16(ucrt.S_IFDIR)) != 0
#else
- return (statBuf.st_mode & S_IFDIR) != 0
+ return (mode_t(statBuf.st_mode) & S_IFDIR) != 0
#endif
}
@@ -65,7 +65,7 @@ public struct FileInfo: Equatable, Sendable {
#if os(Windows)
return (statBuf.st_mode & UInt16(S_IFLNK)) == S_IFLNK
#else
- return (statBuf.st_mode & S_IFMT) == S_IFLNK
+ return (mode_t(statBuf.st_mode) & S_IFMT) == S_IFLNK
#endif
}
@@ -75,7 +75,7 @@ public struct FileInfo: Equatable, Sendable {
// Don't use FileManager.isExecutableFile due to https://github.com/swiftlang/swift-foundation/issues/860
return (statBuf.st_mode & UInt16(_S_IEXEC)) != 0
#else
- return (statBuf.st_mode & S_IXUSR) != 0
+ return (mode_t(statBuf.st_mode) & S_IXUSR) != 0
#endif
}
@@ -1395,9 +1395,9 @@ public class PseudoFS: FSProxy, @unchecked Sendable {
#else
info.st_mtimespec = timespec(tv_sec: time_t(node.timestamp), tv_nsec: 0)
#endif
- info.st_size = off_t(contents.bytes.count)
- info.st_dev = node.device
- info.st_ino = node.inode
+ info.st_size = numericCast(contents.bytes.count)
+ info.st_dev = numericCast(node.device)
+ info.st_ino = numericCast(node.inode)
return createFileInfo(info)
case .directory(let dir):
var info = stat()
@@ -1405,12 +1405,12 @@ public class PseudoFS: FSProxy, @unchecked Sendable {
info.st_mode = UInt16(ucrt.S_IFDIR)
info.st_mtimespec = timespec(tv_sec: Int64(node.timestamp), tv_nsec: 0)
#else
- info.st_mode = S_IFDIR
+ info.st_mode = numericCast(S_IFDIR)
info.st_mtimespec = timespec(tv_sec: time_t(node.timestamp), tv_nsec: 0)
#endif
- info.st_size = off_t(dir.contents.count)
- info.st_dev = node.device
- info.st_ino = node.inode
+ info.st_size = numericCast(dir.contents.count)
+ info.st_dev = numericCast(node.device)
+ info.st_ino = numericCast(node.inode)
return createFileInfo(info)
case .symlink(_):
var info = stat()
@@ -1418,12 +1418,12 @@ public class PseudoFS: FSProxy, @unchecked Sendable {
info.st_mode = UInt16(S_IFLNK)
info.st_mtimespec = timespec(tv_sec: Int64(node.timestamp), tv_nsec: 0)
#else
- info.st_mode = S_IFLNK
+ info.st_mode = numericCast(S_IFLNK)
info.st_mtimespec = timespec(tv_sec: time_t(node.timestamp), tv_nsec: 0)
#endif
- info.st_size = off_t(0)
- info.st_dev = node.device
- info.st_ino = node.inode
+ info.st_size = numericCast(0)
+ info.st_dev = numericCast(node.device)
+ info.st_ino = numericCast(node.inode)
return createFileInfo(info)
}
}
diff --git a/swift-build/Sources/SWBUtil/Lock.swift b/swift-build/Sources/SWBUtil/Lock.swift
index 2135ce6..fbff6f6 100644
--- a/swift-build/Sources/SWBUtil/Lock.swift
+++ b/swift-build/Sources/SWBUtil/Lock.swift
@@ -14,6 +14,8 @@
public import os
#elseif os(Windows)
public import WinSDK
+#elseif canImport(Android)
+public import Android
#else
public import SWBLibc
#endif
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
index 156bf002a..d891da556 100755
--- a/swiftpm/Utilities/bootstrap
+++ b/swiftpm/Utilities/bootstrap
@@ -941,6 +941,7 @@ def get_swiftpm_flags(args):
build_flags += ["--arch", "x86_64", "--arch", "arm64"]
elif cross_compile_hosts.startswith('android-'):
build_flags.extend(["--destination", args.cross_compile_config])
+ build_flags.extend(["-Xlinker", "-landroid-spawn"])
else:
logging.error("cannot cross-compile for %s", cross_compile_hosts)
raise SystemExit(1)