Revert "treat require(<builtin>) as a stdlib requirement" (#8548) — runtime-only link regression - #8551
Conversation
This reverts #8548. It fixed #8547 (issue_4903 0/2 -> 2/2) but broke issue_5247_property_read_source_location with a runtime-only link failure: undefined references to perry_wasm_host_* out of libperry_runtime.a. Attribution: 5247 passed on 1c23265 and fails on b00e261 in both sweep runs of that SHA. It does not reproduce locally, which points at feature unification -- pulling perry-stdlib onto more compile paths changes what target/debug/libperry_runtime.a contains, and the archive then carries webassembly.rs code whose externs only perry-wasm-host satisfies, which a runtime-only link line omits. Restores the known red (4903) rather than a new link-level one; a link regression can bite real builds, not just tests. Reopens #8547.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe compiler no longer links Node stdlib modules detected from CommonJS ChangesCommonJS stdlib linking revert
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Correction — I attributed this to Cargo feature unification, and that was wrong. I said the wasm link failure came from The actual mechanism is shared-archive contamination between tests in the same job:
So under That reframes the situation in two ways worth being explicit about:
I am not making that change myself: it touches test infrastructure I did not write, and I have already demonstrated on this issue that acting with an incomplete model of this link path produces regressions. Flagging it for an owner with the evidence above. |
Revert "treat
require(<builtin>)as a stdlib requirement" (#8548) — it caused a runtime-only link failure.#8548 fixed a real bug (#8547:
require('http')linked runtime-only, so every stdlib-backed builtin reached that way returnedundefined, andissue_4903_listen_callback_deferredwent 0/2 → 2/2). It also brokeissue_5247_property_read_source_location, which had been passing:Attribution is solid, which is why this is a revert and not a follow-up patch. The suite passed on
1c2326554(the commit immediately before) and fails onb00e261f8(with #8548) in both sweep runs of that SHA — deterministic, not a flake. It does not reproduce locally, which is the tell for a feature-unification effect rather than a logic error: undercargo test --workspacecargo unifies features across the whole graph, so pulling perry-stdlib onto more compile paths changes whattarget/debug/libperry_runtime.acontains. The archive then carrieswebassembly.rs's code, whoseexterndeclarations are satisfied only by the separateperry-wasm-hostcrate — which a runtime-only link line does not include.So the honest position is that #8548's diagnosis stands and its link-mode consequence was not thought through: making a program need the stdlib is not free, and the runtime-only link path is not prepared for everything the stdlib's feature set drags into the runtime archive. Fixing #8547 properly needs that interaction handled — either by ensuring
perry-wasm-hostis on the link line whenever the runtime archive contains wasm code, or by keeping the wasm surface out of it.Net effect of this revert:
issue_4903returns to failing (2 tests, the pre-existing #8547 symptom) andissue_5247returns to passing (3 tests). Main is red either way; this restores the known red rather than a new link-level one, which is the safer state to leave a release branch in — a link regression can bite real builds, not just tests.Reopens #8547.
Summary by CodeRabbit
Bug Fixes
Documentation
Chores