What happened
Compiled failed, once "perry/ui" imported.
What you expected
Compiled pass.
Minimal reproduction
From official site First Native App.
File structure:
.
├── dist
├── perry.toml
├── src
│ ├── main.ts
│ └── ui
│ └── index.ts
└── tsconfig.json
// src/ui/index.ts
import { App, Text, Button, VStack, State } from "perry/ui";
const count = State(0);
export const app = () =>
App({
title: "My Counter",
width: 400,
height: 300,
body: VStack(16, [
Text(`Count: ${count.value}`),
Button("Increment", () => count.set(count.value + 1)),
Button("Reset", () => count.set(0)),
]),
});
// Main entry point
import { app } from "./ui";
function main(): void {
app();
}
main();
Command I ran:
# under dist/
perry compile ../src/main.ts -o main
Environment
- Perry version: 0.5.178 (from npm and apt) and 0.5.190 (from source)
- Host OS: Ubuntu 26.04
- Target: native
- Rust toolchain (if building from source): 1.95.0 (59807616e 2026-04-14)
- Installed via: npm, apt and from source
Diagnostic output
Installed from npm and apt
Perry doctor output:
$ perry doctor
Perry Doctor
Environment Checks
──────────────────
✓ perry version: 0.5.178
✓ update status: up to date
✓ system linker (cc): cc (Ubuntu 15.2.0-16ubuntu1) 15.2.0
⚠ runtime library: not found - run: cargo build --release -p perry-runtime
⚠ project config (perry.toml): not found - run: perry init
All critical checks passed with some warnings.
Compiler output:
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(gtk4-0296b5340b9ce438.gtk4.eb703825b6c70a06-cgu.0.rcgu.o): in function
`gio::auto::application::ApplicationExt::connect_startup::startup_trampoline':
gtk4.eb703825b6c70a06-cgu.0:(.text._ZN3gio4auto11application14ApplicationExt15connect_startup18startup_trampoline17hb91fcf16da9cd795E+0x29): undefined reference to `g_signal_handler_disconnect'
/usr/bin/x86_64-linux-gnu-ld.bfd: gtk4.eb703825b6c70a06-cgu.0:(.text._ZN3gio4auto11application14ApplicationExt15connect_startup18startup_trampoline17hb91fcf16da9cd795E+0x5a): undefined reference to `gtk_is_initialized'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(gtk4-0296b5340b9ce438.gtk4.eb703825b6c70a06-cgu.0.rcgu.o): in function
`core::ptr::drop_in_place<glib::object::ObjectBuilder<gtk4::auto::popover_menu_bar::PopoverMenuBar>>':
gtk4.eb703825b6c70a06-cgu.0:(.text._ZN4core3ptr100drop_in_place$LT$glib..object..ObjectBuilder$LT$gtk4..auto..popover_menu_bar..PopoverMenuBar$GT$$GT$17hff06a396d3b33180E+0x2d): undefined reference to `g_value_unset'
/usr/bin/x86_64-linux-gnu-ld.bfd: gtk4.eb703825b6c70a06-cgu.0:(.text._ZN4core3ptr100drop_in_place$LT$glib..object..ObjectBuilder$LT$gtk4..auto..popover_menu_bar..PopoverMenuBar$GT$$GT$17hff06a396d3b33180E+0x63): undefined reference to
`g_value_unset'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(gtk4-0296b5340b9ce438.gtk4.eb703825b6c70a06-cgu.0.rcgu.o): in function `core::ptr::drop_in_place<smallvec::SmallVec<[(&str,glib::value::Value);
16]>>':
gtk4.eb703825b6c70a06-cgu.0:(.text._ZN4core3ptr105drop_in_place$LT$smallvec..SmallVec$LT$$u5b$$LP$$RF$str$C$glib..value..Value$RP$$u3b$$u20$16$u5d$$GT$$GT$17hee804f4e59c8fbacE+0x2c): undefined reference to `g_value_unset'
/usr/bin/x86_64-linux-gnu-ld.bfd: gtk4.eb703825b6c70a06-cgu.0:(.text._ZN4core3ptr105drop_in_place$LT$smallvec..SmallVec$LT$$u5b$$LP$$RF$str$C$glib..value..Value$RP$$u3b$$u20$16$u5d$$GT$$GT$17hee804f4e59c8fbacE+0x63): undefined
reference to `g_value_unset'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(gtk4-0296b5340b9ce438.gtk4.eb703825b6c70a06-cgu.0.rcgu.o): in function `glib::object::ObjectBuilder<O>::property':
gtk4.eb703825b6c70a06-cgu.0:(.text._ZN4glib6object22ObjectBuilder$LT$O$GT$8property17h03195c0c15be73d7E+0x51): undefined reference to `g_value_init'
/usr/bin/x86_64-linux-gnu-ld.bfd: gtk
… +351 lines …
in_context_unref'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(perry_ui_gtk4-cb4cf2de5ae5f48f.perry_ui_gtk4.ed611366546234f3-cgu.10.rcgu.o): in function `glib::source::destroy_closure_local':
perry_ui_gtk4.ed611366546234f3-cgu.10:(.text._ZN4glib6source21destroy_closure_local17h677158ec48622fc7E.llvm.6832949121157324173+0x25): undefined reference to `g_object_unref'
/usr/bin/x86_64-linux-gnu-ld.bfd: perry_ui_gtk4.ed611366546234f3-cgu.10:(.text._ZN4glib6source21destroy_closure_local17h677158ec48622fc7E.llvm.6832949121157324173+0x66): undefined reference to `g_object_unref'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(perry_ui_gtk4-cb4cf2de5ae5f48f.perry_ui_gtk4.ed611366546234f3-cgu.11.rcgu.o): in function `perry_ui_gtk4::widgets::text::create':
perry_ui_gtk4.ed611366546234f3-cgu.11:(.text._ZN13perry_ui_gtk47widgets4text6create17h32bf52299ccebb35E+0xad): undefined reference to `g_object_unref'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(perry_ui_gtk4-cb4cf2de5ae5f48f.perry_ui_gtk4.ed611366546234f3-cgu.13.rcgu.o): in function `perry_ui_gtk4::widgets::spacer::create':
perry_ui_gtk4.ed611366546234f3-cgu.13:(.text._ZN13perry_ui_gtk47widgets6spacer6create17h91f567096c0d25ccE+0x42): undefined reference to `gtk_widget_add_css_class'
/usr/bin/x86_64-linux-gnu-ld.bfd: perry_ui_gtk4.ed611366546234f3-cgu.13:(.text._ZN13perry_ui_gtk47widgets6spacer6create17h91f567096c0d25ccE+0xba): undefined reference to `g_object_unref'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(perry_ui_gtk4-cb4cf2de5ae5f48f.perry_ui_gtk4.ed611366546234f3-cgu.13.rcgu.o): in function
`gio::application::ApplicationExtManual::run_with_args':
perry_ui_gtk4.ed611366546234f3-cgu.13:(.text._ZN3gio11application20ApplicationExtManual13run_with_args17h44c356292825e014E+0x100): undefined reference to `g_application_run'
/usr/bin/x86_64-linux-gnu-ld.bfd: /tmp/perry_strip_1336157/_libperry_ui_gtk4.a_trimmed.lib(perry_ui_gtk4-cb4cf2de5ae5f48f.perry_ui_gtk4.ed611366546234f3-cgu.13.rcgu.o): in function
`gtk4::auto::application::GtkApplicationExt::set_accels_for_action':
perry_ui_gtk4.ed611366546234f3-cgu.13:(.text._ZN4gtk44auto11application17GtkApplicationExt21set_accels_for_action17hcb2c25c186bf11d9E+0x71): undefined reference to `gtk_application_set_accels_for_action'
collect2: error: ld returned 1 exit status
Error: Linking failed
Installed from source
Perry doctor output:
$ perry doctor
Perry Doctor
Environment Checks
──────────────────
✓ perry version: 0.5.190
✓ update status: up to date
✓ system linker (cc): cc (Ubuntu 15.2.0-16ubuntu1) 15.2.0
✓ runtime library: /home/deval/perry/target/release/libperry_runtime.a
⚠ project config (perry.toml): not found - run: perry init
All critical checks passed with some warnings.
Compiler output:
Finished `release` profile [optimized] target(s) in 0.28s
auto-optimize: built /home/deval/perry/target/perry-auto-d95656a816e44675/release/libperry_runtime.a (37.0 MB)
auto-optimize: built /home/deval/perry/target/perry-auto-d95656a816e44675/release/libperry_stdlib.a (42.5 MB)
Linking (runtime-only)...
Error: perry/ui imported but libperry_ui_gtk4.a not found. Build with: cargo build --release -p perry-ui-gtk4 --target x86_64-unknown-linux-gnu
Then I run cargo build --release -p perry-ui-gtk4 --target x86_64-unknown-linux-gnu in perry source workspace, same compiler error output.
Anything else
libgtk-4-dev installed (4.22.2+ds-1ubuntu1)
clang version 21.1.8 (6ubuntu1)
What happened
Compiled failed, once "perry/ui" imported.
What you expected
Compiled pass.
Minimal reproduction
From official site First Native App.
File structure:
Command I ran:
# under dist/ perry compile ../src/main.ts -o mainEnvironment
Diagnostic output
Installed from npm and apt
Perry doctor output:
Compiler output:
Installed from source
Perry doctor output:
Compiler output:
Then I run
cargo build --release -p perry-ui-gtk4 --target x86_64-unknown-linux-gnuin perry source workspace, same compiler error output.Anything else
libgtk-4-devinstalled (4.22.2+ds-1ubuntu1)clangversion 21.1.8 (6ubuntu1)