Skip to content

Commit 8bb330b

Browse files
committed
Adjust trunk SPM patch, use clang from prebuilt Swift toolchain to build SPM, and stop building swift-syntax on CI
1 parent afca9af commit 8bb330b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/sdks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ jobs:
114114
115115
if [ ${{ matrix.version }} = 'trunk' ]; then
116116
git apply package-patches/swiftpm-sqlite.patch
117+
BUILD_TRUNK_FLAG="--skip-early-swiftsyntax"
117118
else
118119
git apply swift-android-clang.patch
119120
fi
120121
121-
./swift/utils/build-script -RA --skip-build-cmark --build-llvm=0 --android --android-ndk $ANDROID_NDK --android-arch ${{ matrix.arch }} --android-api-level $ANDROID_API_LEVEL --build-swift-tools=0 --native-swift-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --native-clang-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --cross-compile-hosts=android-${{ matrix.arch }} --cross-compile-deps-path=$SDK --skip-local-build --build-swift-static-stdlib --xctest --skip-early-swift-driver --install-swift --install-libdispatch --install-foundation --install-xctest --install-destdir=$SDK --swift-install-components='clang-resource-dir-symlink;license;stdlib;sdk-overlay' --cross-compile-append-host-target-to-destdir=False -b -p --install-llbuild --sourcekit-lsp
122+
./swift/utils/build-script -RA --skip-build-cmark --build-llvm=0 --android --android-ndk $ANDROID_NDK --android-arch ${{ matrix.arch }} --android-api-level $ANDROID_API_LEVEL --build-swift-tools=0 --native-swift-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --native-clang-tools-path=`pwd`/$SWIFT_TAG-ubuntu20.04/usr/bin --cross-compile-hosts=android-${{ matrix.arch }} --cross-compile-deps-path=$SDK --skip-local-build --build-swift-static-stdlib --xctest --skip-early-swift-driver --install-swift --install-libdispatch --install-foundation --install-xctest --install-destdir=$SDK --swift-install-components='clang-resource-dir-symlink;license;stdlib;sdk-overlay' --cross-compile-append-host-target-to-destdir=False -b -p --install-llbuild --sourcekit-lsp $BUILD_TRUNK_FLAG
122123
123124
cp $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/$(echo ${{ matrix.arch }} | sed "s/v7//")-linux-android*/libc++_shared.so $SDK/usr/lib
124125
patchelf --set-rpath \$ORIGIN $SDK/usr/lib/swift/android/libdispatch.so

package-patches/swiftpm-sqlite.patch

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,25 @@ index 17ad9e3..953fffd 100755
1212
return env
1313

1414

15+
diff --git a/swift/utils/swift_build_support/swift_build_support/products/swiftpm.py b/swift/utils/swift_build_support/swift_build_support/products/swiftpm.py
16+
index 42a2ff914b4..3ea91589a57 100644
17+
--- a/swift/utils/swift_build_support/swift_build_support/products/swiftpm.py
18+
+++ b/swift/utils/swift_build_support/swift_build_support/products/swiftpm.py
19+
@@ -67,7 +67,7 @@ class SwiftPM(product.Product):
20+
21+
helper_cmd += [
22+
"--swiftc-path", swiftc,
23+
- "--clang-path", self.toolchain.cc,
24+
+ "--clang-path", os.path.join(toolchain_path, "bin", "clang"),
25+
"--cmake-path", self.toolchain.cmake,
26+
"--ninja-path", self.toolchain.ninja,
27+
"--build-dir", self.build_dir,
1528
diff --git a/swiftpm/Utilities/bootstrap b/swiftpm/Utilities/bootstrap
1629
index 085056de..1ded1a90 100755
1730
--- a/swiftpm/Utilities/bootstrap
1831
+++ b/swiftpm/Utilities/bootstrap
1932
@@ -615,6 +615,9 @@
20-
"SWIFT_DRIVER_SWIFT_EXEC=" + args.swiftc_path,
33+
"CC=" + args.clang_path
2134
]
2235

2336
+ if args.cross_compile_hosts and re.match('android-', args.cross_compile_hosts):

0 commit comments

Comments
 (0)