From 98ff88bda6caad9155f515ef1ded882ba8605dd6 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Tue, 5 Dec 2023 12:12:35 +0200 Subject: [PATCH] ci: Pass FDO_CI_CONCURRENT to meson compile Limit the compile jobs to what the runners expect. Related to gstreamer/gstreamer#2434 Part-of: --- .gitlab-ci.yml | 8 ++++---- ci/scripts/build.sh | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 913475b114..f5a4a43591 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -446,7 +446,7 @@ build vs2022 amd64: script: - !reference [".build windows", "script"] - meson setup --vsenv build $env:MESON_ARGS - - meson compile -C build + - meson compile -C build --jobs $env:FDO_CI_CONCURRENT - .\gst-env.py gst-inspect-1.0.exe --version - .\gst-env.py gst-inspect-1.0.exe - mkdir destdir @@ -462,7 +462,7 @@ build vs2022 amd64 full-static: - !reference [".build windows", "script"] - echo $env:MESON_ARGS - cmd.exe /C "meson setup --vsenv build --default-library=static $env:MESON_ARGS" - - meson compile -C build + - meson compile -C build --jobs $env:FDO_CI_CONCURRENT - .\gst-env.py gst-inspect-1.0.exe --version - .\gst-env.py gst-inspect-1.0.exe variables: @@ -482,7 +482,7 @@ build vs2022 amd64 full-static: - echo $env:MESON_CROSS_ARGS - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH && meson setup build $env:MESON_ARGS $env:MESON_CROSS_ARGS && - meson compile -C build " + meson compile -C build --jobs $env:FDO_CI_CONCURRENT" build vs2022 x86: extends: '.build windows cross' @@ -526,7 +526,7 @@ build msys2: - $env:MESON_ARGS = $env:MESON_ARGS.replace('-Dgst-plugins-bad:d3d11-wgc=enabled','') + ' -Dpython=disabled -Dintrospection=disabled' # Configure MSYS2 to use the UCRT64 environment, start in the same directory # and inherit PATH - - C:\msys64\msys2_shell.cmd -ucrt64 -defterm -no-start -here -use-full-path -lc "meson setup build $env:MESON_ARGS && meson compile -C build" + - C:\msys64\msys2_shell.cmd -ucrt64 -defterm -no-start -here -use-full-path -lc "meson setup build $env:MESON_ARGS && meson compile -C build --jobs $env:FDO_CI_CONCURRENT" build macos: extends: diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh index 8d4864494d..bd62a0862b 100755 --- a/ci/scripts/build.sh +++ b/ci/scripts/build.sh @@ -15,6 +15,11 @@ export RUSTUP_HOME="/usr/local/rustup" export CARGO_HOME="/usr/local/cargo" export PATH="/usr/local/cargo/bin:$PATH" +# nproc works on linux +# sysctl for macos +_jobs=$(nproc || sysctl -n hw.ncpu) +jobs="${FDO_CI_CONCURRENT:-$_jobs}" + date -R ci/scripts/handle-subprojects-cache.py --cache-dir /subprojects subprojects/ @@ -35,7 +40,7 @@ then fi date -R -meson compile -C build/ +meson compile -C build/ --jobs "$jobs" date -R if command -v ccache