Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TheOneric] Speedup license extraction #44

Merged
merged 6 commits into from
Jan 9, 2023

Conversation

dmitrylyzo
Copy link
Collaborator

Pulling from the upstream.
Original author: TheOneric

Part of libass#139 + non-PRed commits

TheOneric and others added 6 commits December 26, 2022 13:49
As an intermediate measure improving build times with multiple jobs
until the toplevel Makefile can properly handle parallelism.

Cherry-picked from: libass@e3e0003
It exists in the toplevel Makefile.
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: libass@cf04e03
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: libass@94cfe11
@dmitrylyzo dmitrylyzo merged commit 0150e52 into jellyfin:master Jan 9, 2023
@dmitrylyzo dmitrylyzo deleted the TheOneric/license_speedup branch January 9, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants