It doesn't have much benefit but comes with
a maintenance cost as we either need to keep
patching upstream's js implementation for use in
JSO — which also bloats binary size by including
two copies of brotli and its default dict — or
use the C implemntation from JS which requires boilerplate
in both C and JS and also additional JS polyfills to keep
e.g. the fontname extraction working.
The browser's in-built support for Content-Encoding
is more felxible, faster and simpler to use.
Cherry-picked from: e459c8e6ff
When -flto is enabled emscripten will generate "system libraries" cache, for all available libraries, including non-used ones.
This includes libGL.a, libal.a, libhtml5.a, which are not used in the project.
Disabling AUTONATIVE_LIBRARIES decreases compile time with -flto enabled.
Cherry-picked from: 741d41808d
Do link-time optimizations and pre-evaluate code.
-s EVAL_CTORS=1 has no change in output currently.
-flto increases output size after optimizations
Cherry-picked from: ae80c98914
Extracts default.woff2 from binary, embeds fonts.conf,
removes .data files on output.
Use --memory-init-file=0 to remove .mem files on output.
Specify fallbackFont to override default.woff2.
If lazyFileLoading is set to true, use FS.createLazyFile(). This is
off by default, as it depends on correct HTTP headers sent back.
Cherry-picked from: 7988397f91
ASS subtitles can embed fonts with a custom encoding in
their [Fonts] section. For historic reasons ass_set_extract_fonts
defaults to disabled, so we need to explicitly opt-in.
There’s currently also an issue, with embedded fonts outliving
their track, which can lead to indefinitely growing memory consumption
if not all memory fonts are cleared on track reinit.
However, ass_clear_fonts can only be safely called if the renderer
also has been released first. At this point it is simpler to just
reinit the whole library-renderer-track triplet and library inits
are not that costly anyway.
JSO never uses (non-embedded) memory fonts itself and does not expose
any way to add them so this does not constitute a user-visible change.
Even oct_add_font cannot be used by consumers of upstream JSO binaries.
Note: the JS pointers of the libass handles are updated in this patch,
but it appears they are actually never used.
Cherry-picked from: 6f2bbdb61f
The portable mkfifo approach works fine locally and worked fine in
initial GHA testing, but now it started to run into various stalling
issues on GHA. Presumably depending on whether the pipe is first written
to or read from and attempts to find a simple workaround for it failed.
Sometimes (but not always!) this is accompanied by an error like this:
cannot open ./__LICENSE_EXTRACT_QUEUE.tmp: Interrupted system call
So convert the script to bash and just use set -o pipefail.
Cherry-picked from: 94cfe111f8
Apparently licensecheck has a high startup cost, so merging invocations
promises a neat speedup. However, currently some "\x{....} cannot be
represented as ascii" error messages appear in our logs. If that happens
licensecheck exits with 255, which omits all following files of the
same invocation and also prompts `find -exec .. {} +` or `xargs` to not
spawn any more invocations. If we were to simply merge invocations by
one of those means it would result in an incomplete COPYRIGHT file.
Those encoding errors appear to be due to an ASCII locale being set in
the container, so override LC_ALL to an UTF-8 one. To further make this
bit more resilient ensure licensecheck errors are no longer ignored by
capturing and processing its exit code.
Cherry-picked from: cf04e0361a
As an intermediate measure improving build times with multiple jobs
until the toplevel Makefile can properly handle parallelism.
Cherry-picked from: e3e00035b1