diff --git a/CMakeLists.txt b/CMakeLists.txt index 49ab8f0f1dc9f..bc9b679092271 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,23 +304,6 @@ set(SWIFT_ANDROID_NDK_CLANG_VERSION "12.0.8" CACHE STRING set(SWIFT_ANDROID_DEPLOY_DEVICE_PATH "" CACHE STRING "Path on an Android device where build products will be pushed. These are used when running the test suite against the device") -# -# User-configurable ICU specific options for Android, FreeBSD, Linux, Haiku, and WASI. -# - -foreach(sdk ANDROID;FREEBSD;LINUX;WINDOWS;HAIKU;WASI) - foreach(arch aarch64;armv6;armv7;i686;powerpc64;powerpc64le;s390x;wasm32;x86_64) - set(SWIFT_${sdk}_${arch}_ICU_UC "" CACHE STRING - "Path to a directory containing the icuuc library for ${sdk}") - set(SWIFT_${sdk}_${arch}_ICU_UC_INCLUDE "" CACHE STRING - "Path to a directory containing headers for icuuc for ${sdk}") - set(SWIFT_${sdk}_${arch}_ICU_I18N "" CACHE STRING - "Path to a directory containing the icui18n library for ${sdk}") - set(SWIFT_${sdk}_${arch}_ICU_I18N_INCLUDE "" CACHE STRING - "Path to a directory containing headers icui18n for ${sdk}") - endforeach() -endforeach() - # # User-configurable Darwin-specific options. # diff --git a/cmake/modules/SwiftConfigureSDK.cmake b/cmake/modules/SwiftConfigureSDK.cmake index 115b2769c53e1..3c866f2e65c92 100644 --- a/cmake/modules/SwiftConfigureSDK.cmake +++ b/cmake/modules/SwiftConfigureSDK.cmake @@ -63,7 +63,6 @@ function(_report_sdk prefix) if(NOT prefix IN_LIST SWIFT_DARWIN_PLATFORMS) foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES}) message(STATUS " ${arch} libc header path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY}") - message(STATUS " ${arch} libc architecture specific header path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY}") endforeach() endif() @@ -288,7 +287,6 @@ macro(configure_sdk_unix name architectures) swift_android_sysroot(android_sysroot) set(SWIFT_SDK_ANDROID_ARCH_${arch}_PATH "${android_sysroot}") set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "${android_sysroot}/usr/include" CACHE STRING "Path to C library headers") - set(SWIFT_SDK_ANDROID_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${android_sysroot}/usr/include" CACHE STRING "Path to C library architecture headers") if("${arch}" STREQUAL "armv7") set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE "arm-linux-androideabi") @@ -320,10 +318,8 @@ macro(configure_sdk_unix name architectures) if("${prefix}" STREQUAL "HAIKU") set(SWIFT_SDK_HAIKU_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "/system/develop/headers/posix" CACHE STRING "Path to C library headers") - set(SWIFT_SDK_HAIKU_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "/system/develop/headers" CACHE STRING "Path to C library architecture headers") else() set(SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "/usr/include" CACHE STRING "Path to C library headers") - set(SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_SDK_${prefix}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY}/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE STRING "Path to C library architecture headers") endif() if("${prefix}" STREQUAL "LINUX") @@ -373,7 +369,6 @@ macro(configure_sdk_unix name architectures) set(SWIFT_SDK_WASI_ARCH_wasm32_PATH "${SWIFT_WASI_SYSROOT_PATH}") set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi") set(SWIFT_SDK_WASI_ARCH_wasm32_LIBC_INCLUDE_DIRECTORY "${SWIFT_WASI_SYSROOT_PATH}/include") - set(SWIFT_SDK_WASI_ARCH_wasm32_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_WASI_SYSROOT_PATH}/include") else() message(FATAL_ERROR "unknown Unix OS: ${prefix}") endif() diff --git a/docs/Android.md b/docs/Android.md index bd3324369b407..a7dda5fd4cecb 100644 --- a/docs/Android.md +++ b/docs/Android.md @@ -43,51 +43,22 @@ To follow along with this guide, you'll need: ## "Hello, world" on Android -### 1. Downloading (or building) the Swift Android stdlib dependencies +### 1. Building the Swift stdlib for Android -You may have noticed that, in order to build the Swift stdlib for Linux, you -needed to `apt-get install libicu-dev icu-devtools`. Similarly, building -the Swift stdlib for Android requires the libiconv and libicu libraries. -However, you'll need versions of these libraries that work on Android devices. - -The steps are as follows: - -1. Ensure you have `curl`, `autoconf`, `automake`, `libtool`, and - `git` installed. -2. Clone the [SwiftAndroid/libiconv-libicu-android](https://github.com/SwiftAndroid/libiconv-libicu-android) - project. From the command-line, run the following command: - `git clone https://github.com/SwiftAndroid/libiconv-libicu-android.git`. -3. From the command-line, run `which ndk-build`. Confirm that the path to - the `ndk-build` executable in the Android NDK you downloaded is displayed. - If not, you may need to add the Android NDK directory to your `PATH`. -4. Change directories into `libiconv-libicu-android`: `cd libiconv-libicu-android` -5. Run the Swift build script: `./build-swift.sh` -6. Confirm that the various `libicuXYZswift.so` libraries are located in the - `armeabi-v7a` directory. - -### 2. Building the Swift stdlib for Android - -Enter your Swift directory, then run the build script, passing paths to the -Android NDK, as well as the directories that contain the `libicuucswift.so` and -`libicui18nswift.so` you downloaded or built in step one: +Enter your Swift directory, then run the build script, passing the path to the +Android NDK: ``` -$ ARM_DIR=path/to/libiconv-libicu-android/armeabi-v7a $ NDK_PATH=path/to/android-ndk-r23b $ utils/build-script \ -R \ # Build in ReleaseAssert mode. --android \ # Build for Android. --android-ndk $NDK_PATH \ # Path to an Android NDK. --android-arch armv7 \ # Optionally specify Android architecture, alternately aarch64 or x86_64 - --android-api-level 21 \ # The Android API level to target. Swift only supports 21 or greater. - --android-icu-uc ${ARM_DIR}/libicuucswift.so \ - --android-icu-uc-include ${ARM_DIR}/icu/source/common \ - --android-icu-i18n ${ARM_DIR}/libicui18nswift.so \ - --android-icu-i18n-include ${ARM_DIR}/icu/source/i18n \ - --android-icu-data ${ARM_DIR}/libicudataswift.so + --android-api-level 21 # The Android API level to target. Swift only supports 21 or greater. ``` -### 3. Compiling `hello.swift` to run on an Android device +### 2. Compiling `hello.swift` to run on an Android device Create a simple Swift file named `hello.swift`: @@ -121,7 +92,7 @@ This is exactly the error we want: the executable is built to run on an Android device--it does not run on Linux. Next, let's deploy it to an Android device in order to execute it. -### 4. Deploying the build products to the device +### 3. Deploying the build products to the device You can use the `adb push` command to copy build products from your Linux environment to your Android device. If you haven't already installed `adb`, @@ -142,14 +113,6 @@ $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswi $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswiftRemoteMirror.so /data/local/tmp ``` -You will also need to push the icu libraries: - -``` -adb push /path/to/libicu-android/armeabi-v7a/libicudataswift.so /data/local/tmp -adb push /path/to/libicu-android/armeabi-v7a/libicui18nswift.so /data/local/tmp -adb push /path/to/libicu-android/armeabi-v7a/libicuucswift.so /data/local/tmp -``` - In addition, you'll also need to copy the Android NDK's libc++: ``` @@ -162,7 +125,7 @@ previous step: $ adb push hello /data/local/tmp ``` -### 5. Running "Hello, world" on your Android device +### 4. Running "Hello, world" on your Android device You can use the `adb shell` command to execute the `hello` executable on the Android device: @@ -182,7 +145,7 @@ Congratulations! You've just run your first Swift program on Android. ## Running the Swift test suite hosted on an Android device When running the test suite, build products are automatically pushed to your -device. As in part four, you'll need to connect your Android device via USB: +device. As in part three, you'll need to connect your Android device via USB: 1. Connect your Android device to your computer via USB. Ensure that remote debugging is enabled for that device by following the official instructions: @@ -198,10 +161,5 @@ $ utils/build-script \ --android \ # Build for Android. --android-ndk ~/android-ndk-r23b \ # Path to an Android NDK. --android-arch armv7 \ # Optionally specify Android architecture, alternately aarch64 - --android-ndk-version 21 \ - --android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \ - --android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \ - --android-icu-i18n ~/libicu-android/armeabi-v7a/libicui18n.so \ - --android-icu-i18n-include ~/libicu-android/armeabi-v7a/icu/source/i18n/ \ - --android-icu-data ~/libicu-android/armeabi-v7a/libicudata.so + --android-ndk-version 21 ``` diff --git a/docs/AndroidBuild.md b/docs/AndroidBuild.md index c45f77bec0644..44278a585f443 100644 --- a/docs/AndroidBuild.md +++ b/docs/AndroidBuild.md @@ -74,10 +74,6 @@ cmake -C S:\swift-build\cmake\caches\android-armv7.cmake -DANDROID_ALTERNATE_TOOLCHAIN=S:/b/a/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr ^ -DLLVM_DIR=S:/b/a/llvm/lib/cmake/llvm ^ -DSWIFT_NATIVE_SWIFT_TOOLS_PATH=S:/b/a/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin ^ - -DSWIFT_ANDROID_armv7_ICU_UC_INCLUDE=S:/b/a/Library/icu-64/usr/include/unicode ^ - -DSWIFT_ANDROID_armv7_ICU_UC=S:/b/a/Library/icu-64/usr/lib/libicuuc64.so ^ - -DSWIFT_ANDROID_armv7_ICU_I18N_INCLUDE=S:/b/a/Library/icu-64/usr/include ^ - -DSWIFT_ANDROID_armv7_ICU_I18N=S:/b/a/Library/icu-64/usr/lib/libicuin64.so ^ S:/swift ninja ninja install diff --git a/docs/WindowsBuild.md b/docs/WindowsBuild.md index 300c377e3a0d6..4506701290daf 100644 --- a/docs/WindowsBuild.md +++ b/docs/WindowsBuild.md @@ -92,7 +92,7 @@ structure should resemble: β”• usr/... ``` -Note that only ICU is required for building the toolchain, and SQLite is only +Note that ICU is only required for building Foundation, and SQLite is only needed for building llbuild and onwards. The ICU project provides binaries, alternatively, see the ICU project for details on building ICU from source. @@ -134,10 +134,6 @@ cmake -B "S:\b\1" ^ -D LLVM_EXTERNAL_CMARK_SOURCE_DIR=S:\cmark ^ -D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=S:\swift ^ -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=S:\swift-corelibs-libdispatch ^ - -D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE=S:\Library\icu-67\usr\include ^ - -D SWIFT_WINDOWS_x86_64_ICU_I18N=S:\Library\icu-67\usr\lib\icuin67.lib ^ - -D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE=S:\Library\icu-67\usr\include ^ - -D SWIFT_WINDOWS_x86_64_ICU_UC=S:\Library\icu-67\usr\lib\icuuc67.lib ^ -G Ninja ^ -S S:\llvm-project\llvm diff --git a/docs/WindowsCrossCompile.md b/docs/WindowsCrossCompile.md index 21550082da520..78757b0e30d4b 100644 --- a/docs/WindowsCrossCompile.md +++ b/docs/WindowsCrossCompile.md @@ -30,7 +30,6 @@ the `build-script` invocation to achieve this. You will need to expand out the path where `llvm-ar` and `llvm-ranlib` are built. These are needed to correctly build the static libraries. Note that cross-compiling will require the use of `lld`. Ensure that `lld-link.exe` is available to clang via your path. -Additionally, the ICU headers and libraries need to be provided for the build. #### macOS @@ -38,11 +37,7 @@ Additionally, the ICU headers and libraries need to be provided for the build. --extra-cmake-options=-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=FALSE,\ -DCMAKE_AR=,\ -DCMAKE_RANLIB=,\ --DSWIFT_SDKS='OSX;WINDOWS',\ --DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE=,\ --DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE=,\ --DSWIFT_WINDOWS_x86_64_ICU_I18N=,\ --DSWIFT_WINDOWS_x86_64_ICU_UC= +-DSWIFT_SDKS='OSX;WINDOWS' ``` #### Linux diff --git a/stdlib/cmake/modules/AddSwiftStdlib.cmake b/stdlib/cmake/modules/AddSwiftStdlib.cmake index 0c6d35594c252..104cea4df591a 100644 --- a/stdlib/cmake/modules/AddSwiftStdlib.cmake +++ b/stdlib/cmake/modules/AddSwiftStdlib.cmake @@ -1144,17 +1144,9 @@ function(add_swift_target_library_single target name) target_link_libraries("${target}" INTERFACE ${SWIFTLIB_SINGLE_LINK_LIBRARIES}) endif() - # Don't add the icucore target. - set(SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU) - foreach(item ${SWIFTLIB_SINGLE_LINK_LIBRARIES}) - if(NOT "${item}" STREQUAL "icucore") - list(APPEND SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU "${item}") - endif() - endforeach() - if(target_static) _list_add_string_suffix( - "${SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU}" + "${SWIFTLIB_SINGLE_LINK_LIBRARIES}" "-static" target_static_depends) # FIXME: should this be target_link_libraries? diff --git a/stdlib/public/Platform/CMakeLists.txt b/stdlib/public/Platform/CMakeLists.txt index bc3dc21ba51cc..7554331b1744d 100644 --- a/stdlib/public/Platform/CMakeLists.txt +++ b/stdlib/public/Platform/CMakeLists.txt @@ -149,8 +149,7 @@ foreach(sdk ${SWIFT_SDKS}) OUTPUT "${glibc_modulemap_out}" FLAGS "-DCMAKE_SDK=${sdk}" - "-DGLIBC_INCLUDE_PATH=${SWIFT_SDK_${sdk}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY}" - "-DGLIBC_ARCH_INCLUDE_PATH=${SWIFT_SDK_${sdk}_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY}") + "-DGLIBC_INCLUDE_PATH=${SWIFT_SDK_${sdk}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY}") list(APPEND glibc_modulemap_target_list ${glibc_modulemap_target}) @@ -185,15 +184,12 @@ foreach(sdk ${SWIFT_SDKS}) string(REPLACE "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${arch}_PATH}" "" absolute_libc_include_path "${SWIFT_SDK_${sdk}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY}") - string(REPLACE "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${arch}_PATH}" - "" absolute_libc_arch_include_path ${SWIFT_SDK_${sdk}_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY}) handle_gyb_source_single(glibc_modulemap_native_target SOURCE "${glibc_modulemap_source}" OUTPUT "${glibc_sysroot_relative_modulemap_out}" FLAGS "-DCMAKE_SDK=${sdk}" - "-DGLIBC_INCLUDE_PATH=${absolute_libc_include_path}" - "-DGLIBC_ARCH_INCLUDE_PATH=${absolute_libc_arch_include_path}") + "-DGLIBC_INCLUDE_PATH=${absolute_libc_include_path}") list(APPEND glibc_modulemap_target_list ${glibc_modulemap_native_target}) set(glibc_modulemap_out ${glibc_sysroot_relative_modulemap_out}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ae5493a4886c5..1f677a6f29b86 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -338,13 +338,7 @@ foreach(SDK ${SWIFT_SDKS}) --destination "${SWIFT_ANDROID_DEPLOY_DEVICE_PATH}" --destination-arch "${ARCH}" # Build products like libswiftCore.so. - "${SWIFTLIB_DIR}/android" - # These two directories may contain the same libraries, - # but upload both to device just in case. Duplicates will be - # overwritten, and uploading doesn't take very long anyway. - "${SWIFT_ANDROID_${ARCH}_ICU_UC}" - "${SWIFT_ANDROID_${ARCH}_ICU_I18N}" - "${SWIFT_ANDROID_${ARCH}_ICU_DATA}") + "${SWIFTLIB_DIR}/android") endif() add_custom_target("upload-stdlib${VARIANT_SUFFIX}" ${command_upload_stdlib} diff --git a/test/stdlib/Character.swift b/test/stdlib/Character.swift index e324c6ff806e1..8c568c6eaf7ea 100644 --- a/test/stdlib/Character.swift +++ b/test/stdlib/Character.swift @@ -84,16 +84,12 @@ var testCharacters = [ "\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 9 bytes ] -// Only run it on ObjC platforms. Supported Linux versions do not have a -// recent enough ICU -#if _runtime(_ObjC) testCharacters += [ "\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 11 bytes "\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 13 bytes "\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 15 bytes "\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 17 bytes ] -#endif testCharacters += [ // U+00A9 COPYRIGHT SIGN @@ -105,8 +101,6 @@ testCharacters += [ "\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 10 bytes ] -// Only run it on recent enough versions of ICU -#if _runtime(_ObjC) if #available(iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0, *) { testCharacters += [ "\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 12 bytes @@ -117,7 +111,6 @@ if #available(iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0, *) { "πŸ‘©β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", // UTF-8: 25 bytes ] } -#endif func randomGraphemeCluster(_ minSize: Int, _ maxSize: Int) -> String { let n = Int.random(in: (minSize + 1) ..< maxSize) @@ -224,9 +217,6 @@ CharacterTests.test("CR-LF") { } CharacterTests.test("Unicode 9 grapheme breaking") { - // Only run it on ObjC platforms. Supported Linux versions do not have a - // recent enough ICU for Unicode 9 support. -#if _runtime(_ObjC) // Check for Unicode 9 or later guard #available(iOS 10.0, macOS 10.12, *) else { return } @@ -241,7 +231,6 @@ CharacterTests.test("Unicode 9 grapheme breaking") { let skinTone = "πŸ‘‹πŸ‘‹πŸ»πŸ‘‹πŸΌπŸ‘‹πŸ½πŸ‘‹πŸΎπŸ‘‹πŸΏ" expectEqual(6, skinTone.count) expectEqual(skinTone.reversed().count, skinTone.count) -#endif } /// Test that a given `String` can be transformed into a `Character` and back diff --git a/test/stdlib/CharacterProperties.swift b/test/stdlib/CharacterProperties.swift index 930f1da81c014..35a878e21979e 100644 --- a/test/stdlib/CharacterProperties.swift +++ b/test/stdlib/CharacterProperties.swift @@ -143,12 +143,7 @@ CharacterPropertiesTests.test("Casing") { expectEqual("SS", Character("ß").uppercased()) -// Some versions of ICU on Linux (62.1) have a bug producing the wrong value -// when lowercasing "ẞ". Darwin platforms never shipped this version, so -// conditionally test based on platform. -#if canImport(Darwin) expectEqual("ß", Character("ẞ").lowercased()) -#endif expectEqual("ΠΈ", Character("И").lowercased()) expectEqual("И", Character("ΠΈ").uppercased()) diff --git a/utils/android/build-toolchain b/utils/android/build-toolchain deleted file mode 100755 index dc51a3cad6680..0000000000000 --- a/utils/android/build-toolchain +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -# -# android/build-toolchain -# -# This source file is part of the Swift.org open source project -# -# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors -# Licensed under Apache License v2.0 with Runtime Library Exception -# -# See https://swift.org/LICENSE.txt for license information -# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors - -set -e - -SWIFT_PATH="$( cd "$(dirname $0)/../../.." && pwd )" - -ANDROID_NDK_PATH="${ANDROID_NDK_PATH:?Please set the Android NDK path in the ANDROID_NDK_PATH environment variable}" -ANDROID_ICU_PATH=${SWIFT_PATH}/libiconv-libicu-android - -[ -e ${ANDROID_ICU_PATH} ] || exit 1 - -SWIFT_ANDROID_TOOLCHAIN_PATH="${SWIFT_PATH}/swift-android-toolchain" - -rm -rf ${SWIFT_ANDROID_TOOLCHAIN_PATH} - -${SWIFT_PATH}/swift/utils/build-script \ - -R \ - --android \ - --android-ndk ${ANDROID_NDK_PATH} \ - --android-api-level 21 \ - --android-icu-uc "${ANDROID_ICU_PATH}/armeabi-v7a" \ - --android-icu-uc-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/common" \ - --android-icu-i18n "${ANDROID_ICU_PATH}/armeabi-v7a" \ - --android-icu-i18n-include "${ANDROID_ICU_PATH}/armeabi-v7a/icu/source/i18n" \ - --libdispatch --install-libdispatch \ - --foundation --install-foundation \ - --llbuild --install-llbuild \ - --lldb --install-lldb \ - --swiftpm --install-swiftpm \ - --xctest --install-xctest \ - --install-swift \ - '--swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;dev' \ - --install-prefix=/usr \ - --install-destdir=${SWIFT_ANDROID_TOOLCHAIN_PATH} - -${SWIFT_PATH}/swift-corelibs-libdispatch/build-android -${SWIFT_PATH}/swift-corelibs-foundation/build-android - diff --git a/utils/build-presets.ini b/utils/build-presets.ini index 2dafe96c345f6..aba27c5970ba8 100644 --- a/utils/build-presets.ini +++ b/utils/build-presets.ini @@ -921,18 +921,11 @@ test-optimized lit-args=-v --time-tests build-ninja -libicu libcxx android android-ndk=%(ndk_path)s android-api-level=21 -android-icu-uc=%(arm_dir)s/libicuucswift.so -android-icu-uc-include=%(arm_dir)s/icu/source/common -android-icu-i18n=%(arm_dir)s/libicui18nswift.so -android-icu-i18n-include=%(arm_dir)s/icu/source/i18n -android-icu-data=%(arm_dir)s/libicudataswift.so - build-swift-static-stdlib build-swift-static-sdk-overlay build-swift-stdlib-unittest-extra @@ -945,12 +938,9 @@ installable-package=%(installable_package)s host-test -extra-cmake-options=-DSWIFT_ENABLE_LLD_LINKER:BOOL=OFF - install-prefix=/usr install-llvm install-swift -install-libicu install-libcxx skip-test-linux diff --git a/utils/build-script b/utils/build-script index 18cb730318a5b..4440554af7e5e 100755 --- a/utils/build-script +++ b/utils/build-script @@ -225,18 +225,10 @@ def validate_arguments(toolchain, args): if args.android: if args.android_ndk is None or \ - args.android_api_level is None or \ - args.android_icu_uc is None or \ - args.android_icu_uc_include is None or \ - args.android_icu_i18n is None or \ - args.android_icu_i18n_include is None or \ - args.android_icu_data is None: + args.android_api_level is None: fatal_error( - "when building for Android, --android-ndk, " - "--android-api-level, --android-icu-uc, " - "--android-icu-uc-include, --android-icu-i18n, " - "--android-icu-i18n-include, and --android-icu-data " - "must be specified") + "when building for Android, --android-ndk " + "and --android-api-level must be specified") targets_needing_toolchain = [ 'build_indexstoredb', diff --git a/utils/build-script-impl b/utils/build-script-impl index 5caa0f32e0af5..9961e023272c1 100755 --- a/utils/build-script-impl +++ b/utils/build-script-impl @@ -89,11 +89,6 @@ KNOWN_SETTINGS=( android-api-level "" "The Android API level to target when building for Android. Currently only 21 or above is supported" android-arch "armv7" "The Android target architecture when building for Android" android-deploy-device-path "" "Path on an Android device to which built Swift stdlib products will be deployed" - android-icu-data "" "Path to libicudata.so" - android-icu-i18n "" "Path to libicui18n.so" - android-icu-i18n-include "" "Path to a directory containing headers libicui18n" - android-icu-uc "" "Path to libicuuc.so" - android-icu-uc-include "" "Path to a directory containing headers for libicuuc" android-ndk "" "An absolute path to the NDK that will be used as a libc implementation for Android builds" ## Darwin Options @@ -1905,11 +1900,6 @@ for host in "${ALL_HOSTS[@]}"; do cmake_options=( "${cmake_options[@]}" -DSWIFT_ANDROID_NDK_PATH:STRING="${ANDROID_NDK}" - -DSWIFT_ANDROID_${ANDROID_ARCH}_ICU_UC:STRING="${ANDROID_ICU_UC}" - -DSWIFT_ANDROID_${ANDROID_ARCH}_ICU_UC_INCLUDE:STRING="${ANDROID_ICU_UC_INCLUDE}" - -DSWIFT_ANDROID_${ANDROID_ARCH}_ICU_I18N:STRING="${ANDROID_ICU_I18N}" - -DSWIFT_ANDROID_${ANDROID_ARCH}_ICU_I18N_INCLUDE:STRING="${ANDROID_ICU_I18N_INCLUDE}" - -DSWIFT_ANDROID_${ANDROID_ARCH}_ICU_DATA:STRING="${ANDROID_ICU_DATA}" -DSWIFT_ANDROID_DEPLOY_DEVICE_PATH:STRING="${ANDROID_DEPLOY_DEVICE_PATH}" -DSWIFT_SDK_ANDROID_ARCHITECTURES:STRING="${ANDROID_ARCH}" ) @@ -2069,19 +2059,6 @@ for host in "${ALL_HOSTS[@]}"; do -DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD:PATH="$(build_directory ${host} libdispatch_static)" ) - if [[ ! "${SKIP_BUILD_LIBICU}" ]] ; then - LIBICU_BUILD_DIR="$(build_directory ${host} libicu)" - ICU_TMPINSTALL=${LIBICU_BUILD_DIR}/tmp_install - cmake_options=( - "${cmake_options[@]}" - -DSWIFT_PATH_TO_LIBICU_SOURCE:PATH="${LIBICU_SOURCE_DIR}" - -DSWIFT_PATH_TO_LIBICU_BUILD:PATH="${LIBICU_BUILD_DIR}" - -DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_UC_INCLUDE:STRING="${ICU_TMPINSTALL}/include" - -DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_I18N_INCLUDE:STRING="${ICU_TMPINSTALL}/include" - -DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_STATICLIB:BOOL=TRUE - ) - fi - if [[ "${SWIFT_SDKS}" ]] ; then cmake_options=( "${cmake_options[@]}" diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index ebe8d0560ea8b..4947aa7dc6273 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -201,10 +201,6 @@ cmake ^ -D PYTHON_HOME=%PYTHON_HOME% ^ -D PYTHON_EXECUTABLE=%PYTHON_HOME%\python.exe ^ -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE="%SourceRoot%\swift-corelibs-libdispatch" ^ - -D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="%BuildRoot%\Library\icu-67.1\include\unicode" ^ - -D SWIFT_WINDOWS_x86_64_ICU_UC="%BuildRoot%\Library\icu-67.1\lib64\icuuc.lib" ^ - -D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="%BuildRoot%\Library\icu-67.1\include" ^ - -D SWIFT_WINDOWS_x86_64_ICU_I18N="%BuildRoot%\Library\icu-67.1\lib64\icuin.lib" ^ -G Ninja ^ -S llvm-project\llvm || (exit /b) @@ -231,10 +227,6 @@ cmake ^ -D LLVM_DIR=%BuildRoot%\1\lib\cmake\llvm ^ -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=%BuildRoot%\1\bin ^ -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=%SourceRoot%\swift-corelibs-libdispatch ^ - -D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="%BuildRoot%\Library\icu-67.1\include\unicode" ^ - -D SWIFT_WINDOWS_x86_64_ICU_UC="%BuildRoot%\Library\icu-67.1\lib64\icuuc.lib" ^ - -D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="%BuildRoot%\Library\icu-67.1\include" ^ - -D SWIFT_WINDOWS_x86_64_ICU_I18N="%BuildRoot%\Library\icu-67.1\lib64\icuin.lib" ^ -D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ^ -D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES ^ diff --git a/utils/build-windows.bat b/utils/build-windows.bat index f604b98a337df..ce6785d160439 100644 --- a/utils/build-windows.bat +++ b/utils/build-windows.bat @@ -257,10 +257,6 @@ cmake^ -DLLVM_DIR:PATH=%build_root%\llvm\lib\cmake\llvm^ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON^ -DSWIFT_INCLUDE_DOCS:BOOL=NO^ - -DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE:PATH=%source_root%\icu-%icu_version%\include\unicode^ - -DSWIFT_WINDOWS_x86_64_ICU_UC:PATH=%source_root%\icu-%icu_version%\lib64\icuuc.lib^ - -DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE:PATH=%source_root%\icu-%icu_version%\include^ - -DSWIFT_WINDOWS_x86_64_ICU_I18N:PATH=%source_root%\icu-%icu_version%\lib64\icuin.lib^ -DSWIFT_BUILD_DYNAMIC_STDLIB:BOOL=YES^ -DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY:BOOL=YES^ -DSWIFT_BUILD_STATIC_STDLIB:BOOL=NO^ diff --git a/utils/build_swift/build_swift/driver_arguments.py b/utils/build_swift/build_swift/driver_arguments.py index cf2b19a4d7b44..d9f7c980991f8 100644 --- a/utils/build_swift/build_swift/driver_arguments.py +++ b/utils/build_swift/build_swift/driver_arguments.py @@ -1162,16 +1162,6 @@ def create_argument_parser(): help='The Android API level to target when building for Android. ' 'Currently only 21 or above is supported') - option('--android-icu-uc', store_path, - help='Path to libicuuc.so') - option('--android-icu-uc-include', store_path, - help='Path to a directory containing headers for libicuuc') - option('--android-icu-i18n', store_path, - help='Path to libicui18n.so') - option('--android-icu-i18n-include', store_path, - help='Path to a directory containing headers libicui18n') - option('--android-icu-data', store_path, - help='Path to libicudata.so') option('--android-deploy-device-path', store_path, default=android.adb.commands.DEVICE_TEMP_DIR, help='Path on an Android device to which built Swift stdlib ' diff --git a/utils/build_swift/tests/expected_options.py b/utils/build_swift/tests/expected_options.py index 31e9a637e982f..93486d18df681 100644 --- a/utils/build_swift/tests/expected_options.py +++ b/utils/build_swift/tests/expected_options.py @@ -42,11 +42,6 @@ 'android': False, 'android_api_level': '21', 'android_deploy_device_path': '/data/local/tmp', - 'android_icu_i18n': None, - 'android_icu_i18n_include': None, - 'android_icu_uc': None, - 'android_icu_uc_include': None, - 'android_icu_data': None, 'android_ndk': None, 'android_arch': 'armv7', 'assertions': True, @@ -683,11 +678,6 @@ class BuildScriptImplOption(_BaseOption): StrOption('--swift-darwin-supported-archs'), PathOption('--android-deploy-device-path'), - PathOption('--android-icu-i18n'), - PathOption('--android-icu-i18n-include'), - PathOption('--android-icu-uc'), - PathOption('--android-icu-uc-include'), - PathOption('--android-icu-data'), PathOption('--android-ndk'), PathOption('--build-subdir'), SetTrueOption('--relocate-xdg-cache-home-under-build-subdir'), diff --git a/utils/swift_build_support/swift_build_support/build_script_invocation.py b/utils/swift_build_support/swift_build_support/build_script_invocation.py index 0b127d46c4890..941ba842fad87 100644 --- a/utils/swift_build_support/swift_build_support/build_script_invocation.py +++ b/utils/swift_build_support/swift_build_support/build_script_invocation.py @@ -307,11 +307,6 @@ def convert_to_impl_arguments(self): "--android-arch", args.android_arch, "--android-ndk", args.android_ndk, "--android-api-level", args.android_api_level, - "--android-icu-uc", args.android_icu_uc, - "--android-icu-uc-include", args.android_icu_uc_include, - "--android-icu-i18n", args.android_icu_i18n, - "--android-icu-i18n-include", args.android_icu_i18n_include, - "--android-icu-data", args.android_icu_data, ] # If building natively on an Android host, only pass the API level. if StdlibDeploymentTarget.Android.contains(StdlibDeploymentTarget diff --git a/utils/swift_build_support/swift_build_support/products/libdispatch.py b/utils/swift_build_support/swift_build_support/products/libdispatch.py index d5ff58a826ad2..e4970a335a3e8 100644 --- a/utils/swift_build_support/swift_build_support/products/libdispatch.py +++ b/utils/swift_build_support/swift_build_support/products/libdispatch.py @@ -12,7 +12,6 @@ from . import cmark from . import libcxx -from . import libicu from . import llvm from . import product from . import swift @@ -52,5 +51,4 @@ def get_dependencies(cls): return [cmark.CMark, llvm.LLVM, libcxx.LibCXX, - libicu.LibICU, swift.Swift] diff --git a/utils/swift_build_support/swift_build_support/products/swift.py b/utils/swift_build_support/swift_build_support/products/swift.py index 1377a6e1277c6..e344180d690ac 100644 --- a/utils/swift_build_support/swift_build_support/products/swift.py +++ b/utils/swift_build_support/swift_build_support/products/swift.py @@ -13,7 +13,6 @@ from . import cmark from . import earlyswiftdriver from . import libcxx -from . import libicu from . import llvm from . import product from ..cmake import CMakeOptions @@ -176,5 +175,4 @@ def get_dependencies(cls): return [cmark.CMark, earlyswiftdriver.EarlySwiftDriver, llvm.LLVM, - libcxx.LibCXX, - libicu.LibICU] + libcxx.LibCXX] diff --git a/validation-test/BuildSystem/android_cross_compile.test b/validation-test/BuildSystem/android_cross_compile.test index 8a35f88ae549e..8396568dce764 100644 --- a/validation-test/BuildSystem/android_cross_compile.test +++ b/validation-test/BuildSystem/android_cross_compile.test @@ -5,7 +5,7 @@ # UNSUPPORTED: OS=watchos # RUN: %empty-directory(%t) -# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --cmake %cmake --libdispatch --cross-compile-hosts=android-aarch64 --skip-local-build --android --android-ndk %t/ndk/ --android-arch aarch64 --android-icu-uc %t/lib/libicuuc.so --android-icu-uc-include %t/include/ --android-icu-i18n %t/lib/libicui18n.so --android-icu-i18n-include %t/include/ --android-icu-data %t/lib/libicudata.so 2>&1 | %FileCheck %s +# RUN: SKIP_XCODE_VERSION_CHECK=1 SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --dry-run --cmake %cmake --libdispatch --cross-compile-hosts=android-aarch64 --skip-local-build --android --android-ndk %t/ndk/ --android-arch aarch64 2>&1 | %FileCheck %s # CHECK: -DCMAKE_Swift_FLAGS{{.*}}-target {{.*}}unknown-linux-android{{.*}} -sdk # CHECK: -DCMAKE_SYSTEM_NAME=Android {{.*}} -DCMAKE_ANDROID_NDK