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

Build cleanup #139

Merged
merged 20 commits into from
Jun 17, 2022
Merged

Build cleanup #139

merged 20 commits into from
Jun 17, 2022

Conversation

TheOneric
Copy link
Member

@TheOneric TheOneric commented May 29, 2022

Follow up to the “patch cleanup” series and comments in #129.

From previous discussion:

  • Change to a submodule reset instead of update to master (supersedes 0ef4dc5 from [WIP] Build refactor #129)
  • Mark non-file targets as .PHONY
  • Macroise all the repeated setup and configure bits
  • Move more flags to global scope if appropiate
  • Remove unnecessary flags

Additionally this also simplifies the brotli build by backporting one commit from upstream (not yet found in a release) and as an intermediate measure to improve buildtimes until the Makefile can properly handle intra-target parallelism we now use “number of logical cores” for each build and the license extraction is split off into a separate file called running multiple jobs in parallel.

Judging from the runs so far this reduces the GHA times (2 logical cores available) from previously 21-18 minutes to now 15-13 minutes.

@TheOneric TheOneric requested a review from TFSThiagoBR98 May 29, 2022 16:10
TheOneric added 7 commits May 29, 2022 18:11
This is likely more common action. Also updating submodules
usually involves updating our patches which can't be automated.
So that all git-* targets are grouped together.
Possibly it did something in older versions, in current ones only
the compiler set __EMSCRIPTEN__ macro is used in checks.
Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
TheOneric added 12 commits June 1, 2022 14:41
The last released version of brotli we use, blocks the install target
when building with emscripten, which is why we currently need to
manually copy files of interest to their installed location.
This adds complexity and is prone to failure with future changes.
Upstream no longer blocks installations with emscripten since
  google/brotli@ce222e3
from 23.06.2021.

We could just bump the brotli version to latest master, but then our
already existing patch would need updating and from a quick look
it appears as if other things changed as well which might not all be
compatible with our baseline target out of the box. AN eventual new
release with release notes will hopefully detail the changes in a
more accessible form.
As a safe option, just backport the upstream commit as another patch.

We still need to normalise the static library names though.
emscripten already sets PKG_CONFIG_LIBDIR preventing non-wasm libraries
installed in the system to be detected (and it doesn't provide a way for
us to set _LIBDIR ourselves).
autoconf and cmake will pick up the variable from the environment.
To be more concise and to keep config flags from drifting apart
(they already varied slightly between submodules).
Previously some builds used a hardcoded number of 8 and others
didn't set it at all falling back to a single threaded build.

This still isn't ideal though. What we actually want is to fix up
or Makefile to allow builders to pass the number of jobs to the toplevel
and then a buildserver can distribute the available jobs across the
targets allowing inter-target parallelism.
For now, this already is a clear improvement.

The fribidi build appears to have a borked dependency on generated
sources when running from a subdir, which resulted in parallel builds
sometimes failing. To fix this the relevant header is now generated
explicitly before other build steps.
As an intermediate measure improving build times with multiple jobs
until the toplevel Makefile can properly handle parallelism.
They appear to have been commented out since the first public release
and it's not clear what they were intended for or if they'd even still
work with current emscripten.
The latter is required as it's picked up by buildsystems,
the former is only used once by us and can easily be replaced
by the latter.
A new version (0.16.0) was released.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants