From f1915a218a35bd39eb2b5da0bb0167f3a4b53bd1 Mon Sep 17 00:00:00 2001 From: Pierre Rouanet Date: Mon, 24 Aug 2026 16:32:35 +0200 Subject: [PATCH] Build gst-plugin-rtp, and check crate names before compiling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- scripts/build.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 639bef8..c02d0e5 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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 || {