Skip to content

v0.5.1151 regression: codegen emits js_promise_report_unhandled_rejections but runtime doesn't export it — all native links fail #4876

@proggeramlug

Description

@proggeramlug

Summary

Starting with v0.5.1151, every native link fails with an undefined symbol:

undefined reference to `js_promise_report_unhandled_rejections'
  >>> referenced by _main (perry_llvm_*.ll / .perry-cache/objects/<target>/<hash>.o : _main+0x9190)
Error: Linking failed

Codegen emits a call to js_promise_report_unhandled_rejections in the generated _main, but the linked perry_runtime/perry_stdlib does not define/export that symbol, so the link step fails for every program. This is a half-landed feature: the codegen side of the new "readable unhandled rejections" work shipped, the runtime symbol did not.

Almost certainly introduced by the v0.5.1151 unhandled-rejection changes:

  • test(#4841): ... readable unhandled rejections + handled-rejection false-positive fix (#4852)
  • fix(runtime): Promise static-method receiver + combinator/reflection/unhandled-rejection parity (#4838)

Regression window

  • v0.5.1150 — OK. iOS / macOS / Linux native builds all linked & published.
  • v0.5.1151 — broken. Same project, same config, all native targets fail at link with the symbol above.

Affected targets (confirmed in one release run)

Target Result
aarch64-apple-ios ❌ undefined symbol _js_promise_report_unhandled_rejections
aarch64-apple-tvos ❌ undefined symbol _js_promise_report_unhandled_rejections
aarch64-apple-darwin (macOS) ❌ undefined symbol _js_promise_report_unhandled_rejections
x86_64-unknown-linux-gnu ❌ undefined reference js_promise_report_unhandled_rejections
*-linux-android ✅ links & publishes

Linux failing too rules out "stale Apple cross runtimes" (cf. #4856/#4859) as the whole story — the symbol is missing from the freshly auto-optimize-rebuilt runtime as well. The build log shows auto-optimize: rebuilding runtime+stdlib (panic=unwind, features=crypto) immediately before the link failure, i.e. the rebuilt runtime still lacks the symbol.

Reproduction

perry compile (release/publish) any program with perry 0.5.1151 for an Apple or Linux native target. Minimal _main is enough — the call is emitted unconditionally.

Observed in Bloom Jump release v1.0.106:

macOS excerpt

ld64.lld: error: undefined symbol: _js_promise_report_unhandled_rejections
>>> referenced by .perry-cache/objects/macos/5c4746fd0942737c.o:(symbol _main+0x9190)
Error: Linking failed
Error: Build error [INTERNAL_ERROR]: perry compile exited with code 1

Linux excerpt

perry_llvm_..._6.ll:(.text+0x9b573): undefined reference to `js_promise_report_unhandled_rejections'
Error: Linking failed

Expected

Either the runtime exports js_promise_report_unhandled_rejections (so the feature links), or codegen guards/omits the call until the runtime symbol is available.

Workaround

Pin to v0.5.1150.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions