diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d44490ca2e..36a4d75bb2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -333,7 +333,7 @@ commitlint: # https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3197 GI_SCANNER_DISABLE_CACHE: "1" script: - - $CI_PROJECT_DIR/ci/scripts/build.sh + - $CI_PROJECT_DIR/ci/scripts/build.sh build/ - ./gst-env.py gst-inspect-1.0 --version - ./gst-env.py gst-inspect-1.0 after_script: @@ -359,7 +359,7 @@ commitlint: MESON_ARGS: "${SIMPLE_BUILD}" SUBPROJECTS_CACHE_DIR: "/subprojects" script: - - $CI_PROJECT_DIR/ci/scripts/build.sh + - $CI_PROJECT_DIR/ci/scripts/build.sh build/ - ./gst-env.py gst-inspect-1.0 --version - ./gst-env.py gst-inspect-1.0 - G_DEBUG=fatal_criticals ./gst-env.py gst-inspect-1.0 --print-all --gst-disable-registry-fork > /dev/null @@ -640,8 +640,8 @@ build macos: - mkdir -p ~/.config/gdb - echo "set auto-load safe-path /" >> ~/.config/gdb/gdbinit - - $CI_PROJECT_DIR/ci/scripts/build.sh - - $CI_PROJECT_DIR/ci/scripts/test.sh + - $CI_PROJECT_DIR/ci/scripts/build.sh build/ + - $CI_PROJECT_DIR/ci/scripts/test.sh build/ $TEST_SUITE after_script: - mv build/meson-logs/ meson-logs artifacts: @@ -715,7 +715,7 @@ check video formats: WL_TOKEN: "GST_WL_VIDEO_FORMATS" WL_HEADER: "subprojects/gst-plugins-bad/gst-libs/gst/wayland/gstwlvideoformat.h" script: - - $CI_PROJECT_DIR/ci/scripts/build.sh + - $CI_PROJECT_DIR/ci/scripts/build.sh build/ - $CI_PROJECT_DIR/ci/scripts/check-video-formats.sh rules: - changes: @@ -739,7 +739,7 @@ gstreamer-full static build: -Ddoc=disabled SUBPROJECTS_CACHE_DIR: "/subprojects" script: - - $CI_PROJECT_DIR/ci/scripts/build.sh + - $CI_PROJECT_DIR/ci/scripts/build.sh build/ - meson test -C build -v test-gst-full gstreamer-full-minimal static build: @@ -764,7 +764,7 @@ gstreamer-full-minimal static build: SUBPROJECTS_CACHE_DIR: "/subprojects" script: - - $CI_PROJECT_DIR/ci/scripts/build.sh + - $CI_PROJECT_DIR/ci/scripts/build.sh build/ - meson test -C build -v test-gst-full - meson test -C build test-gst-full-features --test-args "-e filesrc,identity,fakesink -E filesink,capsfilter -t audio/x-wav -T video/vivo -d alsadeviceprovider -D v4l2deviceprovider -l GstVideoMultiviewFlagsSet" - strip build/libgstreamer-full-1.0.so @@ -802,7 +802,7 @@ fluster v4l2-stateless on visl: -Dgst-plugins-good:matroska=enabled SUBPROJECTS_CACHE_DIR: "/subprojects" script: - - $CI_PROJECT_DIR/ci/scripts/build.sh + - $CI_PROJECT_DIR/ci/scripts/build.sh build/ - meson test -C build -v --suite v4l2-stateless-decoders artifacts: reports: @@ -941,7 +941,7 @@ valgrind ges: SUBPROJECTS_CACHE_DIR: "/subprojects" CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/" script: - - $CI_PROJECT_DIR/ci/scripts/build-docs.sh + - $CI_PROJECT_DIR/ci/scripts/build-docs.sh build/ artifacts: when: always expire_in: "7 days" diff --git a/ci/scripts/build-docs.sh b/ci/scripts/build-docs.sh index 8fee83b515..b2c7e45fbb 100755 --- a/ci/scripts/build-docs.sh +++ b/ci/scripts/build-docs.sh @@ -1,5 +1,12 @@ #! /bin/bash +builddir="$1" + +if [[ -z "$builddir" ]]; then + echo "Usage: build-docs.sh " + exit 1 +fi + set -eux export PATH="/usr/local/cargo/bin/:/usr/local/bin/:$PATH" @@ -9,21 +16,21 @@ export CARGO_HOME="/usr/local/cargo" ./ci/scripts/handle-subprojects-cache.py --cache-dir /subprojects subprojects/ echo "$MESON_ARGS" -meson setup build/ $MESON_ARGS +meson setup "$builddir" $MESON_ARGS ccache --show-stats -ninja -C build/ update_girs +ninja -C "$builddir" update_girs # Ignore modifications to wrap files made by meson git checkout $(git ls-files 'subprojects/*.wrap') ./ci/scripts/check-diff.py "gir files" -./gst-env.py ninja -C build/ plugins_doc_caches +./gst-env.py ninja -C "$builddir" plugins_doc_caches # Ignore modifications to wrap files made by meson git checkout $(git ls-files 'subprojects/*.wrap') ./ci/scripts/check-diff.py export GI_TYPELIB_PATH="$PWD/girs" -hotdoc run --conf-file build/subprojects/gst-docs/GStreamer-doc.json +hotdoc run --conf-file "$builddir/subprojects/gst-docs/GStreamer-doc.json" -mv build/subprojects/gst-docs/GStreamer-doc/html documentation/ +mv "$builddir/subprojects/gst-docs/GStreamer-doc/html" documentation/ diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh index bd62a0862b..6f559b5ed0 100755 --- a/ci/scripts/build.sh +++ b/ci/scripts/build.sh @@ -1,5 +1,12 @@ #! /bin/bash +builddir="$1" + +if [[ -z "$builddir" ]]; then + echo "Usage: build.sh " + exit 1 +fi + set -eux # Expects: @@ -31,7 +38,7 @@ if [ "$GST_WERROR" = "true" ]; then fi date -R -meson setup build/ --native-file ./ci/meson/gst-ci-cflags.ini ${ARGS} +meson setup "$builddir" --native-file ./ci/meson/gst-ci-cflags.ini ${ARGS} date -R if command -v ccache @@ -40,7 +47,7 @@ then fi date -R -meson compile -C build/ --jobs "$jobs" +meson compile -C "$builddir" --jobs "$jobs" date -R if command -v ccache diff --git a/ci/scripts/test.sh b/ci/scripts/test.sh index 57b299b159..a13d660891 100755 --- a/ci/scripts/test.sh +++ b/ci/scripts/test.sh @@ -1,5 +1,13 @@ #! /bin/bash +builddir="$1" +tests="$2" + +if [[ -z "$builddir" || -z "$tests" ]]; then + echo "Usage: test.sh " + exit 1 +fi + set -eux timeout="${TIMEOUT_FACTOR:="2"}" @@ -7,10 +15,11 @@ validate="${EXTRA_VALIDATE_ARGS:=""}" parent="${CI_PROJECT_DIR:-$(pwd)}" export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)" -echo "-> Running ${TEST_SUITE}" +echo "-> Running $tests" ./gst-env.py \ - gst-validate-launcher ${TEST_SUITE} \ + "--builddir=$builddir" \ + gst-validate-launcher "$tests" \ --check-bugs \ --dump-on-failure \ --mute \