Repository navigation
auto-opt: ext-zlib provider link failure on cold object cache (undefined js_zlib_deflate_raw_sync + panic_unwind symbols) #6847
Description
Activity
- added a commit that references this issue
on Jul 26, 2026 - added a commit that references this issue
on Jul 26, 2026 Verified against current with a fresh object cache and a genuinely cold profile rebuild: rebuilt runtime/stdlib, linked, wrote the executable, and ran successfully. PR #7021 fixed the zlib surface plus the panic-runtime dedup holes that caused this report. Closing as resolved.
- added 7 commits that reference this issue
on Aug 7, 2026 Reopening for macOS: #7599's audit of known_failures.json caught this reproducing —
test_gap_zlib_4917_levelfails 3/3 on macOS with the exact original signature (Undefined symbols: _js_zlib_deflate_raw_sync, _js_zlib_inflate_raw_sync) while its zlib siblings pass and Linux passes it. The entry is now platform-scopedmacosin known_failures.json rather than unscoped, so it no longer suppresses the passing Linux run. The fix that closed this issue evidently did not cover the macOS link path.Re-tested the cold-cache reproduction on
main@db44b31b7. The link failure no longer happens, and the remaining half — the auto-optimize rebuild itself failing — is fixed by the open PR #7772.The reported failure does not reproduce
Full cold start, exactly as this issue specifies (
rm -rf target/perry-auto-*— 872 MB + 417 MB of state removed — plus/private/tmp/node_modules/.cache/perryand the local object cache):perry test-files/test_gap_zlib_4917_level.ts -o /tmp/zl2 → exit 0, binary written, and it RUNS: deflateRawSync level1 >= level9: true deflateRawSync levels differ: true deflateRawSync roundtrip l1: trueNo undefined
_js_zlib_deflate_raw_sync, nopanic_unwindsymbols. What saves it is a fallback that now exists on the auto-optimize path:auto-optimize: cargo build failed (exit status: 101), using prebuilt libraries. The prebuilt archives may lack the feature-gated js_* entrypoints this compile routed to ext crates; if the link fails with undefined symbols, fix the cargo error above …So the pipeline no longer hands the linker a half-built pair — it declines and uses the prebuilt archives, which link.
The underlying cause, still live on
mainThat fallback is firing because
perry-stdlibdoes not compile under the feature set auto-optimize selects (panic=abort, features=async-runtime,external-zlib-pump):error[E0433]: cannot find `events` in `crate` --> crates/perry-stdlib/src/common/dispatch/init.rs:668:57 perry_runtime::js_set_native_events_dispatch(crate::events::js_events_native_dispatch); note: found an item that was configured out — gated behind the `bundled-events` featureReproduced directly:
cargo check -p perry-stdlib --no-default-features --features async-runtime,external-zlib-pumpfails onmainwith that one error, and is clean on #7772's branch, which adds the missing#[cfg(feature = "bundled-events")]to exactly that line. That PR is open for #7764 and closes this half too.So this issue is resolved by two independent changes
- the prebuilt-archive fallback (already on
main) means a broken rebuild can no longer produce an undefined-symbol link; - fix(stdlib): build with --no-default-features again, unbreaking the auto-optimize relink (#7764) #7772 makes the rebuild succeed rather than fall back, so the auto-optimized artifact is actually produced.
Leaving open until #7772 merges, since without it every auto-optimize build on this configuration silently ships the un-optimized prebuilt archives — correct, but not what the pipeline is for, and the only signal is one warning line.
The secondary point in the issue body still stands and is untouched: the object cache under
/private/tmpmakes every reboot a cold start and couples cache identity to a world-writable path. Worth its own issue if it is to be fixed.- the prebuilt-archive fallback (already on
Validated on current origin/main at 8260a9e from a fresh worktree.
The condition called out in the last investigation is now satisfied: #7772 merged as 021c721 and that commit is an ancestor of origin/main. The exact auto-opt stdlib configuration that previously failed now succeeds:
cargo check -p perry-stdlib --no-default-features --features async-runtime,external-zlib-pump Finished dev profile (exit 0)The prior cold-cache macOS retest already established that the reported undefined js_zlib_deflate_raw_sync / js_zlib_inflate_raw_sync and panic_unwind link failure no longer reproduces; #7772 fixes the remaining stripped-feature rebuild failure instead of relying on the prebuilt-library fallback. Its auto-opt-app-patterns check also passed.
I attempted an additional cold-cache compile on this Windows host, but this particular fixture is stopped before linking by the separately tracked #7354 WinEH/RS4GC try/catch guard, so it provides no contrary signal about the macOS linker path.
Closing as completed. The separate /private/tmp cache-location concern remains out of scope for this linker defect and can be tracked independently.
Cold-cache reproduction (any tree, main @ 21a3d00):
Link fails with:
The auto-optimize pipeline pairs the ext-zlib provider archive with an auto-opt stdlib rebuild that lacks the zlib native symbols, and the provider archive carries panic_unwind runtime objects the panic=abort link cannot satisfy.
PERRY_NO_AUTO_OPTIMIZE=1compiles and links the same test fine.Why this went unnoticed: the compile-object cache under
/private/tmp/node_modules/.cache/perryheld pre-breakage objects with the old routing baked in; any machine with a warm cache (dev boxes, CI with restored caches) sails past the broken codegen path. A reboot (cleared /tmp) exposed it — six gap tests now compile_fail cold: test_gap_zlib_4917_level, test_gap_zlib_3285_params, test_gap_zlib_fs_assert_2935_2752_2971, test_gap_3662_node_argvalidation, test_gap_constants_tail_3683plus, test_gap_handle_band_object_ops.Related fragility worth fixing while in here: the compile-object cache living under /private/tmp makes every reboot a cold start and couples cache identity to a world-writable path.