diff --git a/README.md b/README.md index 1a6aa0c..7e83b0b 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,14 @@ platform), dispatch the workflow with `platforms: android` or `platforms: ios`. ## The gn args are load-bearing They are commented at their definition in `scripts/matrix/build-android.sh` and -`scripts/matrix/build-ios.sh`. Three worth knowing: +`scripts/matrix/build-ios.sh`. Four worth knowing: + +- `v8_enable_i18n_support=true` with `icu_use_data_file=false` — the 10.3 + builds had i18n off, so `Intl` did not exist and `localeCompare`, + `toLocale*String`, `String#normalize` and RegExp `\p{…}` were missing or + locale-blind. The ICU data is linked into the libraries (Chromium's `android` + filter on Android, `ios` on iOS and Catalyst, `common` on tvOS), so + `V8::InitializeICU` is a no-op and the runtimes need no `icudtl.dat`. - `cppgc_enable_caged_heap=false` (iOS only) — it defaults to **true on arm64** and, contrary to how the flags read, does *not* track diff --git a/scripts/matrix/build-android.sh b/scripts/matrix/build-android.sh index 45a3317..388758c 100755 --- a/scripts/matrix/build-android.sh +++ b/scripts/matrix/build-android.sh @@ -68,9 +68,16 @@ if [ "$(uname)" != "Linux" ] && { [ "$CPU" = "arm" ] || [ "$CPU" = "x86" ]; }; t exit 1 fi -# Reproduces the shape of the 10.3 build these libraries replace: JIT and -# WebAssembly on, i18n off. Every deviation from the gn defaults is deliberate: +# Reproduces the shape of the 10.3 build these libraries replace (JIT and +# WebAssembly on), except that i18n is now on. Every deviation from the gn +# defaults is deliberate: # +# v8_enable_i18n_support / icu_use_data_file +# 10.3 shipped with i18n off, which removes Intl, the locale-aware +# toLocale*String/localeCompare/case mapping, String#normalize and RegExp +# \p{...}. The ICU data (Chromium's android filter) is linked into the +# monolith rather than loaded from icudtl.dat, so V8::InitializeICU is a +# no-op and the runtime needs no data file to find. # v8_array_buffer_internal_field_count / ..._view_... # Defaulted to 2 in 10.3, default to 0 in 14.9. The Android runtime # marshals an ArrayBuffer to a Java NIO buffer by linking its @@ -113,7 +120,7 @@ GN_ARGS=" v8_static_library=true v8_use_external_startup_data=false - v8_enable_i18n_support=false + v8_enable_i18n_support=true v8_enable_webassembly=true v8_enable_sandbox=false v8_enable_temporal_support=false diff --git a/scripts/matrix/build-ios.sh b/scripts/matrix/build-ios.sh index 19e832a..9aa3180 100755 --- a/scripts/matrix/build-ios.sh +++ b/scripts/matrix/build-ios.sh @@ -98,6 +98,12 @@ MODULES=( # process by device RAM, so that reservation fails outright on smaller devices # -- four tries, then Oilpan's fatal OOM handler, before any JS runs. It crashed # on an iPad Air while an iPad Pro was fine. +# +# v8_enable_i18n_support=true with icu_use_data_file=false links the ICU data +# into the icudata object, which libv8_third_party picks up with the rest of +# ICU, so V8::InitializeICU is a no-op and the runtime needs no icudtl.dat. +# iOS and Catalyst get Chromium's ios data filter; tvOS gets the common one, +# because the ICU build only selects the ios filter when use_blink is false. GN_ARGS=" target_os=\"ios\" treat_warnings_as_errors=false @@ -113,7 +119,7 @@ GN_ARGS=" v8_use_external_startup_data=false v8_enable_sandbox=false v8_enable_debugging_features=false - v8_enable_i18n_support=false + v8_enable_i18n_support=true v8_enable_temporal_support=false v8_enable_pointer_compression=false v8_enable_v8_checks=false @@ -201,10 +207,10 @@ archive_lib "libcrdtp_platform" "$OUTFOLDER/obj/third_party/inspector_protocol/c archive_lib "libinspector" "$OUTFOLDER/obj/src/inspector/inspector/*.o" archive_lib "libinspector_string_conversions" "$OUTFOLDER/obj/src/inspector/inspector_string_conversions/*.o" -# abseil, simdutf and highway plus the libm trig sources: referenced by v8_base -# but part of no module above. zlib and inspector_protocol are excluded because -# they ship as libzip/libcrdtp; rust is excluded because disabling Temporal -# leaves only stale objects behind. +# ICU (code and data), abseil, simdutf and highway plus the libm trig sources: +# referenced by v8_base but part of no module above. zlib and inspector_protocol +# are excluded because they ship as libzip/libcrdtp; rust is excluded because +# disabling Temporal leaves only stale objects behind. THIRD_PARTY_OBJS=$(find "$OUTFOLDER/obj/third_party" -name "*.o" \ ! -path "*/zlib/*" ! -path "*/inspector_protocol/*" ! -path "*/rust/*" 2>/dev/null) archive_lib "libv8_third_party" "$THIRD_PARTY_OBJS $OUTFOLDER/obj/libm/*.o" diff --git a/tests/apple-args.py b/tests/apple-args.py index fcd1590..1ed7e81 100644 --- a/tests/apple-args.py +++ b/tests/apple-args.py @@ -35,5 +35,11 @@ def test_ios_and_catalyst_do_not_receive_tvos_overrides(self): self.assertIn('is_debug=false', args) self.assertEqual('v8_enable_lite_mode=true' in args, 'catalyst' not in variant) + def test_every_variant_embeds_icu(self): + for variant in ['arm64-device', 'arm64-simulator', 'x64-simulator', 'arm64-catalyst', 'x64-catalyst', 'arm64-tvdevice', 'arm64-tvsimulator']: + args = self.args_for(variant) + self.assertIn('v8_enable_i18n_support=true', args) + self.assertIn('icu_use_data_file=false', args) + if __name__ == '__main__': unittest.main()