Skip to content

fix(link): GTK4 gstreamer link + perry-hir stale export (#423)#426

Merged
proggeramlug merged 2 commits into
mainfrom
fix/423-gtk4-gstreamer-link
May 2, 2026
Merged

fix(link): GTK4 gstreamer link + perry-hir stale export (#423)#426
proggeramlug merged 2 commits into
mainfrom
fix/423-gtk4-gstreamer-link

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Summary

Two fixes that together unblock perry compile for a GTK4 GUI app on Ubuntu 25.10 (#423).

  • Commit 1 — fix(perry-hir): drop stale export of unimplemented function: v0.5.489 (66c5e74) added lower_module_with_class_id_types_and_seed, to crates/perry-hir/src/lib.rs's pub use lower::{...} block, but the function definition was never pushed to main (it lives in an unmerged in-progress branch). Source builds of perry from main have been broken with error[E0432]: unresolved import since v0.5.489 landed. No callers on main reference the function yet, so dropping the stale export is a no-op for behavior — the export will return when the larger feature it belongs to is ready to land.

  • Commit 2 — fix(link): add gstreamer libs to GTK4 link command (#423, v0.5.494): v0.5.440 (feat(media): perry/media streaming playback (#351, v0.5.429) #371) added gstreamer = "0.23" to crates/perry-ui-gtk4/Cargo.toml for the perry/media playbin backend. The trimmed libperry_ui_gtk4.a retains the gstreamer-rs objects regardless of whether the user's program imports perry/media, but the Linux GTK4 link branch in link.rs only emits GTK4 libs (-lgtk-4 -lgio-2.0 …). pkg-config --libs gtk4 doesn't transitively reference gstreamer-1.0, so ld correctly complains undefined reference to gst_message_parse_buffering + DSO missing from command line. The user's RUSTFLAGS=-l gstreamer-1.0 … workaround was a dead-end since perry compile invokes cc directly for the final link.

    Fix: query pkg-config --libs gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 gstreamer-video-1.0 gstreamer-audio-1.0 and append the result; on failure fall back to -lgstreamer-1.0 -lgstbase-1.0 -lgstapp-1.0 -lgstvideo-1.0 -lgstaudio-1.0 (Debian/Ubuntu ship libgstbase-1.0.so.0, not libgstreamer-base-1.0.so.0 — the soname differs from the pkg-config name). The 5 libs cover what gstreamer-rs's playbin path touches in media_playback.rs. Same pkg-config → hardcoded-fallback shape as the existing GTK4 block above. Fallback warning names both the apt and dnf package names.

The [strip-dedup] rlib NOT found line the user also reported is benign — it's a fallback path that triggers symbol-based dedup, exactly what strip-dedup is designed to do when the companion .rlib isn't shipped (and we don't ship it).

Bumps version 0.5.493 → 0.5.494.

Test plan

  • cargo build --release -p perry clean on the worktree (verifies commit 1 unbreaks main + commit 2 doesn't regress)
  • End-to-end on Ubuntu 25.10 (the issue reporter's host) — GitHub runners are 22.04 / 24.04. The fix matches the gstreamer-rs build's link expectations and the pre-existing GTK4 pkg-config probe shape that's been load-bearing on Linux since v0.5.181.
  • CI: doc-tests-gtk4 + release-packages on ubuntu-22.04 / ubuntu-24.04-arm

`lower_module_with_class_id_types_and_seed` was added to the public
re-exports in v0.5.489 (66c5e74) but the function definition was never
pushed to main — it lives in an unmerged in-progress branch. Result:
`cargo build -p perry-hir` on `origin/main` HEAD fails with
`error[E0432]: unresolved import lower::lower_module_with_class_id_types_and_seed`,
so any source build of perry from main has been broken since v0.5.489
landed. The cached optimized libs still work, which is why this didn't
surface immediately.

No callers on main reference the function yet (the matching
collect_modules.rs call site is also in the in-progress branch), so
dropping the stale export is a no-op for behavior. The export will
return when the larger feature it belongs to is ready to land.
Linux GTK4 link branch only emitted GTK4 libs; pkg-config --libs gtk4
doesn't transitively reference gstreamer-1.0, so the gstreamer-rs objects
retained in libperry_ui_gtk4.a (added by v0.5.440 #371 for perry/media)
caused 'undefined reference to gst_message_parse_buffering' + 'DSO missing
from command line' at link time on Ubuntu 25.10 even with libgtk-4-dev +
libgstreamer1.0-dev installed.

Fix: query pkg-config --libs for gstreamer-1.0 + base/app/video/audio,
fall back to hardcoded -lgstreamer-1.0 -lgstbase-1.0 -lgstapp-1.0
-lgstvideo-1.0 -lgstaudio-1.0 with a warning that names the apt + dnf
package names.
@proggeramlug proggeramlug merged commit af80bda into main May 2, 2026
7 of 9 checks passed
@proggeramlug proggeramlug deleted the fix/423-gtk4-gstreamer-link branch May 2, 2026 15:59
proggeramlug added a commit that referenced this pull request May 3, 2026
…rt &str API

Two post-rebase fixups against origin/main:

- crates/perry-hir/src/lib.rs: re-export `lower_module_with_class_id_types_and_seed`.
  The export was dropped during the rebase resolution against #426
  (which removed an unrelated stale export); the function itself still
  lives in lower.rs and is still called by collect_modules. Without
  this re-export the perry binary fails to link with E0425.

- crates/perry/src/commands/compile/collect_modules.rs: pass
  `src.as_str()` to `cached_resolve_import`. Upstream tightened the
  parameter to `&str`; our existing call site passed `&String`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant