Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## v0.5.1165 — fix(perry-ffi): unbreak the `cargo test -p perry-ffi` link on Linux

The `cargo-test` CI gate started failing after v0.5.1164 (#5083, the http2
`server.close()` timer-id collision fix). That PR added a perry-runtime hook,
`js_register_ffi_handle_exists_probe`, declared as an `extern "C"` in
`crates/perry-ffi/src/handle.rs` and called from
`ensure_handle_exists_probe_registered`, which `register_handle` invokes
lazily on first handle creation.

In the real `perry` binary the symbol resolves because perry-runtime is always
linked in. But the **`perry-ffi` lib-test binary does not link perry-runtime**,
so the symbol is undefined there. `perry-ffi`'s unit tests (`round_trip_simple_value`,
`handles_are_unique`, …) all call `register_handle`, so the probe call sits on
a test-reachable path and survives `--gc-sections`. On Linux `ld` an undefined
reference is a hard link error (`undefined reference to
'js_register_ffi_handle_exists_probe'`), aborting the gate. macOS's linker
resolves it lazily, so it passed locally. The crate's other runtime hooks
(`perry_ffi_gc_register_*`) stay undefined harmlessly: no test-reachable code
calls them, so the linker drops their references.

Fix: split the probe out of the shared `extern "C"` block into a
`#[cfg(not(test))]` extern declaration (production, unchanged) plus a
`#[cfg(test)] #[no_mangle]` no-op definition that gives the lib-test binary a
local symbol to link against. Production codegen is byte-identical; only the
test binary gains the stub. `cargo test -p perry-ffi` now links and passes
(13 tests).
Comment on lines +1 to +26

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Please drop this changelog entry from the contributor PR.

This repo’s release policy says external contributor PRs should not edit CHANGELOG.md; maintainers add the release note at merge time.
Based on learnings, external contributor PRs should not touch CHANGELOG.md; maintainers bump version and write the changelog at merge time.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` around lines 1 - 26, Remove the contributed CHANGELOG entry
titled "v0.5.1165 — fix(perry-ffi): unbreak the `cargo test -p perry-ffi` link
on Linux" from the PR by reverting the edits to CHANGELOG.md that add that
paragraph; leave the file as it was in the base branch so maintainers can add
release notes at merge time.

Source: Learnings


## v0.5.1164 — perf(codegen): integer-specialize `i < n` loop guards when the bound is `any`/untyped

Tight integer loops whose bound is **not statically typed `number`** — most
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and LLVM for code generation.

**Current Version:** 0.5.1164
**Current Version:** 0.5.1165


## TypeScript Parity Status
Expand Down
Loading