test_gap_zlib_4917_level fails to link on the auto-optimize path — which is the path
./scripts/run_gap_tests.sh uses by default — with:
Undefined symbols for architecture arm64:
"_js_zlib_deflate_raw_sync", referenced from: _main
"_js_zlib_inflate_raw_sync", referenced from: _main
Why
js_zlib_deflate_raw_sync and js_zlib_inflate_raw_sync are defined in exactly one place:
crates/perry-stdlib/src/zlib.rs:288 pub unsafe extern "C" fn js_zlib_deflate_raw_sync(...)
crates/perry-stdlib/src/zlib.rs:303 pub unsafe extern "C" fn js_zlib_inflate_raw_sync(...)
perry-ext-zlib does not define them. When the well-known flip routes node:zlib to
perry-ext-zlib, optimized_libs/driver.rs strips compression-gzip from the stdlib
rebuild, on the stated grounds that
The ext crate carries all codecs, so nothing is lost by dropping them here.
That is true for the codecs and false for the raw one-shot entry points, so the two
symbols disappear from the link entirely.
Verified both ways, same tree, same archives (55fd197d5 + PR #7999)
| path |
result |
PERRY_NO_AUTO_OPTIMIZE=1 (full prebuilt stdlib supplies them) |
links, exit 0 |
auto-optimize (stdlib rebuilt without compression-gzip) |
link fails, 2 undefined symbols |
The test is zlib.deflateRawSync(data, { level }) — test-files/test_gap_zlib_4917_level.ts
lines 11-13.
Why it has been invisible
It is not in test-parity/gap_snapshot.json, and the required gap shards run on
ubuntu-latest. It surfaced while validating #7629, whose fix routes ext-importing gap
tests through auto-optimize per test — the first configuration in which this test's
auto-optimize link was exercised by the harness. #7999 deliberately does not route
around it (dropping zlib from the ext-routed module set would hide a real API gap to make
a number green).
Fix direction
Implement deflateRawSync / inflateRawSync in perry-ext-zlib so the flip's premise
holds, and add an assertion that the ext crate's exported js_zlib_* surface is a superset
of the stdlib feature the flip strips — the premise is stated in a comment today and nothing
checks it, which is how a missing pair of entry points became a link error two stages
downstream.
test_gap_zlib_4917_levelfails to link on the auto-optimize path — which is the path./scripts/run_gap_tests.shuses by default — with:Why
js_zlib_deflate_raw_syncandjs_zlib_inflate_raw_syncare defined in exactly one place:perry-ext-zlibdoes not define them. When the well-known flip routesnode:zlibtoperry-ext-zlib,
optimized_libs/driver.rsstripscompression-gzipfrom the stdlibrebuild, on the stated grounds that
That is true for the codecs and false for the raw one-shot entry points, so the two
symbols disappear from the link entirely.
Verified both ways, same tree, same archives (
55fd197d5+ PR #7999)PERRY_NO_AUTO_OPTIMIZE=1(full prebuilt stdlib supplies them)compression-gzip)The test is
zlib.deflateRawSync(data, { level })—test-files/test_gap_zlib_4917_level.tslines 11-13.
Why it has been invisible
It is not in
test-parity/gap_snapshot.json, and the required gap shards run onubuntu-latest. It surfaced while validating #7629, whose fix routes ext-importing gaptests through auto-optimize per test — the first configuration in which this test's
auto-optimize link was exercised by the harness. #7999 deliberately does not route
around it (dropping
zlibfrom the ext-routed module set would hide a real API gap to makea number green).
Fix direction
Implement
deflateRawSync/inflateRawSyncinperry-ext-zlibso the flip's premiseholds, and add an assertion that the ext crate's exported
js_zlib_*surface is a supersetof the stdlib feature the flip strips — the premise is stated in a comment today and nothing
checks it, which is how a missing pair of entry points became a link error two stages
downstream.