ci: Pass FDO_CI_CONCURRENT to meson compile

Limit the compile jobs to what the runners expect.

Related to gstreamer/gstreamer#2434

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5763>
This commit is contained in:
Jordan Petridis 2023-12-05 12:12:35 +02:00 committed by GStreamer Marge Bot
parent e8d7604a6a
commit 98ff88bda6
2 changed files with 10 additions and 5 deletions

View file

@ -446,7 +446,7 @@ build vs2022 amd64:
script: script:
- !reference [".build windows", "script"] - !reference [".build windows", "script"]
- meson setup --vsenv build $env:MESON_ARGS - 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 --version
- .\gst-env.py gst-inspect-1.0.exe - .\gst-env.py gst-inspect-1.0.exe
- mkdir destdir - mkdir destdir
@ -462,7 +462,7 @@ build vs2022 amd64 full-static:
- !reference [".build windows", "script"] - !reference [".build windows", "script"]
- echo $env:MESON_ARGS - echo $env:MESON_ARGS
- cmd.exe /C "meson setup --vsenv build --default-library=static $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 --version
- .\gst-env.py gst-inspect-1.0.exe - .\gst-env.py gst-inspect-1.0.exe
variables: variables:
@ -482,7 +482,7 @@ build vs2022 amd64 full-static:
- echo $env:MESON_CROSS_ARGS - echo $env:MESON_CROSS_ARGS
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH && - 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 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: build vs2022 x86:
extends: '.build windows cross' 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' - $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 # Configure MSYS2 to use the UCRT64 environment, start in the same directory
# and inherit PATH # 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: build macos:
extends: extends:

View file

@ -15,6 +15,11 @@ export RUSTUP_HOME="/usr/local/rustup"
export CARGO_HOME="/usr/local/cargo" export CARGO_HOME="/usr/local/cargo"
export PATH="/usr/local/cargo/bin:$PATH" 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 date -R
ci/scripts/handle-subprojects-cache.py --cache-dir /subprojects subprojects/ ci/scripts/handle-subprojects-cache.py --cache-dir /subprojects subprojects/
@ -35,7 +40,7 @@ then
fi fi
date -R date -R
meson compile -C build/ meson compile -C build/ --jobs "$jobs"
date -R date -R
if command -v ccache if command -v ccache