Skip to content

Perry 0.5.1220 Pre-built Version Fails to Link When Compiling Simple GUI Application on Linux x64 (Missing JavaScript Extension and AWS-LC Library Symbols) #6029

Description

@yincolor

What happened

When compiling a simple TypeScript GUI application using the Perry 0.5.1220 pre-built version downloaded from GitHub Release on an Ubuntu 24.04 (Linux x64) system, the compilation process fails during the linking stage. The linker reports numerous "undefined reference" errors, primarily involving JavaScript extension functions from the js_ext_http_* and js_http_* series, as well as an aws_lc_0_41_0_poly_Rq_mul encryption library function. This prevents the final executable from being generated.

What you expected

The compilation process should complete successfully and produce a runnable GUI application binary.

Minimal reproduction

Reproduction Code (app.ts):

import { App, Text, VStack } from "perry/ui"

App({
      title: "My App",
      width: 400,
      height: 300,
      body: VStack(16, [
          Text("Hello from Perry!"),
      ]),
})

Command you ran:

sudo apt install libgtk-4-dev libgraphene-1.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

perry app.ts -o ./app

Environment

  • Perry version: 0.5.1220
  • Host OS: Ubuntu 24.04 (Linux x64)
  • Target: linux x64 (native)
  • Rust toolchain (if building from source):
  • Installed via: Direct download of pre-built version from GitHub Release

Diagnostic output

After running the above command, the linker (/usr/bin/ld) outputs numerous errors. The core summary is as follows:

$ perry app.ts -o ./app
Collecting modules...
Found 1 module(s): 1 native, 0 JavaScript
Generating code...
Stored cached object: /home/username/.code/perry/ui_test/node_modules/.cache/perry/objects/host/804f1091bc4e5ad5.o
  note: Perry workspace source not found — linking the prebuilt full stdlib (larger binary). Set PERRY_WORKSPACE_ROOT to a source checkout to enable size-optimized rebuilds.
Linking (runtime-only)...
[strip-dedup] libperry_runtime.a: localized 31 stdlib-stub symbol(s) so perry-stdlib wins the link (#5000, macOS/Linux)
[strip-dedup] Processing: /home/username/.app/perryts/libperry_ui_gtk4.a
[strip-dedup] ar found: /usr/bin/ar
[strip-dedup] libperry_ui_gtk4.a: 547 total members
[strip-dedup] libperry_stdlib.a found: /home/username/.app/perryts/libperry_stdlib.a — 1172 members loaded
[strip-dedup] libperry_runtime.a found: /home/username/.app/perryts/libperry_runtime.a — 112 members loaded
[strip-dedup] Total exclude set: 1284 members from stdlib+runtime .lib files
[strip-dedup] rlib NOT found: /home/username/.app/perryts/libperry_ui_gtk4.rlib
[strip-dedup] libperry_stdlib.a symbols loaded: 105213
[strip-dedup] libperry_runtime.a symbols loaded: 19763
[strip-dedup] libperry_ui_gtk4.a: keeping 236 of 547 members (excluded: 37 by symbol-subset, 274 by name pattern)
[strip-dedup] Building trimmed libperry_ui_gtk4.a: 236 objects total
[strip-dedup] OK: /home/username/.app/perryts/libperry_ui_gtk4.a -> /tmp/perry_strip_268025/_libperry_ui_gtk4.a_trimmed.lib
Linking perry/ui (native UI) from /tmp/perry_strip_268025/_libperry_ui_gtk4.a_trimmed.lib
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `perry_stdlib::http::external_client_request::dispatch_method':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib4http23external_client_request15dispatch_method17hf7c0569705d2ee4eE+0x1a): undefined reference to `js_ext_http_client_request_is_handle'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib4http23external_client_request15dispatch_method17hf7c0569705d2ee4eE+0x33): undefined reference to `js_ext_http_client_request_dispatch_method'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `perry_stdlib::http::external_client_request::string_property':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib4http23external_client_request15string_property17h5176fed364a03991E+0x10): undefined reference to `js_ext_http_client_request_is_handle'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib4http23external_client_request15string_property17h5176fed364a03991E+0x23): undefined reference to `js_ext_http_client_request_dispatch_property'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `perry_stdlib::common::async_bridge::stdlib_fast_drive':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common12async_bridge17stdlib_fast_drive17h25840e60e4b87fdbE+0x18): undefined reference to `js_ext_http_client_inflight'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `perry_stdlib::common::async_bridge::js_stdlib_has_active_handles':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common12async_bridge28js_stdlib_has_active_handles17h6b4160dd0eaae7d9E+0xd6): undefined reference to `js_http_has_pending'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common12async_bridge28js_stdlib_has_active_handles17h6b4160dd0eaae7d9E+0xe0): undefined reference to `js_ext_http_client_inflight'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `perry_stdlib::common::dispatch_http::dispatch_client_request_method':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http30dispatch_client_request_method17h27f726c941d6d4ebE+0x34e): undefined reference to `js_ext_http_client_request_is_handle'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http30dispatch_client_request_method17h27f726c941d6d4ebE+0x367): undefined reference to `js_ext_http_client_request_dispatch_method'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `perry_stdlib::common::dispatch_http::dispatch_client_incoming_method':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http31dispatch_client_incoming_method17he70fff201a202ce5E+0x99): undefined reference to `js_http_is_incoming_message'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http31dispatch_client_incoming_method17he70fff201a202ce5E+0x1e7): undefined reference to `js_http_incoming_message_pipe'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `perry_stdlib::common::dispatch_http::dispatch_client_request_property':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http32dispatch_client_request_property17h18f5a8428462e9b7E+0x55d): undefined reference to `js_ext_http_client_request_is_handle'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http32dispatch_client_request_property17h18f5a8428462e9b7E+0x570): undefined reference to `js_ext_http_client_request_dispatch_property'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `perry_stdlib::common::dispatch_http::dispatch_client_incoming_property':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http33dispatch_client_incoming_property17h939851a86e1dd7a2E+0x3e): undefined reference to `js_http_is_incoming_message'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http33dispatch_client_incoming_property17h939851a86e1dd7a2E+0xf4): undefined reference to `js_http_is_incoming_message'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text._ZN12perry_stdlib6common13dispatch_http33dispatch_client_incoming_property17h939851a86e1dd7a2E+0x21a): undefined reference to `js_http_response_trailers'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `js_handle_method_dispatch':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_handle_method_dispatch+0x1206): undefined reference to `js_ext_http_agent_is_handle'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_handle_method_dispatch+0x1228): undefined reference to `js_ext_http_agent_dispatch_method'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_handle_method_dispatch+0x3625): undefined reference to `js_ext_http_client_incoming_message_is_handle'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `js_handle_property_dispatch':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_handle_property_dispatch+0x1451): undefined reference to `js_ext_http_agent_is_handle'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_handle_property_dispatch+0x1476): undefined reference to `js_ext_http_agent_dispatch_property'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `js_handle_property_set_dispatch':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_handle_property_set_dispatch+0x359): undefined reference to `js_ext_http_agent_is_handle'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_handle_property_set_dispatch+0x381): undefined reference to `js_ext_http_agent_dispatch_property_set'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(perry_stdlib-061d84d432c21055.perry_stdlib-fa0f0dda7fb64165.perry_stdlib.8e81a7269d0a2968-cgu.0.rcgu.o.rcgu.o): in function `js_http_incoming_message_set_encoding':
perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_http_incoming_message_set_encoding+0xbd): undefined reference to `js_ext_http_client_incoming_message_is_handle'
/usr/bin/ld: perry_stdlib.8e81a7269d0a2968-cgu.0:(.text.js_http_incoming_message_set_encoding+0xcd): undefined reference to `js_ext_http_client_incoming_message_set_encoding'
/usr/bin/ld: /home/username/.app/perryts/libperry_stdlib.a(5da2666a73fb65eb-hrss.o): in function `poly_mul':
hrss.c:(.text.poly_mul+0x1e): undefined reference to `aws_lc_0_41_0_poly_Rq_mul'
collect2: error: ld returned 1 exit status
Error: Linking failed

Anything else

Error Analysis

From the logs, the early compilation steps (collecting modules, generating code, library deduplication/optimization) succeed. The failure occurs during the final linking stage.

  1. Undefined JavaScript Extension Symbols: A large number of errors point to functions such as js_ext_http_client_request_is_handle, js_ext_http_client_request_dispatch_method, js_http_is_incoming_message, etc. These function names indicate they belong to JavaScript binding or extension modules related to HTTP client functionality within the Perry standard library. The linker finds code calling these functions in the libperry_stdlib.a library but cannot locate the implementations of these functions in the provided library files (libperry_stdlib.a, libperry_runtime.a, libperry_ui_gtk4.a).

  2. Undefined AWS Encryption Library Symbol: The final error points to aws_lc_0_41_0_poly_Rq_mul, a function from AWS-LC (AWS's cryptography library). This suggests that some modules of Perry (possibly related to security or HTTPS) depend on this cryptography library, but the corresponding library file was not found during linking.

Possible Causes

  1. Incomplete Pre-built Distribution: The pre-built Perry package downloaded from the GitHub Release may be missing necessary library files containing these symbols (e.g., a libperry_js_ext.a or similar JavaScript extension library, and libaws-lc.a or .so).
  2. Incorrect Library Link Paths: The packaging configuration may not have correctly set the linker search paths, preventing it from finding these dependency libraries.
  3. Build Configuration Issue: The build configuration used to generate this pre-built version may not have correctly included or exported all the symbols required for HTTP client and encryption support.

Additional Notes

  • The application code app.ts itself is syntactically correct and very simple, not explicitly using HTTP or encryption features. However, Perry's standard library may include these modules by default.
  • There is an informational note in the logs: note: Perry workspace source not found — linking the prebuilt full stdlib (larger binary). Set PERRY_WORKSPACE_ROOT to a source checkout to enable size-optimized rebuilds. This is not directly related to the linking error.

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