Skip to content

Commit 6f91402

Browse files
committed
Only apply build-script patch on CI to other branches since it was upstreamed to trunk
1 parent 145f767 commit 6f91402

File tree

4 files changed

+81
-40
lines changed

4 files changed

+81
-40
lines changed

.github/workflows/sdks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ jobs:
132132
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
133133
else
134134
if [ ${{ matrix.version }} = 'devel' ]; then
135+
git apply swift-android-devel.patch
135136
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
136137
fi
137138
git apply swift-android-ci-except-release.patch swift-android-foundation-except-release.patch

swift-android-devel.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl
2+
index 16e05052609..114e768bdbb 100755
3+
--- a/swift/utils/build-script-impl
4+
+++ b/swift/utils/build-script-impl
5+
@@ -2409,6 +2409,11 @@ for host in "${ALL_HOSTS[@]}"; do
6+
continue
7+
fi
8+
9+
+ if [[ "${BUILD_SWIFT_TOOLS}" == "0" ]]; then
10+
+ echo "Skipping building Foundation Macros for ${host}, because the host tools are not being built"
11+
+ continue
12+
+ fi
13+
+
14+
if [[ "${SKIP_CLEAN_FOUNDATION}" == "0" ]]
15+
then
16+
# The Swift project might have been changed, but CMake might
17+
@@ -2558,11 +2563,6 @@ for host in "${ALL_HOSTS[@]}"; do
18+
-DCMAKE_FIND_ROOT_PATH:PATH="${CROSS_COMPILE_DEPS_PATH}"
19+
)
20+
fi
21+
- if [[ "${host}" == "android-"* ]]; then
22+
- cmake_options+=(
23+
- -DCMAKE_HAVE_LIBC_PTHREAD=True
24+
- )
25+
- fi
26+
;;
27+
libdispatch|libdispatch_static)
28+
LIBDISPATCH_BUILD_DIR=$(build_directory ${host} ${product})
29+
@@ -3009,6 +3009,11 @@ for host in "${ALL_HOSTS[@]}"; do
30+
continue
31+
fi
32+
33+
+ if [[ "${BUILD_SWIFT_TOOLS}" == "0" && "${product}" == "foundation_macros" ]]; then
34+
+ echo "Skipping installing Foundation Macros for ${host}, because the host tools are not being built"
35+
+ continue
36+
+ fi
37+
+
38+
if [[ -z "${INSTALL_FOUNDATION}" ]] ; then
39+
continue
40+
fi

swift-android-foundation-release.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,46 @@ index 78e7bda9976..dc25e5c3668 100644
1515
module _bits_stdatomic [system] {
1616
// Note: this module is not part of 'stdatomic'
1717
// as it depends on libc++ and forcing it to
18+
diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl
19+
index 16e05052609..114e768bdbb 100755
20+
--- a/swift/utils/build-script-impl
21+
+++ b/swift/utils/build-script-impl
22+
@@ -2409,6 +2409,11 @@ for host in "${ALL_HOSTS[@]}"; do
23+
continue
24+
fi
25+
26+
+ if [[ "${BUILD_SWIFT_TOOLS}" == "0" ]]; then
27+
+ echo "Skipping building Foundation Macros for ${host}, because the host tools are not being built"
28+
+ continue
29+
+ fi
30+
+
31+
if [[ "${SKIP_CLEAN_FOUNDATION}" == "0" ]]
32+
then
33+
# The Swift project might have been changed, but CMake might
34+
@@ -2558,11 +2563,6 @@ for host in "${ALL_HOSTS[@]}"; do
35+
-DCMAKE_FIND_ROOT_PATH:PATH="${CROSS_COMPILE_DEPS_PATH}"
36+
)
37+
fi
38+
- if [[ "${host}" == "android-"* ]]; then
39+
- cmake_options+=(
40+
- -DCMAKE_HAVE_LIBC_PTHREAD=True
41+
- )
42+
- fi
43+
;;
44+
libdispatch|libdispatch_static)
45+
LIBDISPATCH_BUILD_DIR=$(build_directory ${host} ${product})
46+
@@ -3009,6 +3009,11 @@ for host in "${ALL_HOSTS[@]}"; do
47+
continue
48+
fi
49+
50+
+ if [[ "${BUILD_SWIFT_TOOLS}" == "0" && "${product}" == "foundation_macros" ]]; then
51+
+ echo "Skipping installing Foundation Macros for ${host}, because the host tools are not being built"
52+
+ continue
53+
+ fi
54+
+
55+
if [[ -z "${INSTALL_FOUNDATION}" ]] ; then
56+
continue
57+
fi
1858
diff --git a/swift-corelibs-foundation/Package.swift b/swift-corelibs-foundation/Package.swift
1959
--- a/swift-corelibs-foundation/Package.swift
2060
+++ b/swift-corelibs-foundation/Package.swift

swift-android.patch

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,3 @@
1-
diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl
2-
index 16e05052609..114e768bdbb 100755
3-
--- a/swift/utils/build-script-impl
4-
+++ b/swift/utils/build-script-impl
5-
@@ -2409,6 +2409,11 @@ for host in "${ALL_HOSTS[@]}"; do
6-
continue
7-
fi
8-
9-
+ if [[ "${BUILD_SWIFT_TOOLS}" == "0" ]]; then
10-
+ echo "Skipping building Foundation Macros for ${host}, because the host tools are not being built"
11-
+ continue
12-
+ fi
13-
+
14-
if [[ "${SKIP_CLEAN_FOUNDATION}" == "0" ]]
15-
then
16-
# The Swift project might have been changed, but CMake might
17-
@@ -2558,11 +2563,6 @@ for host in "${ALL_HOSTS[@]}"; do
18-
-DCMAKE_FIND_ROOT_PATH:PATH="${CROSS_COMPILE_DEPS_PATH}"
19-
)
20-
fi
21-
- if [[ "${host}" == "android-"* ]]; then
22-
- cmake_options+=(
23-
- -DCMAKE_HAVE_LIBC_PTHREAD=True
24-
- )
25-
- fi
26-
;;
27-
libdispatch|libdispatch_static)
28-
LIBDISPATCH_BUILD_DIR=$(build_directory ${host} ${product})
29-
@@ -3009,6 +3009,11 @@ for host in "${ALL_HOSTS[@]}"; do
30-
continue
31-
fi
32-
33-
+ if [[ "${BUILD_SWIFT_TOOLS}" == "0" && "${product}" == "foundation_macros" ]]; then
34-
+ echo "Skipping installing Foundation Macros for ${host}, because the host tools are not being built"
35-
+ continue
36-
+ fi
37-
+
38-
if [[ -z "${INSTALL_FOUNDATION}" ]] ; then
39-
continue
40-
fi
411
diff --git a/swift-corelibs-foundation/CMakeLists.txt b/swift-corelibs-foundation/CMakeLists.txt
422
index 7f290d16..95366592 100644
433
--- a/swift-corelibs-foundation/CMakeLists.txt

0 commit comments

Comments
 (0)