Skip to content

Commit 0ee58c0

Browse files
committed
[build] Remove last vestiges of ICU for anything other than Foundation
1 parent ef821d5 commit 0ee58c0

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
@@ -304,23 +304,6 @@ set(SWIFT_ANDROID_NDK_CLANG_VERSION "12.0.8" CACHE STRING
304304
set(SWIFT_ANDROID_DEPLOY_DEVICE_PATH "" CACHE STRING
305305
"Path on an Android device where build products will be pushed. These are used when running the test suite against the device")
306306

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

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
@@ -1144,17 +1144,9 @@ function(add_swift_target_library_single target name)
11441144
target_link_libraries("${target}" INTERFACE ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
11451145
endif()
11461146

1147-
# Don't add the icucore target.
1148-
set(SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU)
1149-
foreach(item ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
1150-
if(NOT "${item}" STREQUAL "icucore")
1151-
list(APPEND SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU "${item}")
1152-
endif()
1153-
endforeach()
1154-
11551147
if(target_static)
11561148
_list_add_string_suffix(
1157-
"${SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU}"
1149+
"${SWIFTLIB_SINGLE_LINK_LIBRARIES}"
11581150
"-static"
11591151
target_static_depends)
11601152
# 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
@@ -2059,19 +2059,6 @@ for host in "${ALL_HOSTS[@]}"; do
20592059
-DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD:PATH="$(build_directory ${host} libdispatch_static)"
20602060
)
20612061

2062-
if [[ ! "${SKIP_BUILD_LIBICU}" ]] ; then
2063-
LIBICU_BUILD_DIR="$(build_directory ${host} libicu)"
2064-
ICU_TMPINSTALL=${LIBICU_BUILD_DIR}/tmp_install
2065-
cmake_options=(
2066-
"${cmake_options[@]}"
2067-
-DSWIFT_PATH_TO_LIBICU_SOURCE:PATH="${LIBICU_SOURCE_DIR}"
2068-
-DSWIFT_PATH_TO_LIBICU_BUILD:PATH="${LIBICU_BUILD_DIR}"
2069-
-DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_UC_INCLUDE:STRING="${ICU_TMPINSTALL}/include"
2070-
-DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_I18N_INCLUDE:STRING="${ICU_TMPINSTALL}/include"
2071-
-DSWIFT_${SWIFT_HOST_VARIANT_SDK}_${SWIFT_HOST_VARIANT_ARCH}_ICU_STATICLIB:BOOL=TRUE
2072-
)
2073-
fi
2074-
20752062
if [[ "${SWIFT_SDKS}" ]] ; then
20762063
cmake_options=(
20772064
"${cmake_options[@]}"

utils/build-windows-toolchain.bat

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

209205
-G Ninja ^
210206
-S llvm-project\llvm || (exit /b)
@@ -231,10 +227,6 @@ cmake ^
231227
-D LLVM_DIR=%BuildRoot%\1\lib\cmake\llvm ^
232228
-D SWIFT_NATIVE_SWIFT_TOOLS_PATH=%BuildRoot%\1\bin ^
233229
-D SWIFT_PATH_TO_LIBDISPATCH_SOURCE=%SourceRoot%\swift-corelibs-libdispatch ^
234-
-D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="%BuildRoot%\Library\icu-67.1\include\unicode" ^
235-
-D SWIFT_WINDOWS_x86_64_ICU_UC="%BuildRoot%\Library\icu-67.1\lib64\icuuc.lib" ^
236-
-D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="%BuildRoot%\Library\icu-67.1\include" ^
237-
-D SWIFT_WINDOWS_x86_64_ICU_I18N="%BuildRoot%\Library\icu-67.1\lib64\icuin.lib" ^
238230

239231
-D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES ^
240232
-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^

utils/swift_build_support/swift_build_support/products/libdispatch.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
from . import cmark
1414
from . import libcxx
15-
from . import libicu
1615
from . import llvm
1716
from . import product
1817
from . import swift
@@ -52,5 +51,4 @@ def get_dependencies(cls):
5251
return [cmark.CMark,
5352
llvm.LLVM,
5453
libcxx.LibCXX,
55-
libicu.LibICU,
5654
swift.Swift]

utils/swift_build_support/swift_build_support/products/swift.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from . import cmark
1414
from . import earlyswiftdriver
1515
from . import libcxx
16-
from . import libicu
1716
from . import llvm
1817
from . import product
1918
from ..cmake import CMakeOptions
@@ -176,5 +175,4 @@ def get_dependencies(cls):
176175
return [cmark.CMark,
177176
earlyswiftdriver.EarlySwiftDriver,
178177
llvm.LLVM,
179-
libcxx.LibCXX,
180-
libicu.LibICU]
178+
libcxx.LibCXX]

0 commit comments

Comments
 (0)