2022-12-23 19:11:37 +00:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
rustc --version
|
|
|
|
cargo --version
|
|
|
|
|
2024-09-19 21:38:35 +00:00
|
|
|
cpus=$(nproc || sysctl -n hw.ncpu)
|
|
|
|
CARGO_FLAGS="-j${FDO_CI_CONCURRENT:-$cpus}"
|
|
|
|
|
2024-08-20 17:48:04 +00:00
|
|
|
parent="${CI_PROJECT_DIR:-$(pwd)}"
|
|
|
|
|
2022-12-23 19:11:37 +00:00
|
|
|
for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do
|
|
|
|
if [ -e "$crate/Cargo.toml" ]; then
|
|
|
|
if [ -n "$ALL_FEATURES" ]; then
|
2023-05-08 20:05:17 +00:00
|
|
|
FEATURES="--all-features"
|
2022-12-23 19:11:37 +00:00
|
|
|
else
|
|
|
|
FEATURES=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Building and testing $crate with $FEATURES"
|
|
|
|
|
2024-09-19 21:38:35 +00:00
|
|
|
cargo build $CARGO_FLAGS --locked --color=always --manifest-path "$crate/Cargo.toml" $FEATURES
|
2024-11-30 12:46:50 +00:00
|
|
|
RUST_BACKTRACE=1 G_DEBUG=fatal_warnings cargo nextest run --profile=ci --no-tests=pass $CARGO_FLAGS --color=always --manifest-path "$crate/Cargo.toml" $FEATURES
|
2024-08-20 17:48:04 +00:00
|
|
|
|
|
|
|
new_report_dir="$parent/junit_reports/$crate"
|
|
|
|
mkdir -p "$new_report_dir"
|
|
|
|
mv "$parent/target/nextest/ci/junit.xml" "$new_report_dir/junit.xml"
|
2022-12-23 19:11:37 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "$EXAMPLES_TUTORIALS" ]; then
|
2022-12-23 19:27:37 +00:00
|
|
|
# Keep in sync with examples/Cargo.toml
|
|
|
|
# List all features except windows/win32
|
examples/glupload: Remove Wayland display integration
`GstGLDisplayWayland` calls GstGLDisplayEGL::from_gl_display()` under
the hood (which calls `GstGLDisplayEGL::from_native()`, which calls
`eglGetPlatformDisplay()`) to retrieve the underlying `EGLDisplay`
handle, which thus far seems to be the same value as `glutin`. However,
newer `glutin 0.31` passes attributes to this function resulting in a
different handle, causing all kinds of trouble further down the line
when sharing resources between `glutin` and `gstreamer-rs` that both
operate on a distinct `EGLDisplay`.
Furthermore `GstGLDisplayEGL` thinks that it uniquely owns the
handle returned by `eglGetPlatformDisplay()` and _does not_ set
`.foreign_display = TRUE` (which `GstGLDisplayEGL::with_egl_display()`
would), causing it to call `eglTerminate()` as soon as the
`GstGLDisplay` is destroyed, leaving `glutin` dysfunctional.
To solve all of this, simply remove this wrongly-behaving class from the
example as it is not suitable for sharing an `EGLDisplay` with `glutin`.
It might however be interesting to create a different example that
showcases how to use raw window handles instead of EGL/GLX handles,
however only Wayland and any platform on EGL like Android, via
`GstGLDisplayEGL::from_native()`, support this.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1336>
2023-11-02 21:18:17 +00:00
|
|
|
EXAMPLES_FEATURES="--features=rtsp-server,rtsp-server-record,pango-cairo,overlay-composition,gl,gst-gl-x11,gst-gl-egl,allocators,gst-play,gst-player,ges,image,cairo-rs,gst-video/v1_18"
|
2022-12-23 19:27:37 +00:00
|
|
|
|
2024-09-19 21:38:35 +00:00
|
|
|
cargo build $CARGO_FLAGS --locked --color=always --manifest-path examples/Cargo.toml --bins --examples "$EXAMPLES_FEATURES"
|
|
|
|
cargo build $CARGO_FLAGS --locked --color=always --manifest-path tutorials/Cargo.toml --bins --examples --all-features
|
2022-12-23 19:11:37 +00:00
|
|
|
fi
|