Skip to content

Commit c01a313

Browse files
committed
gcpdw
1 parent c6e85b8 commit c01a313

File tree

8 files changed

+470
-12
lines changed

8 files changed

+470
-12
lines changed

swift-ci/sdks/android/build-docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ source ./scripts/toolchain-vars.sh
2727

2828
# Check-out and patch the sources
2929
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG}
30-
${WORKDIR}/source/swift-android-patches/apply-patches.sh ${WORKDIR}/source/swift-project
30+
${WORKDIR}/patches/apply-patches.sh ${WORKDIR}/source/swift-project
3131

3232
mkdir -p ${WORKDIR}/products
3333
chmod ugo+rwx ${WORKDIR}/products

swift-ci/sdks/android/build-local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fi
5252

5353
# Check-out and patch the sources
5454
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG}
55-
${WORKDIR}/source/swift-android-patches/apply-patches.sh ${WORKDIR}/source/swift-project
55+
${WORKDIR}/patches/apply-patches.sh ${WORKDIR}/source/swift-project
5656

5757
mkdir -p ${WORKDIR}/products
5858

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash -ex
2+
3+
patches_dir=$(dirname $(realpath -- "${BASH_SOURCE[0]}"))
4+
cd ${1}
5+
6+
# patch the patch, which seems to only be needed for an API less than 28
7+
# https://github.com/finagolfin/swift-android-sdk/blob/main/swift-android.patch#L110
8+
perl -pi -e 's/#if os\(Windows\)/#if os\(Android\)/g' ${patches_dir}/swift-android.patch
9+
10+
# remove the need to link in android-execinfo
11+
perl -pi -e 's;dispatch android-execinfo;dispatch;g' ${patches_dir}/swift-android.patch
12+
13+
case "${BUILD_SCHEME}" in
14+
release)
15+
git apply -v -C1 ${patches_dir}/swift-android.patch
16+
git apply -v -C1 ${patches_dir}/swift-android-testing-release.patch
17+
;;
18+
swift-*-branch)
19+
git apply -v -C1 ${patches_dir}/swift-android.patch
20+
git apply -v -C1 ${patches_dir}/swift-android-testing-except-release.patch
21+
;;
22+
development)
23+
git apply -v -C1 ${patches_dir}/swift-android.patch
24+
git apply -v -C1 ${patches_dir}/swift-android-trunk-libdispatch.patch
25+
git apply -v -C1 ${patches_dir}/swift-android-testing-except-release.patch
26+
;;
27+
*)
28+
echo "$0: invalid BUILD_SCHEME=${BUILD_SCHEME}"
29+
exit 1
30+
;;
31+
esac
32+
33+
perl -pi -e 's%String\(cString: getpass%\"fake\" //%' swiftpm/Sources/PackageRegistryCommand/PackageRegistryCommand+Auth.swift
34+
# disable backtrace() for Android (needs either API33+ or libandroid-execinfo, or to manually add in backtrace backport)
35+
perl -pi -e 's;os\(Android\);os\(AndroidDISABLED\);g' swift-testing/Sources/Testing/SourceAttribution/Backtrace.swift
36+
37+
# need to un-apply libandroid-spawn since we don't need it for API28+
38+
perl -pi -e 's;MATCHES "Android";MATCHES "AndroidDISABLED";g' llbuild/lib/llvm/Support/CMakeLists.txt
39+
perl -pi -e 's; STREQUAL Android\); STREQUAL AndroidDISABLED\);g' swift-corelibs-foundation/Sources/Foundation/CMakeLists.txt
40+
41+
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
diff --git a/swift/test/ClangImporter/pcm-emit-direct-cc1-mode.swift b/swift/test/ClangImporter/pcm-emit-direct-cc1-mode.swift
2+
index f5048b9e3d5..c227ef7b77d 100644
3+
--- a/swift/test/ClangImporter/pcm-emit-direct-cc1-mode.swift
4+
+++ b/swift/test/ClangImporter/pcm-emit-direct-cc1-mode.swift
5+
@@ -9,7 +9,7 @@
6+
// CHECK-DUMP: Module map file: {{.*[/\\]}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap
7+
8+
// Verify that the clang command-line used is cc1
9+
-// RUN: %FileCheck -check-prefix CHECK-CLANG -DTRIPLE=%target-triple %s < %t.diags.txt
10+
+// RUN: %FileCheck -check-prefix CHECK-CLANG -DTRIPLE=%module-target-triple %s < %t.diags.txt
11+
// CHECK-CLANG: clang importer cc1 args
12+
// CHECK-CLANG-SAME: '-o' '{{.*[/\\]}}script.pcm' '-fsyntax-only' '-x' 'objective-c' '{{.*[/\\]}}module.modulemap' '-triple' '[[TRIPLE]]'
13+
// CHECK-CLANG-SAME: '-fmodules'
14+
diff --git a/swift/test/IRGen/abitypes_arm.swift b/swift/test/IRGen/abitypes_arm.swift
15+
index 9428294483d..52bd8b10145 100644
16+
--- a/swift/test/IRGen/abitypes_arm.swift
17+
+++ b/swift/test/IRGen/abitypes_arm.swift
18+
@@ -11,6 +11,6 @@ class Foo {
19+
}
20+
}
21+
22+
-// armv7: define internal void @makeOne(ptr noalias sret({{.*}}) align 4 %agg.result, float{{( noundef)?}} %f, float{{( noundef)?}} %s)
23+
+// armv7: define internal void @makeOne(ptr{{( dead_on_unwind)?}} noalias{{( writable)?}} sret({{.*}}) align 4 %agg.result, float{{( noundef)?}} %f, float{{( noundef)?}} %s)
24+
// armv7s: define internal void @makeOne(ptr noalias sret({{.*}}) align 4 %agg.result, float %f, float %s)
25+
// armv7k: define internal %struct.One @makeOne(float {{.*}}%f, float {{.*}}%s)
26+
diff --git a/swift/test/Interop/Cxx/class/constructors-copy-module-interface.swift b/swift/test/Interop/Cxx/class/constructors-copy-module-interface.swift
27+
index 042c10e7d1d..254f6543b58 100644
28+
--- a/swift/test/Interop/Cxx/class/constructors-copy-module-interface.swift
29+
+++ b/swift/test/Interop/Cxx/class/constructors-copy-module-interface.swift
30+
@@ -1,4 +1,5 @@
31+
// RUN: %target-swift-ide-test -print-module -module-to-print=Constructors -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
32+
+// XFAIL: OS=linux-androideabi
33+
34+
// CHECK: struct TemplatedCopyConstructor
35+
// CHECK: struct TemplatedCopyConstructorWithExtraArg
36+
diff --git a/swift/test/Interop/Cxx/class/constructors-diagnostics.swift b/swift/test/Interop/Cxx/class/constructors-diagnostics.swift
37+
index aac01480660..8fa99fae7fb 100644
38+
--- a/swift/test/Interop/Cxx/class/constructors-diagnostics.swift
39+
+++ b/swift/test/Interop/Cxx/class/constructors-diagnostics.swift
40+
@@ -2,6 +2,7 @@
41+
42+
// This test uses -verify-additional-file, which do not work well on Windows.
43+
// UNSUPPORTED: OS=windows-msvc
44+
+// XFAIL: OS=linux-androideabi
45+
46+
import Constructors
47+
48+
diff --git a/swift/test/Interop/Cxx/class/constructors-module-interface.swift b/swift/test/Interop/Cxx/class/constructors-module-interface.swift
49+
index bf189b6e302..d2c3d65f03e 100644
50+
--- a/swift/test/Interop/Cxx/class/constructors-module-interface.swift
51+
+++ b/swift/test/Interop/Cxx/class/constructors-module-interface.swift
52+
@@ -1,4 +1,5 @@
53+
// RUN: %target-swift-ide-test -print-module -module-to-print=Constructors -I %S/Inputs/ -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
54+
+// XFAIL: OS=linux-androideabi
55+
56+
// CHECK: struct ExplicitDefaultConstructor {
57+
// CHECK-NEXT: init()
58+
diff --git a/swift/test/Interop/Cxx/class/constructors-silgen.swift b/swift/test/Interop/Cxx/class/constructors-silgen.swift
59+
index b1624ccccfe..79cbdf170de 100644
60+
--- a/swift/test/Interop/Cxx/class/constructors-silgen.swift
61+
+++ b/swift/test/Interop/Cxx/class/constructors-silgen.swift
62+
@@ -1,4 +1,5 @@
63+
// RUN: %target-swiftxx-frontend -I %S/Inputs -Xllvm -sil-print-types -emit-silgen %s | %FileCheck %s
64+
+// XFAIL: OS=linux-androideabi
65+
66+
import Constructors
67+
68+
diff --git a/swift/test/Interop/Cxx/class/constructors-typechecker.swift b/swift/test/Interop/Cxx/class/constructors-typechecker.swift
69+
index 8ce10b1ca75..52ff4104b83 100644
70+
--- a/swift/test/Interop/Cxx/class/constructors-typechecker.swift
71+
+++ b/swift/test/Interop/Cxx/class/constructors-typechecker.swift
72+
@@ -1,4 +1,5 @@
73+
// RUN: %target-typecheck-verify-swift -verify-ignore-unknown -I %S/Inputs -enable-experimental-cxx-interop
74+
+// XFAIL: OS=linux-androideabi
75+
76+
import Constructors
77+
78+
diff --git a/swift/test/Interop/Cxx/class/custom-new-operator-irgen.swift b/swift/test/Interop/Cxx/class/custom-new-operator-irgen.swift
79+
index 74e692c9db2..0423493afac 100644
80+
--- a/swift/test/Interop/Cxx/class/custom-new-operator-irgen.swift
81+
+++ b/swift/test/Interop/Cxx/class/custom-new-operator-irgen.swift
82+
@@ -5,4 +5,4 @@ import CustomNewOperator
83+
var x = callsCustomNew()
84+
85+
// Make sure the definition of `operator new` is emitted.
86+
-// CHECK: define {{.*}} @{{_ZnwmPv15container_new_t|"\?\?2@YAPEAX_KPEAXUcontainer_new_t@@@Z"}}
87+
+// CHECK: define {{.*}} @{{_Znw(j|m)Pv15container_new_t|"\?\?2@YAPEAX_KPEAXUcontainer_new_t@@@Z"}}
88+
diff --git a/swift/test/SILOptimizer/package-cmo-serialize-tables.swift b/swift/test/SILOptimizer/package-cmo-serialize-tables.swift
89+
index 382ff2e8080..f061374b2a1 100644
90+
--- a/swift/test/SILOptimizer/package-cmo-serialize-tables.swift
91+
+++ b/swift/test/SILOptimizer/package-cmo-serialize-tables.swift
92+
@@ -19,7 +19,7 @@
93+
94+
// Temporarily disabling on watchOS (both arm64_32 & armv7k):
95+
// rdar://140330692 (🟠 OSS Swift CI: oss-swift_tools-RA_stdlib-DA_test-device-non_executable failed...
96+
-// UNSUPPORTED: OS=watchos
97+
+// UNSUPPORTED: OS=watchos, OS=linux-androideabi
98+
99+
//--- main.swift
100+
101+
diff --git a/swift/test/SILOptimizer/throws_prediction.swift b/swift/test/SILOptimizer/throws_prediction.swift
102+
index f7f2664b2de..01d36e127c6 100644
103+
--- a/swift/test/SILOptimizer/throws_prediction.swift
104+
+++ b/swift/test/SILOptimizer/throws_prediction.swift
105+
@@ -16,7 +16,7 @@
106+
// RUN: -sil-verify-all -module-name=test -emit-sil \
107+
// RUN: | %FileCheck --check-prefix CHECK-DISABLED %s
108+
109+
-// UNSUPPORTED: CPU=armv7k || CPU=arm64_32
110+
+// UNSUPPORTED: CPU=armv7k, CPU=arm64_32, CPU=armv7
111+
112+
// CHECK-DISABLED-NOT: normal_count
113+
114+
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
115+
index 468dc61..a90ae3d 100644
116+
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
117+
+++ b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
118+
@@ -2,6 +2,10 @@
119+
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
120+
if(CMAKE_Swift_COMPILER_TARGET)
121+
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
122+
+else()
123+
+ set(arg_list ${CMAKE_Swift_FLAGS})
124+
+ separate_arguments(arg_list)
125+
+ list(APPEND print_target_info_invocation ${arg_list})
126+
endif()
127+
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
128+
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
129+
diff --git a/swift-testing/cmake/modules/PlatformInfo.cmake b/swift-testing/cmake/modules/PlatformInfo.cmake
130+
index 94c60ef..ab8a491 100644
131+
--- a/swift-testing/cmake/modules/PlatformInfo.cmake
132+
+++ b/swift-testing/cmake/modules/PlatformInfo.cmake
133+
@@ -9,6 +9,10 @@
134+
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
135+
if(CMAKE_Swift_COMPILER_TARGET)
136+
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
137+
+else()
138+
+ set(arg_list ${CMAKE_Swift_FLAGS})
139+
+ separate_arguments(arg_list)
140+
+ list(APPEND print_target_info_invocation ${arg_list})
141+
endif()
142+
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
143+
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
diff --git a/swift/utils/swift_build_support/swift_build_support/products/swift_testing.py b/swift/utils/swift_build_support/swift_build_support/products/swift_testing.py
2+
index b6bfa5760ef..324d1a77eea 100644
3+
--- a/swift/utils/swift_build_support/swift_build_support/products/swift_testing.py
4+
+++ b/swift/utils/swift_build_support/swift_build_support/products/swift_testing.py
5+
@@ -51,7 +51,7 @@ class SwiftTesting(product.Product):
6+
return False
7+
8+
def should_install(self, host_target):
9+
- return self.args.install_swift_testing_macros
10+
+ return self.args.install_swift_testing
11+
12+
def _cmake_product(self, host_target):
13+
build_root = os.path.dirname(self.build_dir)
14+
diff --git a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
15+
index 90f4aa78..0429425b 100644
16+
--- a/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
17+
+++ b/swift-corelibs-foundation/Sources/CoreFoundation/CFPlatform.c
18+
@@ -1948,7 +1948,7 @@ CF_CROSS_PLATFORM_EXPORT void *_CFReallocf(void *ptr, size_t size) {
19+
#endif
20+
}
21+
22+
-#if TARGET_OS_ANDROID
23+
+#if TARGET_OS_ANDROID && __ANDROID_API__ < 28
24+
25+
#include <dlfcn.h>
26+
#include <spawn.h>
27+
@@ -2277,6 +2277,10 @@ CF_EXPORT int _CFPosixSpawnFileActionsAddClose(_CFPosixSpawnFileActionsRef file_
28+
return _CFPosixSpawnFileActionsAddCloseImpl(file_actions, filedes);
29+
}
30+
31+
+CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_actions, const char *path) {
32+
+ return ENOSYS;
33+
+}
34+
+
35+
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]) {
36+
_CFPosixSpawnInitialize();
37+
return _CFPosixSpawnImpl(pid, path, file_actions, attrp, argv, envp);
38+
@@ -2279,7 +2279,7 @@ CF_EXPORT int _CFPosixSpawnFileActionsAddClose(_CFPosixSpawnFileActionsRef file_
39+
}
40+
41+
CF_EXPORT int _CFPosixSpawnFileActionsChdir(_CFPosixSpawnFileActionsRef file_actions, const char *path) {
42+
- #if defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)
43+
+ #if defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29) || (defined(__ANDROID__) && __ANDROID_API__ < 34)
44+
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
45+
// - Amazon Linux 2 (EoL mid-2025)
46+
return ENOSYS;
47+
diff --git a/swift-testing/cmake/modules/SwiftModuleInstallation.cmake b/swift-testing/cmake/modules/SwiftModuleInstallation.cmake
48+
index 1553725..d9f9e5b 100644
49+
--- a/swift-testing/cmake/modules/SwiftModuleInstallation.cmake
50+
+++ b/swift-testing/cmake/modules/SwiftModuleInstallation.cmake
51+
@@ -75,6 +75,10 @@ function(_swift_testing_install_target module)
52+
set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info)
53+
if(CMAKE_Swift_COMPILER_TARGET)
54+
list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET})
55+
+ else()
56+
+ set(arg_list ${CMAKE_Swift_FLAGS})
57+
+ separate_arguments(arg_list)
58+
+ list(APPEND module_triple_command ${arg_list})
59+
endif()
60+
execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
61+
string(JSON module_triple GET "${target_info_json}" "target" "moduleTriple")
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
diff --git a/swift/test/Misc/verify-swift-feature-testing.test-sh b/swift/test/Misc/verify-swift-feature-testing.test-sh
2+
index 3f36fc979cb..8713ae8fea8 100755
3+
--- a/swift/test/Misc/verify-swift-feature-testing.test-sh
4+
+++ b/swift/test/Misc/verify-swift-feature-testing.test-sh
5+
@@ -98,7 +98,6 @@ def find_matches(swift_src_root):
6+
# `-enable-upcoming-feature` in the test directories.
7+
output = subprocess.check_output(
8+
[
9+
- "git",
10+
"grep",
11+
"--extended-regexp",
12+
"--recursive",
13+
diff --git a/swift/test/Reflection/conformance_descriptors.swift b/swift/test/Reflection/conformance_descriptors.swift
14+
index b114f764552..e1bd98c08f4 100644
15+
--- a/swift/test/Reflection/conformance_descriptors.swift
16+
+++ b/swift/test/Reflection/conformance_descriptors.swift
17+
@@ -5,6 +5,7 @@
18+
//
19+
// Temporarily disable on AArch64 Linux (rdar://88451721)
20+
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
21+
+// XFAIL: OS=linux-android
22+
23+
// rdar://100558042
24+
// UNSUPPORTED: CPU=arm64e
25+
diff --git a/swift/test/Reflection/typeref_decoding.swift b/swift/test/Reflection/typeref_decoding.swift
26+
index e0a3b4465a3..c01af893eda 100644
27+
--- a/swift/test/Reflection/typeref_decoding.swift
28+
+++ b/swift/test/Reflection/typeref_decoding.swift
29+
@@ -10,6 +10,7 @@
30+
31+
// FIXME: rdar://127796117
32+
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
33+
+// XFAIL: OS=linux-android
34+
35+
// RUN: %target-build-swift -target %target-swift-5.2-abi-triple -Xfrontend -enable-anonymous-context-mangled-names %S/Inputs/ConcreteTypes.swift %S/Inputs/GenericTypes.swift %S/Inputs/Protocols.swift %S/Inputs/Extensions.swift %S/Inputs/Closures.swift -parse-as-library -emit-module -emit-library %no-fixup-chains -module-name TypesToReflect -o %t/%target-library-name(TypesToReflect)
36+
// RUN: %target-build-swift -target %target-swift-5.2-abi-triple -Xfrontend -enable-anonymous-context-mangled-names %S/Inputs/ConcreteTypes.swift %S/Inputs/GenericTypes.swift %S/Inputs/Protocols.swift %S/Inputs/Extensions.swift %S/Inputs/Closures.swift %S/Inputs/main.swift -emit-module -emit-executable %no-fixup-chains -module-name TypesToReflect -o %t/TypesToReflect
37+
diff --git a/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake b/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake
38+
index 3da519e..e2dd8ed 100644
39+
--- a/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake
40+
+++ b/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake
41+
@@ -4,6 +4,10 @@ if(NOT dispatch_MODULE_TRIPLE)
42+
set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info)
43+
if(CMAKE_Swift_COMPILER_TARGET)
44+
list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET})
45+
+ else()
46+
+ set(arg_list ${CMAKE_Swift_FLAGS})
47+
+ separate_arguments(arg_list)
48+
+ list(APPEND module_triple_command ${arg_list})
49+
endif()
50+
execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
51+
52+
diff --git a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt b/swift-corelibs-libdispatch/src/swift/CMakeLists.txt
53+
index 38bef37..d0ddf98 100644
54+
--- a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt
55+
+++ b/swift-corelibs-libdispatch/src/swift/CMakeLists.txt
56+
@@ -15,6 +15,7 @@ add_library(swiftDispatch
57+
Source.swift
58+
Time.swift
59+
Wrapper.swift)
60+
+set(CMAKE_SHARED_LINKER_FLAGS "")
61+
target_compile_options(swiftDispatch PRIVATE
62+
"SHELL:-Xcc -fblocks"
63+
"SHELL:-Xcc -fmodule-map-file=${PROJECT_SOURCE_DIR}/dispatch/module.modulemap"

0 commit comments

Comments
 (0)