Skip to content

Commit 462749b

Browse files
committed
Update CI checkouts and patches for new devel 6.2 branch
1 parent 43b07ba commit 462749b

9 files changed

+140
-166
lines changed

.github/workflows/sdks.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
SWIFT_TAG="swift-DEVELOPMENT-SNAPSHOT-${LATEST_TOOLCHAIN_VERSION}-a"
3232
fi
3333
echo "tag=$SWIFT_TAG" >> $GITHUB_OUTPUT
34-
echo "key=$SWIFT_TAG-ndk-${NDK_VERSION}-patch-bundle" >> $GITHUB_OUTPUT
34+
echo "key=$SWIFT_TAG-ndk-${NDK_VERSION}-parch-bundle" >> $GITHUB_OUTPUT
3535
- name: Get cached SDK bundle
3636
id: cache-bundle
3737
uses: actions/cache/restore@v4
@@ -126,14 +126,14 @@ jobs:
126126
ANDROID_ARCH=$arch BUILD_SWIFT_PM=1 ${TOOLCHAIN}/bin/swift get-packages-and-swift-source.swift
127127
done
128128
129-
git apply swift-android.patch swift-crypto.patch swift-system.patch
130-
git apply -C1 swift-android-ci.patch
131-
if [ ${{ matrix.version }} != 'trunk' ]; then
129+
git apply swift-android.patch
130+
git apply swift-android-ci.patch
131+
if ${{ matrix.version == 'release' }}; then
132132
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
133133
LSP_BUILD="-p --sourcekit-lsp"
134-
git apply swift-android-testing-devel.patch
134+
git apply swift-android-ci-release.patch swift-android-testing-release.patch
135135
else
136-
git apply swift-android-trunk.patch
136+
git apply swift-android-ci-except-release.patch swift-android-testing-except-release.patch
137137
fi
138138
139139
perl -pi -e 's%String\(cString: getpass%\"fake\" //%' swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift

get-packages-and-swift-source.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let extraSwiftRepos = ["swift-llbuild", "swift-package-manager", "swift-driver",
1717
"swift-certificates", "swift-asn1", "swift-toolchain-sqlite"]
1818
let appleRepos = ["swift-argument-parser", "swift-crypto", "swift-system", "swift-collections", "swift-certificates", "swift-asn1"]
1919
let renameRepos = ["swift-llbuild" : "llbuild", "swift-package-manager" : "swiftpm", "Yams" : "yams"]
20-
var repoTags = ["swift-system" : "1.3.0", "swift-collections" : "1.1.3", "swift-asn1" : "1.0.0",
20+
var repoTags = ["swift-system" : "1.4.1", "swift-collections" : "1.1.3", "swift-asn1" : "1.0.0",
2121
"swift-certificates" : "1.0.1", "Yams" : "5.0.6", "swift-argument-parser" : "1.4.0",
2222
"swift-crypto" : "3.0.0", "swift-toolchain-sqlite" : "1.0.1"]
2323
if ProcessInfo.processInfo.environment["BUILD_SWIFT_PM"] != nil {
@@ -53,6 +53,7 @@ if tagExtract.numberOfMatches(in: SWIFT_TAG, range: tagRange) == 1 {
5353
}
5454

5555
if swiftBranch == "RELEASE" {
56+
repoTags["swift-system"] = "1.3.0"
5657
sdkDir = "swift-release-android-\(ANDROID_ARCH)-24-sdk"
5758
} else {
5859
sdkDir = "swift-\(swiftVersion == "" ? "trunk" : "devel")-android-\(ANDROID_ARCH)-\(swiftSnapshotDate)-24-sdk"

swift-android-ci-except-release.patch

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff --git a/sourcekit-lsp/Utilities/build-script-helper.py b/sourcekit-lsp/Utilities/build-script-helper.py
2+
index 88141cdd..d264f10c 100755
3+
--- a/sourcekit-lsp/Utilities/build-script-helper.py
4+
+++ b/sourcekit-lsp/Utilities/build-script-helper.py
5+
@@ -136,9 +136,6 @@ def get_swiftpm_options(swift_exec: str, args: argparse.Namespace, suppress_verb
6+
if '-android' in build_target:
7+
swiftpm_args += [
8+
'-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/android',
9+
+ '-Xlinker', '-landroid-spawn',
10+
- # SwiftPM will otherwise try to compile against GNU strerror_r on
11+
- '-Xlinker', '-landroid-spawn',
12+
- # Android and fail.
13+
- '-Xswiftc', '-Xcc', '-Xswiftc', '-U_GNU_SOURCE',
14+
]
15+
elif not build_os.startswith('macosx'):
16+
# Library rpath for swift, dispatch, Foundation, etc. when installing
17+
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
18+
index 156bf002a..d891da556 100755
19+
--- a/swiftpm/Utilities/bootstrap
20+
+++ b/swiftpm/Utilities/bootstrap
21+
@@ -934,10 +934,7 @@ def get_swiftpm_flags(args):
22+
build_flags.extend(["-Xcc", "-I/usr/local/include"])
23+
build_flags.extend(["-Xlinker", "-L/usr/local/lib"])
24+
25+
- # Don't use GNU strerror_r on Android.
26+
- if '-android' in args.build_target:
27+
- build_flags.extend(["-Xswiftc", "-Xcc", "-Xswiftc", "-U_GNU_SOURCE"])
28+
- build_flags.extend(["-Xlinker", "-landroid-spawn"])
29+
+ build_flags.extend(["-Xlinker", "-landroid-spawn"])
30+
31+
cross_compile_hosts = args.cross_compile_hosts
32+
if cross_compile_hosts:

swift-system.patch renamed to swift-android-ci-release.patch

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
diff --git a/sourcekit-lsp/Utilities/build-script-helper.py b/sourcekit-lsp/Utilities/build-script-helper.py
2+
index bd31bec..4469cab 100755
3+
--- a/sourcekit-lsp/Utilities/build-script-helper.py
4+
+++ b/sourcekit-lsp/Utilities/build-script-helper.py
5+
@@ -129,6 +129,7 @@ def get_swiftpm_options(swift_exec: str, args: argparse.Namespace) -> List[str]:
6+
swiftpm_args += [
7+
'-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/android',
8+
# SwiftPM will otherwise try to compile against GNU strerror_r on
9+
+ '-Xlinker', '-landroid-spawn',
10+
# Android and fail.
11+
'-Xswiftc', '-Xcc', '-Xswiftc', '-U_GNU_SOURCE',
12+
]
113
diff --git a/swift-system/Sources/System/Internals/CInterop.swift b/swift-system/Sources/System/Internals/CInterop.swift
214
index 13abc75..2ad551a 100644
315
--- a/swift-system/Sources/System/Internals/CInterop.swift
@@ -64,3 +76,30 @@ index 555f63b..f0db35f 100644
6476
#else
6577
#error("Unsupported Platform")
6678
#endif
79+
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
80+
index 085056de..1ded1a90 100755
81+
--- a/swiftpm/Utilities/bootstrap
82+
+++ b/swiftpm/Utilities/bootstrap
83+
@@ -827,6 +827,7 @@ def get_swiftpm_flags(args):
84+
# Don't use GNU strerror_r on Android.
85+
if '-android' in args.build_target:
86+
build_flags.extend(["-Xswiftc", "-Xcc", "-Xswiftc", "-U_GNU_SOURCE"])
87+
+ build_flags.extend(["-Xlinker", "-landroid-spawn"])
88+
89+
cross_compile_hosts = args.cross_compile_hosts
90+
if cross_compile_hosts:
91+
diff --git a/yams/Sources/Yams/Representer.swift b/yams/Sources/Yams/Representer.swift
92+
index a749c52..b74ef8e 100644
93+
--- a/yams/Sources/Yams/Representer.swift
94+
+++ b/yams/Sources/Yams/Representer.swift
95+
@@ -14,6 +14,10 @@ private let cpow: (_: Double, _: Double) -> Double = Darwin.pow
96+
#elseif os(Windows)
97+
import ucrt
98+
private let cpow: (_: Double, _: Double) -> Double = ucrt.pow
99+
+#elseif canImport(Bionic)
100+
+import CoreFoundation
101+
+import Bionic
102+
+private let cpow: (_: Double, _: Double) -> Double = Bionic.pow
103+
#else
104+
import CoreFoundation
105+
import Glibc

swift-android-ci.patch

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,6 @@ index 92a1ee38..52273afb 100644
4040
add_subdirectory(BuildSystem)
4141
-add_subdirectory(Ninja)
4242
+#add_subdirectory(Ninja)
43-
diff --git a/sourcekit-lsp/Utilities/build-script-helper.py b/sourcekit-lsp/Utilities/build-script-helper.py
44-
index bd31bec..4469cab 100755
45-
--- a/sourcekit-lsp/Utilities/build-script-helper.py
46-
+++ b/sourcekit-lsp/Utilities/build-script-helper.py
47-
@@ -129,6 +129,7 @@ def get_swiftpm_options(swift_exec: str, args: argparse.Namespace) -> List[str]:
48-
swiftpm_args += [
49-
'-Xlinker', '-rpath', '-Xlinker', '$ORIGIN/../lib/swift/android',
50-
# SwiftPM will otherwise try to compile against GNU strerror_r on
51-
+ '-Xlinker', '-landroid-spawn',
52-
# Android and fail.
53-
'-Xswiftc', '-Xcc', '-Xswiftc', '-U_GNU_SOURCE',
54-
]
5543
diff --git a/swift-argument-parser/Sources/ArgumentParser/Utilities/Platform.swift b/swift-argument-parser/Sources/ArgumentParser/Utilities/Platform.swift
5644
index b7fa046..a94e3b8 100644
5745
--- a/swift-argument-parser/Sources/ArgumentParser/Utilities/Platform.swift
@@ -96,30 +84,17 @@ diff --git a/swift-certificates/Sources/X509/Verifier/RFC5280/URIConstraints.swi
9684
#elseif canImport(Darwin)
9785
import Darwin
9886
#endif
99-
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
100-
index 085056de..1ded1a90 100755
101-
--- a/swiftpm/Utilities/bootstrap
102-
+++ b/swiftpm/Utilities/bootstrap
103-
@@ -827,6 +827,7 @@ def get_swiftpm_flags(args):
104-
# Don't use GNU strerror_r on Android.
105-
if '-android' in args.build_target:
106-
build_flags.extend(["-Xswiftc", "-Xcc", "-Xswiftc", "-U_GNU_SOURCE"])
107-
+ build_flags.extend(["-Xlinker", "-landroid-spawn"])
108-
109-
cross_compile_hosts = args.cross_compile_hosts
110-
if cross_compile_hosts:
111-
diff --git a/yams/Sources/Yams/Representer.swift b/yams/Sources/Yams/Representer.swift
112-
index a749c52..b74ef8e 100644
113-
--- a/yams/Sources/Yams/Representer.swift
114-
+++ b/yams/Sources/Yams/Representer.swift
115-
@@ -14,6 +14,10 @@ private let cpow: (_: Double, _: Double) -> Double = Darwin.pow
116-
#elseif os(Windows)
117-
import ucrt
118-
private let cpow: (_: Double, _: Double) -> Double = ucrt.pow
119-
+#elseif canImport(Bionic)
120-
+import CoreFoundation
121-
+import Bionic
122-
+private let cpow: (_: Double, _: Double) -> Double = Bionic.pow
87+
diff --git a/swift-crypto/Sources/Crypto/Key Derivation/HKDF.swift b/swift-crypto/Sources/Crypto/Key Derivation/HKDF.swift
88+
index 5f47c2f..4b5579e 100644
89+
--- a/swift-crypto/Sources/Crypto/Key Derivation/HKDF.swift
90+
+++ b/swift-crypto/Sources/Crypto/Key Derivation/HKDF.swift
91+
@@ -15,6 +15,9 @@
92+
@_exported import CryptoKit
12393
#else
124-
import CoreFoundation
125-
import Glibc
94+
import Foundation
95+
+#if canImport(Android)
96+
+import Android
97+
+#endif
98+
99+
/// A standards-based implementation of an HMAC-based Key Derivation Function
100+
/// (HKDF).
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
2+
index 468dc61..a90ae3d 100644
3+
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
4+
+++ b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
5+
@@ -2,6 +2,10 @@
6+
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
7+
if(CMAKE_Swift_COMPILER_TARGET)
8+
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
9+
+else()
10+
+ set(arg_list ${CMAKE_Swift_FLAGS})
11+
+ separate_arguments(arg_list)
12+
+ list(APPEND print_target_info_invocation ${arg_list})
13+
endif()
14+
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
15+
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
16+
diff --git a/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift b/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
17+
index 78227e3..e0db2e9 100644
18+
--- a/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
19+
+++ b/swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
20+
@@ -65,11 +65,11 @@ public struct Backtrace: Sendable {
21+
} else {
22+
initializedCount = .init(clamping: backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
23+
}
24+
-#elseif os(Android)
25+
+#elseif os(Androi)
26+
initializedCount = addresses.withMemoryRebound(to: UnsafeMutableRawPointer.self) { addresses in
27+
.init(clamping: backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
28+
}
29+
-#elseif os(Linux) || os(FreeBSD) || os(OpenBSD)
30+
+#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(Android)
31+
initializedCount = .init(clamping: backtrace(addresses.baseAddress!, .init(clamping: addresses.count)))
32+
#elseif os(Windows)
33+
initializedCount = Int(clamping: RtlCaptureStackBackTrace(0, ULONG(clamping: addresses.count), addresses.baseAddress!, nil))
34+
diff --git a/swift-testing/cmake/modules/PlatformInfo.cmake b/swift-testing/cmake/modules/PlatformInfo.cmake
35+
index 94c60ef..ab8a491 100644
36+
--- a/swift-testing/cmake/modules/PlatformInfo.cmake
37+
+++ b/swift-testing/cmake/modules/PlatformInfo.cmake
38+
@@ -9,6 +9,10 @@
39+
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
40+
if(CMAKE_Swift_COMPILER_TARGET)
41+
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
42+
+else()
43+
+ set(arg_list ${CMAKE_Swift_FLAGS})
44+
+ separate_arguments(arg_list)
45+
+ list(APPEND print_target_info_invocation ${arg_list})
46+
endif()
47+
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
48+
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"

swift-android-trunk.patch

Lines changed: 0 additions & 107 deletions
This file was deleted.

swift-crypto.patch

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)