OpenCode link fails on main: undefined __perry_wrap_perry_fn_…effect_src_Array_ts__Array_ (and PERRY_NO_AUTO_OPTIMIZE=1 hits a tokio archive mismatch) #10945
Description
Activity
Reproduced on Linux x86_64, on
main681d7024plus #11817 and #11819. Those two fix earlier Linux-only failures that stopped the OpenCode build before it could reach this link step. Codegen now completes for every module, and the link fails on this symbol alone.The auto-optimize hypothesis above is refuted. In this build the auto-optimize pass never ran: perry could not locate its workspace (
find_perry_workspace_rootfound nothing, because myCARGO_TARGET_DIRis outside the source tree), so it linked the stock prebuilt runtime with no internalize/dead-strip pass at all. The link fails the same way. Whatever drops this symbol, it is not that pass.On Linux the unresolved symbol is the wrapper's closure-info record:
undefined reference to `__perry_wrap_perry_fn_opencode_node_modules__bun_effect_4_0_0_beta_83_node_modules_effect_src_Array_ts__Array_$info'The referencing closures are the same four as in the report above:
Chunk.ts__25,Cron.ts__14,internal/effect.ts__72and__541.Nothing in the build defines it. I ran
llvm-nmover all 14,577 objects in the compile's object cache:- 6 objects reference
…effect_src_Array_ts__Array_$infoas undefined (U). - 0 objects define it.
- 0 objects define or reference the wrapper function
__perry_wrap_perry_fn_…effect_src_Array_ts__Array_itself. The importers take the address of the wrapper's info record without ever naming the wrapper.
So this is not a symbol that was emitted and then dropped. It was never generated. The importing modules assume
effect/src/Array.tswill emit a wrapper and its$infofor itsArrayexport, and the owning module never does. That points at whatever decides, per owning module, which functions get a__perry_wrap_wrapper: the need is evidently discovered only in the importers. On macOS the same gap surfaces as the wrapper function being missing rather than its info record.- 6 objects reference
- added a commit that references this issue
on Oct 3, 2026
Compiling OpenCode v1.18.30 (#10107) on current
mainfails at the link step with an undefined wrapper symbol. Codegen completes; only the link fails.Four closures across three effect modules reference the wrapper for
effect/src/Array.ts'sArrayexport, and it is not in any object handed to the linker.Where it looks like it comes from
The log shows the auto-optimize pass rebuilding runtime+stdlib immediately before the failure:
That pass internalizes and dead-strips, and the tree already carries
#[used(compiler)]keepalive anchors specifically because it has dropped still-referenced symbols before (#4876 — "the auto-optimize internalize+dead-strip pass can't drop it"). A wrapper reached only from other modules' closures looks like the same class of victim.PERRY_NO_AUTO_OPTIMIZE=1is not a workaroundTurning the pass off replaces this with a different hard failure:
so there is currently no way to link this program on
main: with auto-optimize the wrapper symbol is missing, without it the archives disagree about tokio.Repro
from
packages/opencodeof OpenCode v1.18.30 (perry.jsondefines per the tracking issue), macOS arm64, perry v0.5.1633 (0fa3915293, merge train 253). ~2h to reach the link step; the object cache is warm afterwards so a retry reaches it in minutes.The same program links and runs on v0.5.1592, so this is a regression somewhere in 1592…1633.