Commit defdf41
Ralph Küpper
fix(perry-ffi): unbreak
#5083 added a `js_register_ffi_handle_exists_probe(...)` call inside
`register_handle` (handle.rs) for the runtime's handle-vs-timer disambiguation
probe. That symbol is defined in perry-runtime, but perry-ffi's `runtime-link`
feature is off by default and CI runs `cargo test -p perry-ffi` per-package in
isolation (no --workspace feature unification). The handle-registry tests
(bare `#[cfg(test)]`) call `register_handle`, so the test binary retained a
reference to an unlinked symbol and failed at `cc` with `undefined reference`.
Gating the handle tests on `runtime-link` (the pattern other perry-ffi test
modules use) would drop them from CI entirely (the per-package loop never
enables the feature). Instead add a test-only no-op stub gated
`#[cfg(all(test, not(feature = "runtime-link")))]` so the registry tests keep
running and the binary links; the real extern declaration is gated out of that
exact config to avoid an E0428 name clash. The stub can never collide with
perry-runtime's real definition (it exists only in perry-ffi's own test binary
with runtime-link off).
Verified: `cargo test -p perry-ffi` links + passes (13); `cargo test -p
perry-ffi --features runtime-link` uses the real symbol + passes (35).cargo test -p perry-ffi (undefined js_register_ffi_handle_exists_probe)1 parent e092362 commit defdf41
5 files changed
Lines changed: 136 additions & 80 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
1 | 31 | | |
2 | 32 | | |
3 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments