Skip to content

Commit 2d28cc3

Browse files
committed
Start building the 6.2 release on the CI
1 parent 677297d commit 2d28cc3

8 files changed

+55
-277
lines changed

.github/workflows/sdks.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
id: version
2525
run: |
2626
if [ ${{ matrix.version }} = 'release' ]; then
27-
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/apple/swift/releases | grep -m1 swift-6.1 | cut -d- -f2)
27+
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/apple/swift/releases | grep -m1 swift-6.2 | cut -d- -f2)
2828
SWIFT_TAG="swift-${LATEST_TOOLCHAIN_VERSION}-RELEASE"
2929
elif [ ${{ matrix.version }} = 'devel' ]; then
3030
LATEST_TOOLCHAIN_VERSION=$(curl -sL https://github.com/apple/swift/tags | grep -m1 swift-6.2-DEV | cut -d- -f8-10)
@@ -129,29 +129,22 @@ jobs:
129129
130130
git apply -C1 swift-android.patch swift-android-ci.patch
131131
BUILD_FLAG="--foundation-cmake-options=-DCMAKE_SHARED_LINKER_FLAGS=''"
132-
if ${{ matrix.version == 'release' }}; then
133-
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
134-
BUILD_FLAG+=" --build-swift-tools=0"
135-
LSP_BUILD="--sourcekit-lsp"
136-
git apply swift-android-ci-release.patch swift-android-testing-release.patch
132+
if ${{ matrix.version == 'trunk' }}; then
133+
git apply swift-android-trunk-libdispatch.patch
134+
BUILD_FLAG+=" --libdispatch-cmake-options=-DCMAKE_SHARED_LINKER_FLAGS=''"
137135
else
138-
if ${{ matrix.version == 'trunk' }}; then
139-
git apply swift-android-trunk-libdispatch.patch
140-
BUILD_FLAG+=" --libdispatch-cmake-options=-DCMAKE_SHARED_LINKER_FLAGS=''"
141-
else
142-
git apply swift-android-ci-devel.patch swift-android-devel.patch
136+
git apply swift-android-ci-except-trunk.patch swift-android-except-trunk.patch
137+
if ${{ matrix.version == 'release' }}; then
138+
git apply swift-android-testing-release.patch
143139
fi
144-
git apply -C2 swift-android-ci-except-release.patch
145-
BUILD_FLAG+=" --cross-compile-build-swift-tools=False"
146-
SDK_NAME=$(ls | grep swift-${{ matrix.version }}-android-aarch64)
147-
perl -pi -e 's%33%24%' $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/execinfo.h
148140
fi
149141
142+
perl -pi -e 's%33%24%' $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/execinfo.h
150143
perl -pi -e 's%String\(cString: getpass%\"fake\" //%' swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift
151144
perl -pi -e "s%swift/android',%swift/android', '-Xlinker', '-landroid-spawn',%" sourcekit-lsp/Utilities/build-script-helper.py
152145
VERSION="$(echo ${{ steps.version.outputs.tag }} | cut -f1,2 -d-)-${{ matrix.version }}"
153146
154-
# e.g. swift-6.1-release-android-24-sdk
147+
# e.g. swift-6.2-release-android-24-sdk
155148
SDK_DIR=$VERSION-android-${ANDROID_API_LEVEL}-sdk
156149
ROOT=android-${NDK_VERSION}-sysroot
157150
SYSROOT=$SDK_DIR/$ROOT
@@ -171,7 +164,7 @@ jobs:
171164
cp $SYSROOT/usr/include/execinfo.h ${SDK_NAME}/usr/include
172165
perl -pi -e 's%33%24%' ${SDK_NAME}/usr/include/execinfo.h
173166
174-
./swift/utils/build-script -RA --skip-build-cmark --build-llvm=0 --android --android-ndk $ANDROID_NDK_HOME --android-arch $arch --android-api-level $ANDROID_API_LEVEL --native-swift-tools-path=${TOOLCHAIN}/bin --native-clang-tools-path=${TOOLCHAIN}/bin --cross-compile-hosts=android-$arch --cross-compile-deps-path=$SDK --skip-local-build --build-swift-static-stdlib --xctest --install-swift --install-libdispatch --install-foundation --install-xctest --install-destdir=$SDK --swift-install-components='compiler;clang-resource-dir-symlink;license;stdlib;sdk-overlay' --cross-compile-append-host-target-to-destdir=False -b --install-llbuild --swift-testing --install-swift-testing -p $BUILD_FLAG $LSP_BUILD
167+
./swift/utils/build-script -RA --skip-build-cmark --build-llvm=0 --android --android-ndk $ANDROID_NDK_HOME --android-arch $arch --android-api-level $ANDROID_API_LEVEL --native-swift-tools-path=${TOOLCHAIN}/bin --native-clang-tools-path=${TOOLCHAIN}/bin --cross-compile-hosts=android-$arch --cross-compile-deps-path=$SDK --skip-local-build --build-swift-static-stdlib --xctest --install-swift --install-libdispatch --install-foundation --install-xctest --install-destdir=$SDK --swift-install-components='compiler;clang-resource-dir-symlink;license;stdlib;sdk-overlay' --cross-compile-append-host-target-to-destdir=False --cross-compile-build-swift-tools=False -b --install-llbuild --swift-testing --install-swift-testing -p $BUILD_FLAG
175168
176169
rm $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/swift
177170

get-packages-and-swift-source.swift

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ var swiftRepos = ["llvm-project", "swift", "swift-experimental-string-processing
1313

1414
let extraSwiftRepos = ["swift-llbuild", "swift-package-manager", "swift-driver",
1515
"swift-tools-support-core", "swift-argument-parser", "swift-crypto",
16-
"Yams", "indexstore-db", "sourcekit-lsp", "swift-system", "swift-lmdb",
17-
"swift-certificates", "swift-asn1", "swift-toolchain-sqlite"]
16+
"indexstore-db", "sourcekit-lsp", "swift-system", "swift-lmdb",
17+
"swift-certificates", "swift-asn1", "swift-toolchain-sqlite", "swift-build"]
1818
let appleRepos = ["swift-argument-parser", "swift-crypto", "swift-system", "swift-collections", "swift-certificates", "swift-asn1"]
19-
let renameRepos = ["swift-llbuild" : "llbuild", "swift-package-manager" : "swiftpm", "Yams" : "yams"]
19+
let renameRepos = ["swift-llbuild" : "llbuild", "swift-package-manager" : "swiftpm"]
2020
var repoTags = ["swift-system" : "1.5.0", "swift-collections" : "1.1.3", "swift-asn1" : "1.0.0",
21-
"swift-certificates" : "1.0.1", "Yams" : "5.0.6", "swift-argument-parser" : "1.4.0",
21+
"swift-certificates" : "1.0.1", "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 {
2424
swiftRepos += extraSwiftRepos
@@ -54,13 +54,9 @@ if tagExtract.numberOfMatches(in: SWIFT_TAG, range: tagRange) == 1 {
5454
}
5555

5656
if swiftBranch == "RELEASE" {
57-
repoTags["swift-system"] = "1.3.0"
5857
sdkDir = "swift-release-android-\(ANDROID_ARCH)-24-sdk"
5958
} else {
6059
sdkDir = "swift-\(swiftVersion == "" ? "trunk" : "devel")-android-\(ANDROID_ARCH)-\(swiftSnapshotDate)-24-sdk"
61-
if ProcessInfo.processInfo.environment["BUILD_SWIFT_PM"] != nil {
62-
swiftRepos += ["swift-build"]
63-
}
6460
if swiftVersion == "" {
6561
repoTags["swift-collections"] = "1.1.6"
6662
repoTags["swift-argument-parser"] = "1.5.1"
@@ -283,9 +279,7 @@ for repo in swiftRepos {
283279
print("Downloading and extracting \(repo) source")
284280
let tag = repoTags[repo] ?? SWIFT_TAG
285281
var repoOrg = "swiftlang"
286-
if repo == "Yams" {
287-
repoOrg = "jpsim"
288-
} else if appleRepos.contains(repo) {
282+
if appleRepos.contains(repo) {
289283
repoOrg = "apple"
290284
}
291285
_ = runCommand("curl", with: ["-f", "-L", "-O",

swift-android-ci-except-release.patch

Lines changed: 0 additions & 40 deletions
This file was deleted.
File renamed without changes.

swift-android-ci-release.patch

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

swift-android-ci.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,43 @@ diff --git a/swift-certificates/Sources/X509/Verifier/RFC5280/URIConstraints.swi
5353
#elseif canImport(Darwin)
5454
import Darwin
5555
#endif
56+
diff --git a/swift-build/Sources/SWBUtil/Lock.swift b/swift-build/Sources/SWBUtil/Lock.swift
57+
index 2135ce6..fbff6f6 100644
58+
--- a/swift-build/Sources/SWBUtil/Lock.swift
59+
+++ b/swift-build/Sources/SWBUtil/Lock.swift
60+
@@ -14,6 +14,8 @@
61+
public import os
62+
#elseif os(Windows)
63+
public import WinSDK
64+
+#elseif canImport(Android)
65+
+public import Android
66+
#else
67+
public import SWBLibc
68+
#endif
69+
diff --git a/swiftpm/Sources/swift-build-prebuilts/BuildPrebuilts.swift b/swiftpm/Sources/swift-build-prebuilts/BuildPrebuilts.swift
70+
index ffa6b7f3f..abe453232 100644
71+
--- a/swiftpm/Sources/swift-build-prebuilts/BuildPrebuilts.swift
72+
+++ b/swiftpm/Sources/swift-build-prebuilts/BuildPrebuilts.swift
73+
@@ -24,6 +24,10 @@ import struct TSCBasic.ByteString
74+
import struct TSCBasic.SHA256
75+
import Workspace
76+
77+
+#if canImport(Android)
78+
+import Android
79+
+#endif
80+
+
81+
// Format for the .zip.json files.
82+
struct Artifact: Codable {
83+
var platform: Workspace.PrebuiltsManifest.Platform
84+
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
85+
index 156bf002a..d891da556 100755
86+
--- a/swiftpm/Utilities/bootstrap
87+
+++ b/swiftpm/Utilities/bootstrap
88+
@@ -941,6 +941,7 @@ def get_swiftpm_flags(args):
89+
build_flags += ["--arch", "x86_64", "--arch", "arm64"]
90+
elif cross_compile_hosts.startswith('android-'):
91+
build_flags.extend(["--destination", args.cross_compile_config])
92+
+ build_flags.extend(["-Xlinker", "-landroid-spawn"])
93+
else:
94+
logging.error("cannot cross-compile for %s", cross_compile_hosts)
95+
raise SystemExit(1)
File renamed without changes.

0 commit comments

Comments
 (0)