Skip to content

Update patches and build the compiler from the latest commits, not an older tag #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions swift-ci/sdks/android/build-docker
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ HOST_OS=ubuntu24.04
source ./scripts/toolchain-vars.sh

# Check-out and patch the sources
if [[ "${BUILD_COMPILER}" != "1" ]]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): instead of relying on an environment variable, consider making this more discoverable to using a command line argument to this script.

e.g.: build-docker --build-compiler

./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG}
else
if [[ "${BUILD_SCHEME}" == "development" ]]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: instead of using environment variables, consider passing the --swift-scheme as a command line argument to the script. This way, this script won't needs to be maintains once the BUILD_SCHEME is not production as the onus is on the caller to provide the correct scheme.

e.g.: build-docker --scheme main or build-docker --scheme release/7.x

./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-scheme main
else
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-scheme release/6.2
fi
fi
./patches/apply-patches.sh ${WORKDIR}/source/swift-project

mkdir -p ${WORKDIR}/products
Expand Down
3 changes: 1 addition & 2 deletions swift-ci/sdks/android/patches/apply-patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ cd ${1}
case "${BUILD_SCHEME}" in
swift-*-branch)
git apply -v -C1 ${patches_dir}/swift-android.patch
git apply -v -C1 ${patches_dir}/swift-android-testing-except-release.patch
git apply -v -C1 ${patches_dir}/swift-android-devel.patch
;;
development)
git apply -v -C1 ${patches_dir}/swift-android.patch
git apply -v -C1 ${patches_dir}/swift-android-trunk-libdispatch.patch
git apply -v -C1 ${patches_dir}/swift-android-testing-except-release.patch
;;
*)
echo "$0: invalid BUILD_SCHEME=${BUILD_SCHEME}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
commit 2e87eb24f85f3e84bff78051fba4870a5c061ec0
Author: finagolfin
Date: Mon Jun 30 10:39:26 2025

[test] Fix or disable tests for 32-bit platforms (#82501)

Fix two IRGen tests that are failing on Android armv7 and disable eight ClangImporter, C++ Interop, and SILOptimizer tests, two of which that were already failing on other 32-bit platforms.

diff --git a/swift/test/ClangImporter/pcm-emit-direct-cc1-mode.swift b/swift/test/ClangImporter/pcm-emit-direct-cc1-mode.swift
index f5048b9e3d5..c227ef7b77d 100644
index f5048b9e3d5..6bc26ca3177 100644
--- a/swift/test/ClangImporter/pcm-emit-direct-cc1-mode.swift
+++ b/swift/test/ClangImporter/pcm-emit-direct-cc1-mode.swift
@@ -9,7 +9,7 @@
// CHECK-DUMP: Module map file: {{.*[/\\]}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap

// Verify that the clang command-line used is cc1
-// RUN: %FileCheck -check-prefix CHECK-CLANG -DTRIPLE=%target-triple %s < %t.diags.txt
+// RUN: %FileCheck -check-prefix CHECK-CLANG -DTRIPLE=%module-target-triple %s < %t.diags.txt
// CHECK-CLANG: clang importer cc1 args
// CHECK-CLANG-SAME: '-o' '{{.*[/\\]}}script.pcm' '-fsyntax-only' '-x' 'objective-c' '{{.*[/\\]}}module.modulemap' '-triple' '[[TRIPLE]]'
@@ -15,5 +15,7 @@
// CHECK-CLANG-SAME: '-fmodules'
// CHECK-CLANG-NOT: clang importer driver args

+// XFAIL: OS=linux-androideabi
+
import script
var _ : ScriptTy
diff --git a/swift/test/IRGen/abitypes_arm.swift b/swift/test/IRGen/abitypes_arm.swift
index 9428294483d..52bd8b10145 100644
--- a/swift/test/IRGen/abitypes_arm.swift
Expand Down Expand Up @@ -111,6 +118,23 @@ index f7f2664b2de..01d36e127c6 100644

// CHECK-DISABLED-NOT: normal_count

diff --git a/swift/utils/swift_build_support/swift_build_support/cmake.py b/swift/utils/swift_build_support/swift_build_support/cmake.py
index bfb69965890..b5e9f5349c2 100644
--- a/swift/utils/swift_build_support/swift_build_support/cmake.py
+++ b/swift/utils/swift_build_support/swift_build_support/cmake.py
@@ -153,10 +153,8 @@ class CMake(object):
toolchain_path = product.native_toolchain_path(args.host_target)
cmake_swiftc_path = os.getenv('CMAKE_Swift_COMPILER',
os.path.join(toolchain_path, 'bin', 'swiftc'))
- define("CMAKE_C_COMPILER:PATH", os.path.join(toolchain_path,
- 'bin', 'clang'))
- define("CMAKE_CXX_COMPILER:PATH", os.path.join(toolchain_path,
- 'bin', 'clang++'))
+ define("CMAKE_C_COMPILER:PATH", toolchain.cc)
+ define("CMAKE_CXX_COMPILER:PATH", toolchain.cxx)
define("CMAKE_Swift_COMPILER:PATH", cmake_swiftc_path)
else:
cmake_swiftc_path = os.getenv('CMAKE_Swift_COMPILER', toolchain.swiftc)
diff --git a/swift/utils/swift_build_support/swift_build_support/products/product.py b/swift/utils/swift_build_support/swift_build_support/products/product.py
index 274b6037305..bf0f7fcf671 100644
--- a/swift/utils/swift_build_support/swift_build_support/products/product.py
Expand All @@ -124,33 +148,3 @@ index 274b6037305..bf0f7fcf671 100644
install_destdir = os.path.join(install_destdir, self.args.host_target)
return targets.toolchain_path(install_destdir,
self.args.install_prefix)
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
index 468dc61..a90ae3d 100644
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
+++ b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
@@ -2,6 +2,10 @@
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
if(CMAKE_Swift_COMPILER_TARGET)
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
+else()
+ set(arg_list ${CMAKE_Swift_FLAGS})
+ separate_arguments(arg_list)
+ list(APPEND print_target_info_invocation ${arg_list})
endif()
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
diff --git a/swift-testing/cmake/modules/PlatformInfo.cmake b/swift-testing/cmake/modules/PlatformInfo.cmake
index 94c60ef..ab8a491 100644
--- a/swift-testing/cmake/modules/PlatformInfo.cmake
+++ b/swift-testing/cmake/modules/PlatformInfo.cmake
@@ -9,6 +9,10 @@
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
if(CMAKE_Swift_COMPILER_TARGET)
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
+else()
+ set(arg_list ${CMAKE_Swift_FLAGS})
+ separate_arguments(arg_list)
+ list(APPEND print_target_info_invocation ${arg_list})
endif()
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
61 changes: 0 additions & 61 deletions swift-ci/sdks/android/patches/swift-android-testing-release.patch

This file was deleted.

38 changes: 16 additions & 22 deletions swift-ci/sdks/android/patches/swift-android-trunk-libdispatch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,24 @@ index 3f36fc979cb..8713ae8fea8 100755
"grep",
"--extended-regexp",
"--recursive",
diff --git a/swift/test/Reflection/conformance_descriptors.swift b/swift/test/Reflection/conformance_descriptors.swift
index b114f764552..e1bd98c08f4 100644
--- a/swift/test/Reflection/conformance_descriptors.swift
+++ b/swift/test/Reflection/conformance_descriptors.swift
@@ -5,6 +5,7 @@
//
// Temporarily disable on AArch64 Linux (rdar://88451721)
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
+// XFAIL: OS=linux-android
diff --git a/swift/utils/swift_build_support/swift_build_support/cmake.py b/swift/utils/swift_build_support/swift_build_support/cmake.py
index 9a0f5b43e2d..5c7d1320a2d 100644
--- a/swift/utils/swift_build_support/swift_build_support/cmake.py
+++ b/swift/utils/swift_build_support/swift_build_support/cmake.py
@@ -150,11 +150,8 @@ class CMake(object):
define("CMAKE_CXX_COMPILER_LAUNCHER:PATH", args.cmake_cxx_launcher)

// rdar://100558042
// UNSUPPORTED: CPU=arm64e
diff --git a/swift/test/Reflection/typeref_decoding.swift b/swift/test/Reflection/typeref_decoding.swift
index e0a3b4465a3..c01af893eda 100644
--- a/swift/test/Reflection/typeref_decoding.swift
+++ b/swift/test/Reflection/typeref_decoding.swift
@@ -10,6 +10,7 @@
if self.prefer_native_toolchain and product:
- clang_tools_path = product.native_clang_tools_path(args.host_target)
- define("CMAKE_C_COMPILER:PATH", os.path.join(clang_tools_path,
- 'bin', 'clang'))
- define("CMAKE_CXX_COMPILER:PATH", os.path.join(clang_tools_path,
- 'bin', 'clang++'))
+ define("CMAKE_C_COMPILER:PATH", toolchain.cc)
+ define("CMAKE_CXX_COMPILER:PATH", toolchain.cxx)

// FIXME: rdar://127796117
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
+// XFAIL: OS=linux-android

// 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)
// 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
toolchain_path = product.native_toolchain_path(args.host_target)
cmake_swiftc_path = os.getenv('CMAKE_Swift_COMPILER',
diff --git a/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake b/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake
index 3da519e..e2dd8ed 100644
--- a/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake
Expand Down
54 changes: 54 additions & 0 deletions swift-ci/sdks/android/patches/swift-android.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
diff --git a/swift/test/SILOptimizer/concat_string_literals.32.swift b/swift/test/SILOptimizer/concat_string_literals.32.swift
index 01390761c8c..d84c142397c 100644
--- a/swift/test/SILOptimizer/concat_string_literals.32.swift
+++ b/swift/test/SILOptimizer/concat_string_literals.32.swift
@@ -4,6 +4,7 @@

// We have a separate test for 64-bit architectures.
// REQUIRES: PTRSIZE=32
+// XFAIL: OS=linux-androideabi

// NOTE: 25185.byteSwapped = 0x62 'a', 0x61 'b'
// CHECK-LABEL: test_ascii_scalar_scalar2
diff --git a/swift/test/SILOptimizer/semantic-arc-opts-redundantcopyopts.sil b/swift/test/SILOptimizer/semantic-arc-opts-redundantcopyopts.sil
index 98765e0e4a3..4dc68bf522b 100644
--- a/swift/test/SILOptimizer/semantic-arc-opts-redundantcopyopts.sil
+++ b/swift/test/SILOptimizer/semantic-arc-opts-redundantcopyopts.sil
@@ -1,5 +1,7 @@
// RUN: %target-sil-opt -module-name Swift -enable-sil-verify-all -semantic-arc-opts -sil-semantic-arc-peepholes-redundant-copyvalue-elim %s | %FileCheck %s

+// XFAIL: OS=linux-android, OS=linux-androideabi
+
// NOTE: Some of our tests here depend on borrow elimination /not/ running!
// Please do not add it to clean up the IR like we did in
// semanticarcopts-loadcopy-to-loadborrow!
diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl
index 16e05052609..7ab8cebfab8 100755
--- a/swift/utils/build-script-impl
Expand Down Expand Up @@ -59,6 +83,21 @@ index 7f290d16..95366592 100644
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
index 468dc61..a90ae3d 100644
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
+++ b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
@@ -2,6 +2,10 @@
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
if(CMAKE_Swift_COMPILER_TARGET)
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
+else()
+ set(arg_list ${CMAKE_Swift_FLAGS})
+ separate_arguments(arg_list)
+ list(APPEND print_target_info_invocation ${arg_list})
endif()
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
diff --git a/swift-foundation/cmake/modules/SwiftFoundationSwiftSupport.cmake b/swift-foundation/cmake/modules/SwiftFoundationSwiftSupport.cmake
index cbdfc2a..bb4121d 100644
--- a/swift-foundation/cmake/modules/SwiftFoundationSwiftSupport.cmake
Expand Down Expand Up @@ -86,6 +125,21 @@ index 1be9a4b..bd7b1bd 100644
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
diff --git a/swift-testing/cmake/modules/PlatformInfo.cmake b/swift-testing/cmake/modules/PlatformInfo.cmake
index 94c60ef..ab8a491 100644
--- a/swift-testing/cmake/modules/PlatformInfo.cmake
+++ b/swift-testing/cmake/modules/PlatformInfo.cmake
@@ -9,6 +9,10 @@
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
if(CMAKE_Swift_COMPILER_TARGET)
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
+else()
+ set(arg_list ${CMAKE_Swift_FLAGS})
+ separate_arguments(arg_list)
+ list(APPEND print_target_info_invocation ${arg_list})
endif()
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
diff --git a/swift-testing/cmake/modules/TargetTriple.cmake b/swift-testing/cmake/modules/TargetTriple.cmake
index e087cc4..02f3a95 100644
--- a/swift-testing/cmake/modules/TargetTriple.cmake
Expand Down
Loading