Skip to content

Commit 5cffea9

Browse files
committed
Don't build the devel snapshots on the CI till the first 6.2 snapshot tag
Also, start building trunk SwiftPM again just without swift-build, which has no snapshot tags yet, and check out the last Mar. 28 tag of trunk sourcekit-lsp for now as it isn't being tagged upstream recently, some infrastructure error.
1 parent 71bb7b0 commit 5cffea9

File tree

3 files changed

+16
-33
lines changed

3 files changed

+16
-33
lines changed

.github/workflows/sdks.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
version: [release, devel, trunk]
13+
version: [release, trunk]
1414
os: [ubuntu-24.04, macos-13]
1515
env:
1616
ANDROID_API_LEVEL: 24
@@ -127,10 +127,10 @@ jobs:
127127
done
128128
129129
git apply swift-android.patch
130-
git apply swift-android-ci.patch
130+
git apply -C1 swift-android-ci.patch
131131
if ${{ matrix.version == 'release' }}; then
132132
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
133-
LSP_BUILD="-p --sourcekit-lsp"
133+
LSP_BUILD="--sourcekit-lsp"
134134
git apply swift-android-ci-release.patch swift-android-testing-release.patch
135135
else
136136
git apply swift-android-ci-except-release.patch swift-android-testing-except-release.patch
@@ -153,9 +153,10 @@ jobs:
153153
SDK=`pwd`/$SDK_NAME
154154
if [ ${{ matrix.version }} = 'trunk' ]; then
155155
cp $SDK/usr/include/execinfo.h $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include
156+
export SWIFTPM_NO_SWBUILD_DEPENDENCY=1
156157
fi
157158
158-
./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 --build-swift-tools=0 --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 $LSP_BUILD
159+
./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 --build-swift-tools=0 --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 $LSP_BUILD
159160
160161
rm $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/swift
161162

get-packages-and-swift-source.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,14 @@ for repo in swiftRepos {
285285
if ProcessInfo.processInfo.environment["BUILD_SWIFT_PM"] != nil {
286286
for repo in extraSwiftRepos {
287287
if !fmd.fileExists(atPath: cwd.appendingPathComponent(renameRepos[repo] ?? repo)) {
288-
let tag = repoTags[repo] ?? SWIFT_TAG
288+
var tag = repoTags[repo] ?? SWIFT_TAG
289289
var repoOrg = "swiftlang"
290290
if repo == "Yams" {
291291
repoOrg = "jpsim"
292292
} else if appleRepos.contains(repo) {
293293
repoOrg = "apple"
294+
} else if swiftVersion == "" && repo == "sourcekit-lsp" {
295+
tag = "swift-DEVELOPMENT-SNAPSHOT-2025-03-28-a"
294296
}
295297
_ = runCommand("curl", with: ["-f", "-L", "-O",
296298
"https://github.com/\(repoOrg)/\(repo)/archive/refs/tags/\(tag).tar.gz"])
Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,12 @@
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
171
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
182
index 156bf002a..d891da556 100755
193
--- a/swiftpm/Utilities/bootstrap
204
+++ 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:
5+
@@ -941,6 +941,7 @@ def get_swiftpm_flags(args):
6+
build_flags += ["--arch", "x86_64", "--arch", "arm64"]
7+
elif cross_compile_hosts.startswith('android-'):
8+
build_flags.extend(["--destination", args.cross_compile_config])
9+
+ build_flags.extend(["-Xlinker", "-landroid-spawn"])
10+
else:
11+
logging.error("cannot cross-compile for %s", cross_compile_hosts)
12+
raise SystemExit(1)

0 commit comments

Comments
 (0)