Skip to content

Commit 54a5d57

Browse files
committed
Remove upstreamed 6.2 devel patch from CI and add another one that hasn't been upstreamed yet
1 parent 5de8b7d commit 54a5d57

File tree

2 files changed

+50
-39
lines changed

2 files changed

+50
-39
lines changed

.github/workflows/sdks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,19 @@ jobs:
125125
ANDROID_ARCH=aarch64 BUILD_SWIFT_PM=1 ${TOOLCHAIN}/bin/swift get-packages-and-swift-source.swift
126126
127127
git apply -C1 swift-android.patch swift-android-ci.patch
128-
BUILD_FLAG="--build-swift-tools=0"
129128
if ${{ matrix.version == 'release' }}; then
130129
perl -pi -e 's%r26%ndk/27%' swift/stdlib/cmake/modules/AddSwiftStdlib.cmake
130+
BUILD_FLAG="--build-swift-tools=0"
131131
LSP_BUILD="--sourcekit-lsp"
132132
git apply swift-android-ci-release.patch swift-android-testing-release.patch
133133
else
134134
if ${{ matrix.version == 'trunk' }}; then
135-
BUILD_FLAG="--cross-compile-build-swift-tools=0"
136135
git apply swift-android-trunk-libdispatch.patch
137136
else
138137
git apply swift-android-devel.patch
139138
fi
140139
git apply -C2 swift-android-ci-except-release.patch swift-android-testing-except-release.patch
140+
BUILD_FLAG="--cross-compile-build-swift-tools=0"
141141
SDK_NAME=$(ls | grep swift-${{ matrix.version }}-android-aarch64)
142142
perl -pi -e 's%33%24%' $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/execinfo.h
143143
fi

swift-android-devel.patch

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,51 @@
1-
diff --git a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
2-
index 5769a3317e..916a7accbb 100644
3-
--- a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
4-
+++ b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
5-
@@ -1948,7 +1948,7 @@ CF_CROSS_PLATFORM_EXPORT void *_CFReallocf(void *ptr, size_t size) {
6-
#endif
7-
}
1+
diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl
2+
index cfbf761ca62..6e538161f83 100755
3+
--- a/swift/utils/build-script-impl
4+
+++ b/swift/utils/build-script-impl
5+
@@ -292,6 +292,7 @@ KNOWN_SETTINGS=(
6+
cross-compile-install-prefixes "" "semicolon-separated list of install prefixes to use for the cross-compiled hosts. The list expands, so if there are more cross-compile hosts than prefixes, unmatched hosts use the last prefix in the list"
7+
cross-compile-deps-path "" "path for CMake to look for cross-compiled library dependencies, such as libXML2"
8+
cross-compile-append-host-target-to-destdir "1" "turns on appending the host target name of each cross-compiled toolchain to its install-destdir, to keep them separate from the natively-built toolchain"
9+
+ cross-compile-build-swift-tools "1" "set to 1 to cross-compile the Swift host tools, like the Swift compiler"
10+
skip-merge-lipo-cross-compile-tools "" "set to skip running merge-lipo after installing cross-compiled host Swift tools"
11+
coverage-db "" "If set, coverage database to use when prioritizing testing"
12+
skip-local-host-install "" "If we are cross-compiling multiple targets, skip an install pass locally if the hosts match"
13+
@@ -1707,6 +1708,12 @@ for host in "${ALL_HOSTS[@]}"; do
14+
"${cmake_options[@]}"
15+
-DLLVM_TABLEGEN=$(build_directory "${LOCAL_HOST}" llvm)/bin/llvm-tblgen
16+
-DSWIFT_INCLUDE_TEST_BINARIES:BOOL=FALSE
17+
+ -DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${CROSS_COMPILE_BUILD_SWIFT_TOOLS}")
18+
+ )
19+
+ else
20+
+ cmake_options=(
21+
+ "${cmake_options[@]}"
22+
+ -DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${BUILD_SWIFT_TOOLS}")
23+
)
24+
fi
825

9-
-#if TARGET_OS_ANDROID
10-
+#if TARGET_OS_ANDROID && __ANDROID_API__ < 28
26+
@@ -1779,7 +1786,6 @@ for host in "${ALL_HOSTS[@]}"; do
27+
-DSWIFT_NATIVE_LLVM_TOOLS_PATH:STRING="${native_llvm_tools_path}"
28+
-DSWIFT_NATIVE_CLANG_TOOLS_PATH:STRING="${native_clang_tools_path}"
29+
-DSWIFT_NATIVE_SWIFT_TOOLS_PATH:STRING="${native_swift_tools_path}"
30+
- -DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${BUILD_SWIFT_TOOLS}")
31+
-DSWIFT_BUILD_CLANG_OVERLAYS:BOOL=$(true_false "${BUILD_SWIFT_CLANG_OVERLAYS}")
32+
-DSWIFT_BUILD_REMOTE_MIRROR:BOOL=$(true_false "${BUILD_SWIFT_REMOTE_MIRROR}")
33+
-DSWIFT_STDLIB_SIL_DEBUGGING:BOOL=$(true_false "${BUILD_SIL_DEBUGGING_STDLIB}")
34+
@@ -2336,7 +2336,7 @@ for host in "${ALL_HOSTS[@]}"; do
35+
continue
36+
fi
1137

12-
#include <dlfcn.h>
13-
#include <spawn.h>
14-
@@ -2277,6 +2277,10 @@ CF_EXPORT int _CFPosixSpawnFileActionsAddClose(_CFPosixSpawnFileActionsRef file_
15-
return _CFPosixSpawnFileActionsAddCloseImpl(file_actions, filedes);
16-
}
38+
- if [[ "${BUILD_SWIFT_TOOLS}" == "0" ]]; then
39+
+ if [[ "${CROSS_COMPILE_BUILD_SWIFT_TOOLS}" == "0" ]]; then
40+
echo "Skipping building Foundation Macros for ${host}, because the host tools are not being built"
41+
continue
42+
fi
43+
@@ -2925,7 +2925,7 @@ for host in "${ALL_HOSTS[@]}"; do
44+
continue
45+
fi
1746

18-
+CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_actions, const char *path) {
19-
+ return ENOSYS;
20-
+}
21-
+
22-
CF_EXPORT int _CFPosixSpawn(pid_t *_CF_RESTRICT pid, const char *_CF_RESTRICT path, _CFPosixSpawnFileActionsRef file_actions, _CFPosixSpawnAttrRef _Nullable _CF_RESTRICT attrp, char *_Nullable const argv[_Nullable _CF_RESTRICT], char *_Nullable const envp[_Nullable _CF_RESTRICT]) {
23-
_CFPosixSpawnInitialize();
24-
return _CFPosixSpawnImpl(pid, path, file_actions, attrp, argv, envp);
25-
@@ -2317,12 +2317,13 @@ CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_act
26-
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
27-
// - Amazon Linux 2 (EoL mid-2025)
28-
return ENOSYS;
29-
- #elif defined(__OpenBSD__) || defined(__QNX__)
30-
+ #elif defined(__OpenBSD__) || defined(__QNX__) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
31-
// Currently missing as of:
32-
// - OpenBSD 7.5 (April 2024)
33-
// - QNX 8 (December 2023)
34-
+ // - Android 13
35-
return ENOSYS;
36-
- #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || (defined(__ANDROID__) && __ANDROID_API__ >= 34) || defined(__musl__)
37-
+ #elif defined(__GLIBC__) || TARGET_OS_DARWIN || defined(__FreeBSD__) || defined(__ANDROID__) || defined(__musl__)
38-
// Pre-standard posix_spawn_file_actions_addchdir_np version available in:
39-
// - Solaris 11.3 (October 2015)
40-
// - Glibc 2.29 (February 2019)
47+
- if [[ "${BUILD_SWIFT_TOOLS}" == "0" && "${product}" == "foundation_macros" ]]; then
48+
+ if [[ "${CROSS_COMPILE_BUILD_SWIFT_TOOLS}" == "0" && "${product}" == "foundation_macros" ]]; then
49+
echo "Skipping installing Foundation Macros for ${host}, because the host tools are not being built"
50+
continue
51+
fi

0 commit comments

Comments
 (0)