Build gst-plugin-rtp, and check crate names before compiling

Second failure, and a self-inflicted one: `gst-plugin-rsrtp` is not a package
in gst-plugins-rs at 0.15.3 — or at 0.14.5. The crate is `gst-plugin-rtp`,
whose lib is named `gstrsrtp`, so the plugin filename and the package name
differ.

I took `gst-plugin-rsrtp` from reachy-mini-desktop-app README, which documents
a cargo cinstall line that cannot have worked at either tag. Read the crate
Cargo.toml, not a README — the source was one API call away.

The rockchip plugin and gst-plugin-webrtc both built fine, so the pin move in
the previous commit was right; this was the next thing along.

Also validates every crate name with `cargo pkgid` before compiling any of
them. cargo cinstall only checks a package name when it reaches it, so a typo
in the second crate surfaces after the first has spent three minutes building.
Now it costs a second.

Assisted-by: Claude:claude-opus-5[1m] shellcheck
This commit is contained in:
Pierre Rouanet 2026-08-24 16:32:35 +02:00
parent 89e5be7861
commit f1915a218a

View File

@ -174,9 +174,26 @@ build_webrtc() {
|| die "cannot clone ${GST_PLUGINS_RS_REPO} at ${GST_PLUGINS_RS_REF}"
install -d "$DIST" "$STAGE"
# Two plugins, not one: Pollen's desktop app ships `libgstrswebrtc.so` *and*
# `libgstrsrtp.so`, and the same stack wants both.
for crate in gst-plugin-webrtc gst-plugin-rsrtp; do
# Two crates, not one: the same stack wants `libgstrswebrtc.so` *and* `libgstrsrtp.so`.
#
# `gst-plugin-rtp`, whose lib is named `gstrsrtp` — the plugin filename and the crate name
# differ, which is how the wrong one gets used. Pollen's reachy-mini-desktop-app README
# documents `cargo cinstall -p gst-plugin-rsrtp`, and no such package exists in 0.14.5 or
# 0.15.3; taking that name on trust cost a build. Read the crate's Cargo.toml, not a README.
CRATES="gst-plugin-webrtc gst-plugin-rtp"
# Checked before anything is compiled. `cargo cinstall` validates the package name only when
# it gets to it, so a typo in the second crate is discovered after the first has spent three
# minutes building — which is exactly what happened.
bad=""
for crate in $CRATES; do
( cd "${src}/s" && cargo pkgid -p "$crate" >/dev/null 2>&1 ) || bad="$bad $crate"
done
[ -z "$bad" ] || die "not workspace members of gst-plugins-rs ${GST_PLUGINS_RS_REF}:${bad}
Package names move between releases. Check net/*/Cargo.toml at that tag."
for crate in $CRATES; do
say "cargo cinstall ${crate}"
( cd "${src}/s" && cargo cinstall -p "$crate" --prefix "$STAGE" --libdir lib --release ) \
>"${src}/${crate}.log" 2>&1 || {