diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ad586a0d..5bff8ed0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -32,10 +32,6 @@ jobs: build-type: 'docker' build-compiler: '1' runner: 'self-hosted' - - swift-version: 'development' - build-type: 'docker' - build-compiler: '1' - runner: 'self-hosted' - swift-version: 'swift-6.2-branch' build-type: 'docker' build-compiler: '0' diff --git a/swift-ci/sdks/android/build-docker b/swift-ci/sdks/android/build-docker index 8d1a8c4c..2e02d5f1 100755 --- a/swift-ci/sdks/android/build-docker +++ b/swift-ci/sdks/android/build-docker @@ -26,15 +26,11 @@ HOST_OS=ubuntu24.04 source ./scripts/toolchain-vars.sh # Check-out and patch the sources -if [[ "${BUILD_COMPILER}" != "1" ]]; then +if [[ "${BUILD_COMPILER}" != "1" ]] || [[ "${BUILD_SCHEME}" == "development" ]]; then ./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG} else -if [[ "${BUILD_SCHEME}" == "development" ]]; then -./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 diff --git a/swift-ci/sdks/android/patches/swift-android-trunk-libdispatch.patch b/swift-ci/sdks/android/patches/swift-android-trunk-libdispatch.patch index ffec4ff6..f09bd748 100644 --- a/swift-ci/sdks/android/patches/swift-android-trunk-libdispatch.patch +++ b/swift-ci/sdks/android/patches/swift-android-trunk-libdispatch.patch @@ -28,21 +28,6 @@ index 9a0f5b43e2d..5c7d1320a2d 100644 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 -+++ b/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake -@@ -4,6 +4,10 @@ if(NOT dispatch_MODULE_TRIPLE) - set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info) - if(CMAKE_Swift_COMPILER_TARGET) - list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET}) -+ else() -+ set(arg_list ${CMAKE_Swift_FLAGS}) -+ separate_arguments(arg_list) -+ list(APPEND module_triple_command ${arg_list}) - endif() - execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json) - diff --git a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt b/swift-corelibs-libdispatch/src/swift/CMakeLists.txt index 38bef37..d0ddf98 100644 --- a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt diff --git a/swift-ci/sdks/android/patches/swift-android.patch b/swift-ci/sdks/android/patches/swift-android.patch index eeb84df8..35ba1423 100644 --- a/swift-ci/sdks/android/patches/swift-android.patch +++ b/swift-ci/sdks/android/patches/swift-android.patch @@ -26,6 +26,16 @@ diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl index 16e05052609..7ab8cebfab8 100755 --- a/swift/utils/build-script-impl +++ b/swift/utils/build-script-impl +@@ -828,6 +828,9 @@ function set_build_options_for_host() { + # and it must be the same for both LLVM and Swift + + if [[ "${SWIFT_HOST_TRIPLE}" ]] ; then ++ SWIFT_TARGET_CMAKE_OPTIONS+=( ++ -DCMAKE_Swift_COMPILER_TARGET:STRING="${SWIFT_HOST_TRIPLE}" ++ ) + llvm_cmake_options+=( + -DLLVM_HOST_TRIPLE:STRING="${SWIFT_HOST_TRIPLE}" + ) @@ -2622,6 +2622,7 @@ for host in "${ALL_HOSTS[@]}"; do echo "Cleaning the libdispatch build directory" call rm -rf "${LIBDISPATCH_BUILD_DIR}" @@ -48,15 +58,16 @@ index 324d1a77eea..e88601a8701 100644 from . import cmake_product from . import product -@@ -115,6 +117,22 @@ class SwiftTestingCMakeShim(cmake_product.CMakeProduct): +@@ -115,6 +117,24 @@ class SwiftTestingCMakeShim(cmake_product.CMakeProduct): # FIXME: If we build macros for the builder, specify the path. self.cmake_options.define('SwiftTesting_MACRO', 'NO') + if host_target.startswith('android') and self.is_cross_compile_target(host_target): + host_config = HostSpecificConfiguration(host_target, self.args) + self.cmake_options.extend(host_config.cmake_options) -+ flags = '-target %s-unknown-linux-android%s ' % (self.args.android_arch, -+ self.args.android_api_level) ++ triple = '%s-unknown-linux-android%s' % (self.args.android_arch, ++ self.args.android_api_level) ++ flags = '-target %s ' % (triple) + + flags += '-resource-dir %s/lib/swift ' % ( + self.host_install_destdir(host_target) + self.args.install_prefix) @@ -65,6 +76,7 @@ index 324d1a77eea..e88601a8701 100644 + flags += '-sdk %s/sysroot ' % (ndk_path) + flags += '-tools-directory %s/bin' % (ndk_path) + self.cmake_options.define('CMAKE_Swift_FLAGS', flags) ++ self.cmake_options.define('CMAKE_Swift_COMPILER_TARGET', triple) + self.cmake_options.define('CMAKE_CXX_COMPILER_WORKS', 'True') + self.cmake_options.define('CMAKE_FIND_ROOT_PATH', self.args.cross_compile_deps_path) + @@ -83,36 +95,6 @@ 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 -+++ b/swift-foundation/cmake/modules/SwiftFoundationSwiftSupport.cmake -@@ -37,6 +37,10 @@ function(_swift_foundation_install_target module) - set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info) - if(CMAKE_Swift_COMPILER_TARGET) - list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET}) -+ else() -+ set(arg_list ${CMAKE_Swift_FLAGS}) -+ separate_arguments(arg_list) -+ list(APPEND module_triple_command ${arg_list}) - endif() - execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json) - string(JSON module_triple GET "${target_info_json}" "target" "moduleTriple") diff --git a/swift-testing/CMakeLists.txt b/swift-testing/CMakeLists.txt index 1be9a4b..bd7b1bd 100644 --- a/swift-testing/CMakeLists.txt @@ -125,33 +107,3 @@ 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 -+++ b/swift-testing/cmake/modules/TargetTriple.cmake -@@ -10,6 +10,10 @@ - set(SWT_TARGET_INFO_COMMAND "${CMAKE_Swift_COMPILER}" -print-target-info) - if(CMAKE_Swift_COMPILER_TARGET) - list(APPEND SWT_TARGET_INFO_COMMAND -target ${CMAKE_Swift_COMPILER_TARGET}) -+else() -+ set(arg_list ${CMAKE_Swift_FLAGS}) -+ separate_arguments(arg_list) -+ list(APPEND SWT_TARGET_INFO_COMMAND ${arg_list}) - endif() - execute_process(COMMAND ${SWT_TARGET_INFO_COMMAND} OUTPUT_VARIABLE SWT_TARGET_INFO_JSON) - string(JSON SWT_TARGET_TRIPLE GET "${SWT_TARGET_INFO_JSON}" "target" "unversionedTriple")