Skip to content

Commit 9429514

Browse files
authored
Merge pull request swiftlang#40659 from buttaface/stdlib-remove-icu
[build] Remove last vestiges of ICU for anything other than Foundation
2 parents e5ecc9d + 2890d15 commit 9429514

File tree

12 files changed

+4
-85
lines changed

12 files changed

+4
-85
lines changed

CMakeLists.txt

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -310,23 +310,6 @@ set(SWIFT_ANDROID_NDK_CLANG_VERSION "12.0.8" CACHE STRING
310310
set(SWIFT_ANDROID_DEPLOY_DEVICE_PATH "" CACHE STRING
311311
"Path on an Android device where build products will be pushed. These are used when running the test suite against the device")
312312

313-
#
314-
# User-configurable ICU specific options for Android, FreeBSD, Linux, Haiku, and WASI.
315-
#
316-
317-
foreach(sdk ANDROID;FREEBSD;LINUX;WINDOWS;HAIKU;WASI)
318-
foreach(arch aarch64;armv6;armv7;i686;powerpc64;powerpc64le;s390x;wasm32;x86_64)
319-
set(SWIFT_${sdk}_${arch}_ICU_UC "" CACHE STRING
320-
"Path to a directory containing the icuuc library for ${sdk}")
321-
set(SWIFT_${sdk}_${arch}_ICU_UC_INCLUDE "" CACHE STRING
322-
"Path to a directory containing headers for icuuc for ${sdk}")
323-
set(SWIFT_${sdk}_${arch}_ICU_I18N "" CACHE STRING
324-
"Path to a directory containing the icui18n library for ${sdk}")
325-
set(SWIFT_${sdk}_${arch}_ICU_I18N_INCLUDE "" CACHE STRING
326-
"Path to a directory containing headers icui18n for ${sdk}")
327-
endforeach()
328-
endforeach()
329-
330313
#
331314
# User-configurable Darwin-specific options.
332315
#

docs/WindowsBuild.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ structure should resemble:
9292
┕ usr/...
9393
```
9494

95-
Note that only ICU is required for building the toolchain, and SQLite is only
95+
Note that ICU is only required for building Foundation, and SQLite is only
9696
needed for building llbuild and onwards. The ICU project provides binaries,
9797
alternatively, see the ICU project for details on building ICU from source.
9898

@@ -134,10 +134,6 @@ cmake -B "S:\b\1" ^
134134
-D LLVM_EXTERNAL_CMARK_SOURCE_DIR=S:\cmark ^
135135
-D LLVM_EXTERNAL_SWIFT_SOURCE_DIR=S:\swift ^
136136
-D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=S:\swift-corelibs-libdispatch ^
137-
-D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE=S:\Library\icu-67\usr\include ^
138-
-D SWIFT_WINDOWS_x86_64_ICU_I18N=S:\Library\icu-67\usr\lib\icuin67.lib ^
139-
-D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE=S:\Library\icu-67\usr\include ^
140-
-D SWIFT_WINDOWS_x86_64_ICU_UC=S:\Library\icu-67\usr\lib\icuuc67.lib ^
141137
-G Ninja ^
142138
-S S:\llvm-project\llvm
143139

docs/WindowsCrossCompile.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,14 @@ the `build-script` invocation to achieve this. You will need to expand out the
3030
path where `llvm-ar` and `llvm-ranlib` are built. These are needed to correctly
3131
build the static libraries. Note that cross-compiling will require the use of
3232
`lld`. Ensure that `lld-link.exe` is available to clang via your path.
33-
Additionally, the ICU headers and libraries need to be provided for the build.
3433

3534
#### macOS
3635

3736
```bash
3837
--extra-cmake-options=-DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER=FALSE,\
3938
-DCMAKE_AR=<path to llvm-ar>,\
4039
-DCMAKE_RANLIB=<path to llvm-ranlib>,\
41-
-DSWIFT_SDKS='OSX;WINDOWS',\
42-
-DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE=<path to ICU i18n includes>,\
43-
-DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE=<path to ICU UC includes>,\
44-
-DSWIFT_WINDOWS_x86_64_ICU_I18N=<path to ICU i18n lib>,\
45-
-DSWIFT_WINDOWS_x86_64_ICU_UC=<path to ICU UC lib>
40+
-DSWIFT_SDKS='OSX;WINDOWS'
4641
```
4742

4843
#### Linux

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,17 +1156,9 @@ function(add_swift_target_library_single target name)
11561156
target_link_libraries("${target}" INTERFACE ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
11571157
endif()
11581158

1159-
# Don't add the icucore target.
1160-
set(SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU)
1161-
foreach(item ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
1162-
if(NOT "${item}" STREQUAL "icucore")
1163-
list(APPEND SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU "${item}")
1164-
endif()
1165-
endforeach()
1166-
11671159
if(target_static)
11681160
_list_add_string_suffix(
1169-
"${SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU}"
1161+
"${SWIFTLIB_SINGLE_LINK_LIBRARIES}"
11701162
"-static"
11711163
target_static_depends)
11721164
# FIXME: should this be target_link_libraries?

test/stdlib/Character.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,12 @@ var testCharacters = [
8484
"\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 9 bytes
8585
]
8686

87-
// Only run it on ObjC platforms. Supported Linux versions do not have a
88-
// recent enough ICU
89-
#if _runtime(_ObjC)
9087
testCharacters += [
9188
"\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 11 bytes
9289
"\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 13 bytes
9390
"\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 15 bytes
9491
"\u{0061}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 17 bytes
9592
]
96-
#endif
9793

9894
testCharacters += [
9995
// U+00A9 COPYRIGHT SIGN
@@ -105,8 +101,6 @@ testCharacters += [
105101
"\u{00a9}\u{0300}\u{0300}\u{0300}\u{0300}", // UTF-8: 10 bytes
106102
]
107103

108-
// Only run it on recent enough versions of ICU
109-
#if _runtime(_ObjC)
110104
if #available(iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0, *) {
111105
testCharacters += [
112106
"\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, *) {
117111
"👩‍👩‍👦‍👦", // UTF-8: 25 bytes
118112
]
119113
}
120-
#endif
121114

122115
func randomGraphemeCluster(_ minSize: Int, _ maxSize: Int) -> String {
123116
let n = Int.random(in: (minSize + 1) ..< maxSize)
@@ -224,9 +217,6 @@ CharacterTests.test("CR-LF") {
224217
}
225218

226219
CharacterTests.test("Unicode 9 grapheme breaking") {
227-
// Only run it on ObjC platforms. Supported Linux versions do not have a
228-
// recent enough ICU for Unicode 9 support.
229-
#if _runtime(_ObjC)
230220
// Check for Unicode 9 or later
231221
guard #available(iOS 10.0, macOS 10.12, *) else { return }
232222

@@ -241,7 +231,6 @@ CharacterTests.test("Unicode 9 grapheme breaking") {
241231
let skinTone = "👋👋🏻👋🏼👋🏽👋🏾👋🏿"
242232
expectEqual(6, skinTone.count)
243233
expectEqual(skinTone.reversed().count, skinTone.count)
244-
#endif
245234
}
246235

247236
/// Test that a given `String` can be transformed into a `Character` and back

test/stdlib/CharacterProperties.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,7 @@ CharacterPropertiesTests.test("Casing") {
143143

144144
expectEqual("SS", Character("ß").uppercased())
145145

146-
// Some versions of ICU on Linux (62.1) have a bug producing the wrong value
147-
// when lowercasing "ẞ". Darwin platforms never shipped this version, so
148-
// conditionally test based on platform.
149-
#if canImport(Darwin)
150146
expectEqual("ß", Character("").lowercased())
151-
#endif
152147

153148
expectEqual("и", Character("И").lowercased())
154149
expectEqual("И", Character("и").uppercased())

utils/build-presets.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,6 @@ test-optimized
921921
lit-args=-v --time-tests
922922

923923
build-ninja
924-
libicu
925924
libcxx
926925

927926
android
@@ -942,7 +941,6 @@ host-test
942941
install-prefix=/usr
943942
install-llvm
944943
install-swift
945-
install-libicu
946944
install-libcxx
947945

948946
skip-test-linux

utils/build-script-impl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,19 +2065,6 @@ for host in "${ALL_HOSTS[@]}"; do
20652065
-DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD:PATH="$(build_directory ${host} libdispatch_static)"
20662066
)
20672067

2068-
if [[ ! "${SKIP_BUILD_LIBICU}" ]] ; then
2069-
LIBICU_BUILD_DIR="$(build_directory ${host} libicu)"
2070-
ICU_TMPINSTALL=${LIBICU_BUILD_DIR}/tmp_install
2071-
cmake_options=(
2072-
"${cmake_options[@]}"
2073-
-DSWIFT_PATH_TO_LIBICU_SOURCE:PATH="${LIBICU_SOURCE_DIR}"
2074-
-DSWIFT_PATH_TO_LIBICU_BUILD:PATH="${LIBICU_BUILD_DIR}"
2075-
-DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_UC_INCLUDE:STRING="${ICU_TMPINSTALL}/include"
2076-
-DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_I18N_INCLUDE:STRING="${ICU_TMPINSTALL}/include"
2077-
-DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_STATICLIB:BOOL=TRUE
2078-
)
2079-
fi
2080-
20812068
if [[ "${SWIFT_SDKS}" ]] ; then
20822069
cmake_options=(
20832070
"${cmake_options[@]}"

utils/build-windows-toolchain.bat

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ cmake ^
202202
-D PYTHON_EXECUTABLE=%PYTHON_HOME%\python.exe ^
203203
-D SWIFT_PATH_TO_LIBDISPATCH_SOURCE="%SourceRoot%\swift-corelibs-libdispatch" ^
204204
-D EXPERIMENTAL_STRING_PROCESSING_SOURCE_DIR=%SourceRoot%\swift-experimental-string-processing ^
205-
-D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="%BuildRoot%\Library\icu-67.1\include\unicode" ^
206-
-D SWIFT_WINDOWS_x86_64_ICU_UC="%BuildRoot%\Library\icu-67.1\lib64\icuuc.lib" ^
207-
-D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="%BuildRoot%\Library\icu-67.1\include" ^
208-
-D SWIFT_WINDOWS_x86_64_ICU_I18N="%BuildRoot%\Library\icu-67.1\lib64\icuin.lib" ^
209205

210206
-G Ninja ^
211207
-S llvm-project\llvm || (exit /b)
@@ -233,10 +229,6 @@ cmake ^
233229
-D SWIFT_NATIVE_SWIFT_TOOLS_PATH=%BuildRoot%\1\bin ^
234230
-D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=%SourceRoot%\swift-corelibs-libdispatch ^
235231
-D EXPERIMENTAL_STRING_PROCESSING_SOURCE_DIR=%SourceRoot%\swift-experimental-string-processing ^
236-
-D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="%BuildRoot%\Library\icu-67.1\include\unicode" ^
237-
-D SWIFT_WINDOWS_x86_64_ICU_UC="%BuildRoot%\Library\icu-67.1\lib64\icuuc.lib" ^
238-
-D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="%BuildRoot%\Library\icu-67.1\include" ^
239-
-D SWIFT_WINDOWS_x86_64_ICU_I18N="%BuildRoot%\Library\icu-67.1\lib64\icuin.lib" ^
240232

241233
-D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ^
242234
-D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES ^

utils/build-windows.bat

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,6 @@ cmake^
257257
-DLLVM_DIR:PATH=%build_root%\llvm\lib\cmake\llvm^
258258
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON^
259259
-DSWIFT_INCLUDE_DOCS:BOOL=NO^
260-
-DSWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE:PATH=%source_root%\icu-%icu_version%\include\unicode^
261-
-DSWIFT_WINDOWS_x86_64_ICU_UC:PATH=%source_root%\icu-%icu_version%\lib64\icuuc.lib^
262-
-DSWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE:PATH=%source_root%\icu-%icu_version%\include^
263-
-DSWIFT_WINDOWS_x86_64_ICU_I18N:PATH=%source_root%\icu-%icu_version%\lib64\icuin.lib^
264260
-DSWIFT_BUILD_DYNAMIC_STDLIB:BOOL=YES^
265261
-DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY:BOOL=YES^
266262
-DSWIFT_BUILD_STATIC_STDLIB:BOOL=NO^

0 commit comments

Comments
 (0)