Skip to content

Peery GUI app: Linking failed on Ubuntu 25.10 #423

Closed

Description

@ansarizafar

What happened

Linking failed with the following error log

Collecting modules...
Found 1 module(s): 1 native, 0 JavaScript
Generating code...
Wrote object file: main_ts.o
Linking (runtime-only)...
[strip-dedup] Processing: /home/zafaransari/Downloads/perry/libperry_ui_gtk4.a
[strip-dedup] llvm-ar not found, skipping dedup for libperry_ui_gtk4.a (optional — install with: rustup component add llvm-tools)
[strip-dedup] skipped for UI lib (non-fatal): llvm-ar not found
Warning: `pkg-config --libs gtk4` did not return GTK4 linker flags (pkg-config exited 1: Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk4', required by 'virtual:world', not found). Falling back to a hardcoded GTK4 link set — install `libgtk-4-dev` (Debian/Ubuntu) or `gtk4-devel` (Fedora/RHEL) and ensure pkg-config can find `gtk4.pc` to silence this warning.
Linking perry/ui (native UI) from /home/zafaransari/Downloads/perry/libperry_ui_gtk4.a
/usr/bin/ld: cannot find -lgtk-4: No such file or directory
/usr/bin/ld: cannot find -lgraphene-1.0: No such file or directory
collect2: error: ld returned 1 exit status
Error: Linking failed

What you expected

App should compile without linking error

Linkin.g failed

Minimal reproduction

- peery init playground
- Copy paste counter example from doc
- peery compile src/main.ts
// your code here
import { App, VStack, Text, Button, State } from "perry/ui";

const count = State(0);

App({
  title: "Counter",
  width: 400,
  height: 300,
  body: VStack(16, [
    Text(`Count: ${count.value}`),
    Button("Increment", () => count.set(count.value + 1)),
  ]),
});

Command you ran:

perry compile src/main.ts

Environment

  • Perry version: perry 0.5.465

  • Host OS: Ubuntu 25.10

  • Target: native

  • Installed via: Downloaded peery cli binary from release page on github and also tried installation from npm.

Diagnostic output

Perry Doctor

Environment Checks
──────────────────
  ✓ perry version: 0.5.465
  ✓ update status: up to date
  ✓ clang (LLVM codegen): Ubuntu clang version 20.1.8 (0ubuntu4)
  ✓ system linker (cc): cc (Ubuntu 15.2.0-4ubuntu4) 15.2.0
  ✓ runtime library: /home/zafaransari/Downloads/perry/libperry_runtime.a
  ✓ project config (perry.toml): found

All checks passed!

Anything else

CLi apps are compiling correctly but GUI app failed to link

Activity

  1. ansarizafar commented on May 2, 2026

    @ansarizafar
    Author

    I have installed all the dependencieswith following commands as suggested by Google AI but I am still unable to compile GUI app

    sudo apt update && sudo apt install libgtk-4-dev libgraphene-1.0-dev
    rustup component add llvm-tools-preview
    sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
    RUSTFLAGS="-l gstreamer-1.0 -l gstvideo-1.0 -l gstapp-1.0 -l graphene-1.0" perry compile src/main.ts

    Error log

    Collecting modules...
    Found 1 module(s): 1 native, 0 JavaScript
    Generating code...
    Wrote object file: main_ts.o
    Linking (runtime-only)...
    [strip-dedup] Processing: /home/zafaransari/softwares/node/lib/node_modules/@perryts/perry/node_modules/@perryts/perry-linux-x64/lib/libperry_ui_gtk4.a
    [strip-dedup] llvm-ar found: /home/zafaransari/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-ar
    [strip-dedup] libperry_ui_gtk4.a: 455 total members
    [strip-dedup] libperry_stdlib.a found: /home/zafaransari/softwares/node/lib/node_modules/@perryts/perry/node_modules/@perryts/perry-linux-x64/lib/libperry_stdlib.a — 1065 members loaded
    [strip-dedup] libperry_runtime.a found: /home/zafaransari/softwares/node/lib/node_modules/@perryts/perry/node_modules/@perryts/perry-linux-x64/lib/libperry_runtime.a — 16 members loaded
    [strip-dedup] Total exclude set: 1081 members from stdlib+runtime .lib files
    [strip-dedup] rlib NOT found: /home/zafaransari/softwares/node/lib/node_modules/@perryts/perry/node_modules/@perryts/perry-linux-x64/lib/libperry_ui_gtk4.rlib
    [strip-dedup] libperry_stdlib.a symbols loaded: 115427
    [strip-dedup] libperry_runtime.a symbols loaded: 3827
    [strip-dedup] libperry_ui_gtk4.a: keeping 105 of 455 members (excluded: 85 by symbol-subset, 265 by name pattern)
    [strip-dedup] Building trimmed libperry_ui_gtk4.a: 105 objects total
    [strip-dedup] OK: /home/zafaransari/softwares/node/lib/node_modules/@perryts/perry/node_modules/@perryts/perry-linux-x64/lib/libperry_ui_gtk4.a -> /tmp/perry_strip_8256/_libperry_ui_gtk4.a_trimmed.lib
    Linking perry/ui (native UI) from /tmp/perry_strip_8256/_libperry_ui_gtk4.a_trimmed.lib
    /usr/bin/ld: /tmp/perry_strip_8256/_libperry_ui_gtk4.a_trimmed.lib(gstreamer-04432f667e86df48.gstreamer.b580c28d72baf816-cgu.0.rcgu.o): undefined reference to symbol 'gst_message_parse_buffering'
    /usr/bin/ld: /lib/x86_64-linux-gnu/libgstreamer-1.0.so.0: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    Error: Linking failed
    
  2. ansarizafar commented on May 2, 2026

    @ansarizafar
    Author

    I have also installed perry in my project from npm but unable to compile app

    npm install  @perryts/perry
    npx perry compile src/main.ts
    

    Why I am getting following error

    [strip-dedup] rlib NOT found: /home/zafaransari/Downloads/perry/playground/node_modules/@perryts/perry-linux-x64/lib/libperry_ui_gtk4.rlib
    
  3. proggeramlug commented on May 2, 2026

    @proggeramlug
    Contributor

    Confirmed — this is a real link.rs bug, not a missing system package on your end. Fix is committed for v0.5.495 (next release).

    Root cause: v0.5.440 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, but the Linux GTK4 link branch only emits GTK4 libs — pkg-config --libs gtk4 doesn't transitively reference gstreamer-1.0, so ld correctly complains DSO missing from command line. Your RUSTFLAGS=… workaround was a dead-end because perry compile invokes cc directly for the final link step (RUSTFLAGS is dropped on the floor — that env var only affects cargo/rustc invocations).

    [strip-dedup] rlib NOT found is benign — it's a non-fatal fallback path that triggers symbol-based dedup instead. We don't ship the companion .rlib, so this message will always appear and isn't related to your link error.

    Workaround until v0.5.495 ships — shadow cc with a wrapper that appends the missing libs:

    sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
    mkdir -p ~/perry-cc-wrap
    cat > ~/perry-cc-wrap/cc <<'WRAP'
    #!/bin/bash
    exec /usr/bin/cc "$@" $(pkg-config --libs gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 gstreamer-video-1.0 gstreamer-audio-1.0)
    WRAP
    chmod +x ~/perry-cc-wrap/cc
    PATH=~/perry-cc-wrap:$PATH perry compile src/main.ts

    Command::new("cc") in perry honors PATH lookup, so the wrapper is picked up cleanly. It only touches link invocations (perry uses cc exclusively for linking on Linux), so it won't interfere with anything else.

    Once v0.5.495 lands the official release pipeline, you can drop the wrapper — perry compile src/main.ts will Just Work after apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev.

  4. ansarizafar commented on May 2, 2026

    @ansarizafar
    Author

    Thanks for this amazing project. I will wait for the next release.

  5. proggeramlug commented on May 5, 2026

    @proggeramlug
    Contributor

    Fix shipped in v0.5.494 (commit dd44155) — GTK4 link command now includes the gstreamer libs transitively required by the perry/media playbin backend. Current release is v0.5.523, so an npm i -g @perryts/perry (or fresh download from releases) plus apt install libgtk-4-dev libgraphene-1.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev should let perry compile src/main.ts link cleanly without the cc wrapper workaround. Closing — please reopen if you still hit the linker error on a current release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect or regression

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions