Problem
Every compile-time option that changes the published static library has to
become a dimension of the CI build matrix, because we ship one monolithic
librusty_v8[...]_<target>.a per feature combination. As we add more
optional features (for example the no_icu variant in #1996), the number
of archives we build and publish grows.
Some of these axes are irreducible: v8_enable_pointer_compression and
v8_enable_i18n_support are deep V8 compile flags woven through V8's core
ABI, so they fundamentally require separate full builds.
simdutf is different, and could be made composable.
Why simdutf can be separated
- simdutf is already a discrete GN static library target
(//third_party/simdutf:simdutf).
- Only the binding functions that call into it are folded into the main
librusty_v8.a, gated by the RUSTY_V8_ENABLE_SIMDUTF define (see the
#ifdef RUSTY_V8_ENABLE_SIMDUTF section in src/binding.cc).
If those binding functions were compiled into their own small static
library (for example librusty_v8_simdutf.a) and published as a separate
artifact, the main archive would no longer reference simdutf at all.
Consumers that want simdutf would link the extra archive; consumers that
do not would link only the base archive. simdutf would then stop being a
matrix axis entirely.
Sketch
- Move the simdutf binding section out of
src/binding.cc into its own
translation unit compiled by a dedicated GN static_library target.
- Publish the resulting archive as a separate artifact (no
_simdutf
suffix permutations on the main archive).
- In
build.rs, emit an extra cargo:rustc-link-lib/search directive for
the simdutf archive when the simdutf feature is enabled, instead of
selecting a different main archive.
Caveats
- This only removes the simdutf axis.
ptrcomp and i18n remain separate
full builds because they change V8's core ABI and cannot be linked in
as add-ons.
- Needs care around symbol visibility and
complete_static_lib so the two
archives compose cleanly across platforms (including the Windows .lib).
Context: came up while adding the no_icu feature (#1996), where the slim
deno build needs simdutf + no_icu. Today that is a specific combined
archive; with this refactor it would be base + no_icu plus the standalone
simdutf archive.
Problem
Every compile-time option that changes the published static library has to
become a dimension of the CI build matrix, because we ship one monolithic
librusty_v8[...]_<target>.aper feature combination. As we add moreoptional features (for example the
no_icuvariant in #1996), the numberof archives we build and publish grows.
Some of these axes are irreducible:
v8_enable_pointer_compressionandv8_enable_i18n_supportare deep V8 compile flags woven through V8's coreABI, so they fundamentally require separate full builds.
simdutfis different, and could be made composable.Why simdutf can be separated
(
//third_party/simdutf:simdutf).librusty_v8.a, gated by theRUSTY_V8_ENABLE_SIMDUTFdefine (see the#ifdef RUSTY_V8_ENABLE_SIMDUTFsection insrc/binding.cc).If those binding functions were compiled into their own small static
library (for example
librusty_v8_simdutf.a) and published as a separateartifact, the main archive would no longer reference simdutf at all.
Consumers that want simdutf would link the extra archive; consumers that
do not would link only the base archive. simdutf would then stop being a
matrix axis entirely.
Sketch
src/binding.ccinto its owntranslation unit compiled by a dedicated GN
static_librarytarget._simdutfsuffix permutations on the main archive).
build.rs, emit an extracargo:rustc-link-lib/search directive forthe simdutf archive when the
simdutffeature is enabled, instead ofselecting a different main archive.
Caveats
ptrcompandi18nremain separatefull builds because they change V8's core ABI and cannot be linked in
as add-ons.
complete_static_libso the twoarchives compose cleanly across platforms (including the Windows
.lib).Context: came up while adding the
no_icufeature (#1996), where the slimdeno build needs
simdutf + no_icu. Today that is a specific combinedarchive; with this refactor it would be base + no_icu plus the standalone
simdutf archive.