Skip to content

fix(container): remove legacy compose FFI - #8441

Merged
proggeramlug merged 2 commits into
PerryTS:mainfrom
proggeramlug:fix/8422-remove-legacy-compose-ffi
Aug 20, 2026
Merged

fix(container): remove legacy compose FFI#8441
proggeramlug merged 2 commits into
PerryTS:mainfrom
proggeramlug:fix/8422-remove-legacy-compose-ffi

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Delete perry-container-compose's unused legacy FFI feature and module, whose private 4-byte string header was incompatible with the runtime's 20-byte string ABI. The canonical stack-handle compose FFI in perry-stdlib remains unchanged.

Changes

  • Remove the legacy ffi Cargo feature, module gate, and duplicate js_compose_* exports.
  • Remove the now-moot collision warning from perry-stdlib's dependency declaration.
  • Add a structural regression test that prevents the legacy feature/module from being reintroduced.

Related issue

Fixes #8422

Test plan

  • cargo fmt --all -- --check

  • cargo check -p perry-container-compose

  • Confirmed cargo check -p perry-container-compose --features ffi now fails because the feature no longer exists.

  • cargo test -p perry-container-compose (171 tests passed)

  • Canonical stdlib compose FFI smoke tests passed within cargo test -p perry-stdlib --features container --tests (129 lib tests passed). The run then stopped on six existing promise-state assertions in container_backend_selection; the same six failures reproduce on untouched main at 526e0b502.

  • cargo build --profile perry-dev -p perry -p perry-runtime-static -p perry-stdlib-static

  • cargo build --release clean

  • cargo test --workspace --exclude perry-ui-ios --exclude perry-ui-tvos --exclude perry-ui-watchos --exclude perry-ui-gtk4 --exclude perry-ui-android --exclude perry-ui-windows passes

  • (if user-facing) Added or updated a test under test-files/ or a #[test] in the affected crate

  • (if CLI / stdlib / runtime API changed) Updated docs/src/ (not applicable; canonical API is unchanged)

  • (if touching a platform UI backend) Built -p perry-ui-<backend> locally on that platform (not applicable)

Screenshots / output

Not applicable.

Checklist

  • I have NOT bumped the workspace version or edited CLAUDE.md / CHANGELOG.md (maintainer handles these at merge)
  • My commits follow the loose feat: / fix: / docs: / chore: prefix convention used in the log
  • I've read CONTRIBUTING.md and agree to the Code of Conduct

Summary by CodeRabbit

  • Breaking Changes

    • Removed the legacy Compose FFI interface and duplicate JavaScript Compose exports.
    • Compose FFI access remains available through the supported standard-library interface.
  • Documentation

    • Added a changelog entry describing the legacy interface removal.
  • Tests

    • Added regression coverage to ensure the removed legacy interface does not return.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fae321b9-099d-431b-acdb-83d36db641b1

📥 Commits

Reviewing files that changed from the base of the PR and between 526e0b5 and 0140cfc.

📒 Files selected for processing (6)
  • changelog.d/8441-remove-legacy-compose-ffi.md
  • crates/perry-container-compose/Cargo.toml
  • crates/perry-container-compose/src/ffi.rs
  • crates/perry-container-compose/src/lib.rs
  • crates/perry-container-compose/tests/legacy_ffi_removed.rs
  • crates/perry-stdlib/Cargo.toml
💤 Files with no reviewable changes (4)
  • crates/perry-stdlib/Cargo.toml
  • crates/perry-container-compose/Cargo.toml
  • crates/perry-container-compose/src/lib.rs
  • crates/perry-container-compose/src/ffi.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The change removes the unused legacy Compose FFI feature and implementation from perry-container-compose. It adds a regression test for the removed surface and documents that Compose FFI remains available through perry-stdlib.

Changes

Legacy Compose FFI removal

Layer / File(s) Summary
Remove legacy FFI surface
crates/perry-container-compose/Cargo.toml, crates/perry-container-compose/src/lib.rs, crates/perry-container-compose/src/ffi.rs
Removed the ffi feature, its feature-gated module declaration, and the legacy Compose FFI implementation and exports.
Verify and document removal
crates/perry-container-compose/tests/legacy_ffi_removed.rs, changelog.d/8441-remove-legacy-compose-ffi.md
Added checks for the absent feature and module. Documented removal of the legacy exports and retention of the canonical perry-stdlib stack-handle exports.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 0140c

The PR removes the unused legacy compose FFI while leaving the canonical API unchanged; no actionable merge-blocking risk remains, aside from a localized test-robustness follow-up if the manifest has no features table.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes removal of the legacy Compose FFI.
Description check ✅ Passed The description covers the required sections, explains the changes, links issue #8422, and documents validation results and limitations.
Linked Issues check ✅ Passed The changes delete the unsafe legacy feature and module, preserve the canonical FFI, remove the obsolete warning, add regression coverage, and include a changelog fragment.
Out of Scope Changes check ✅ Passed All changes support issue #8422 or the repository workflow, with no unrelated code changes identified.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Validated as part of an 11-PR batch (#8439, #8440, #8441, #8442, #8443, #8444, #8446,
#8448, #8450, #8453, #8454) stacked on main and built once, then merged individually.

  • 19/19 sweep corpus byte-exact against the Node oracle
  • perry-runtime --lib 2601 · perry --bin perry 1007 · perry-codegen --lib 1113
  • scripts/run_lint_gates.sh — all 50 gates
  • A re-entrancy probe (user JS re-entering via toString/valueOf/replacer/comparator
    during normalize, repeat, regex lastIndex coercion, replace, JSON.stringify,
    sort, and punycode host conversion) matches Node exactly, including under
    PERRY_GC_FORCE_EVACUATE=1 PERRY_GC_VERIFY_EVACUATION=1.

One thing stated plainly: these are hardening, not demonstrated repairs

I could not make the underlying bugs reproduce. My probe passes on unmodified main, and so
do all four of the fixtures this series ships
(test_issue_8426_normalize_reentrant, test_issue_8428_exec_lastindex_reentrant,
test_gap_gc_string_copy_source_rooting, test_gap_gc_string_repeat_reentrant_count) —
including under PERRY_GC_FORCE_EVACUATE=1, PERRY_GC_VERIFY_EVACUATION=1, and
PERRY_GC_PROTECT_FROMSPACE=1 at depth 800.

That is consistent with the string audit having found these windows by reading rather than by
reproducing, and with this bug class being invisible at collection time. The changes are
still worth landing — an unrooted borrow across user JS is a real latent hazard. But the
merge rests on "correct by construction and regression-free", not on "fixes an observed
failure", and the fixtures should be understood as no-regression guards rather than
reproducers.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

container-compose: legacy ffi feature mirrors StringHeader as 4 bytes (payload at +4 vs the 20-byte ABI) — delete or repair

1 participant