fix(compile): auto-optimize archives-fresh fast-path drops non-tokio routed ext staticlibs#5668
Merged
proggeramlug merged 1 commit intoJun 25, 2026
Conversation
…esh link path The auto-optimize 'archives fresh' fast-path returned only the tokio-using routed libs (resolve_auto_well_known_libs), dropping the non-tokio routed well-known ext staticlibs (e.g. the compression wrapper for node:zlib) collected by the routing loop. The link then failed with undefined js_ext_zlib_*/js_zlib_* even though the .a was on disk. Merge the routed libs into the fresh-path return; the full-rebuild path already included them.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe fresh-archive path now keeps previously collected CPU-only well-known libraries, adds auto-resolved Tokio-using libraries, and sets the stdlib preference flag from whether any well-known libraries remain. ChangesFresh-archive well-known library handling
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the auto-optimized archives are already fresh, the fast-path in
optimized_libs/driver.rsreturned:resolve_auto_well_known_libsonly resolves the tokio-using routed bindings. The non-tokio routed well-known ext staticlibs collected earlier in the same call (CPU-only wrappers like the compression crate thatnode:zlibflips to, events, …) were silently dropped fromwell_known_libs.Result: a program importing
node:zlib(or another non-tokio well-known) fails to link with undefinedjs_ext_zlib_*/js_zlib_*symbols — even though the routed.ais on disk and was logged as routed. Only the non-fresh (full-rebuild) path linked correctly, so this surfaced intermittently depending on archive freshness.Fix
Merge the outer
well_known_libs(the non-tokio routed libs gathered by the routing loop) into the fresh-path return instead of replacing it with the tokio-only set, and setprefer_well_known_before_stdlibaccordingly. The full-rebuild path already carried these libs.Summary by CodeRabbit