Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions scripts/matrix/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions scripts/matrix/build-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions tests/apple-args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()