shaka-packager/packager
Joey Parrish 052fb64068
ci: Enable parallel builds (#1241)
Our workflows and Dockerfiles now use Ninja on Linux & Mac, which
enables safe parallel builds. This significantly speeds up our
workflows.

GitHub Actions typical compilation times (build step only):
 - Linux 19m => 9m
 - macOS 23m => 8m
 - Windows 12m => 10m
 - Linux arm64 (self-hosted) 72m => 29m
 - Docker build 25m => 14m

Overall workflow time: 84m => 33m

Compilation time on my workstation (12 CPUs @3.3GHz): 15m => 3m

This also adds a new environment variable "PACKAGER_LOW_MEMORY_BUILD".
If defined when CMake is first run, this will configure the build to
disable parallel linking to reduce memory usage. This helps us avoid
failures on our self-hosted arm64 machines, where 6 CPUs share 4GB of
RAM.

NOTE: Parallel builds are **NOT** recommended with Unix Makefiles due to
the use of excessive RAM during parallel linking. Unix Makefiles, unlike
Ninja, cannot be configured to restrict parallel linking during a
parallel build. Anecdotally, parallel builds with Makefiles have
exhausted a system with 32GB RAM. (My workstation.)

In a follow-up, I will update the build documentation to refer to CMake
and recommend all of the flags now used in our workflows.
2023-07-17 13:16:03 -07:00
..
app Merge remote-tracking branch 'upstream/main' into cmake 2023-07-05 19:51:52 -07:00
file fix: Fix compilation on Arch Linux (#1233) 2023-07-14 12:40:12 -07:00
hls Merge remote-tracking branch 'upstream/main' into cmake 2023-07-05 19:51:52 -07:00
kv_pairs chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
media test: Fix data directory computation (#1239) 2023-07-17 10:06:10 -07:00
mpd feat: port media/event to CMake (#1222) 2023-07-13 16:25:42 -07:00
status fix: Fix status library headers and move test (#1118) 2022-10-24 19:09:10 -07:00
testing ci: Enable parallel builds (#1241) 2023-07-17 13:16:03 -07:00
third_party test: Move CentOS 8 tests to CentOS 9 Stream (#1240) 2023-07-17 11:10:28 -07:00
tools fix: Fix type error in pssh-box.py with Python 3.10+ (#1187) 2023-05-01 09:10:11 -07:00
utils feat: port media/codecs to CMake (#1143) 2022-12-15 16:53:36 -08:00
version fix: Fix compilation on Arch Linux (#1233) 2023-07-14 12:40:12 -07:00
CMakeLists.txt fix: Fix compilation on Arch Linux (#1233) 2023-07-14 12:40:12 -07:00
common.gypi chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
flag_saver.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
macros.h feat: port media/base (#1127) 2022-11-04 15:46:41 -07:00
packager.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
packager.gyp chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
packager.h chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
packager_test.cc chore: Mass-update copyright headers (#1086) 2022-08-26 08:44:59 -07:00
policies.cmake ci: Enable parallel builds (#1241) 2023-07-17 13:16:03 -07:00
protobuf.cmake feat: port media/event to CMake (#1222) 2023-07-13 16:25:42 -07:00