Skip to content

wasm32: link embedded lld driver and fix std.regex/std.zlib target widths (#2131, #2305) - #2447

Merged
ehartford merged 1 commit into
mainfrom
wasm32-bundles-2131
Oct 18, 2026
Merged

ehartford merged 1 commit into
mainfrom
wasm32-bundles-2131

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Summary

  • Filter embedded_bundle_prefixes() by embedded_bundle_present(bi) and embedded_bundle_for_this_target(bi) in src/compiler/EmbeddedBundles.w so codegen only treats .wo bundles for the active target as externally provided.
  • Route --target wasm32 linking in src/compiler/Link.w (link_stage_wasm_native_link_plan) to the compiler's own embedded lld WebAssembly driver (with __ld -flavor wasm) when no external wasm-ld is present, allowing --target wasm32 builds to link out-of-repo with zero external linker.
  • Map size_t -> c_ulong and ssize_t -> c_long in ci_map_sizeof_type (src/CImport.w), matching ClangBridge.w declaration translation, and re-promote lib/std/re/ via :pcre2-promote so sizeof[c_ulong]() matches PCRE2_SIZE on both 64-bit hosts and 32-bit wasm32.
  • Cast data.len() and ZLIB_MAX_CHUNK to i64 in lib/std/zlib.w compress_gzip_level so 32-bit signed isize on wasm32 does not compare data.len() against -1 (0xffffffff as i32).
  • Add test/wasm/wasm_regex_zlib.w covering std.regex (Regex.compile, is_match, find, replace_all) and std.zlib (compress_gzip, decompress_gzip, crc32, adler32) in :wasm-tests.
  • Pass --link-bundle out/wo/windows_aarch64/{pcre2,zlib,c_algorithms,tommyds} to the windows-aarch64 cross-compiler build step in .github/workflows/seed-windows-aarch64.yml (D118: linux-aarch64 and windows-aarch64 seeds that accept List #2305).
  • Give https_get_response, https_download, and conan_https_to_file bounded default connect (20s) and socket-idle (30s) timeouts so stalled downloads fail and retry instead of hanging forever.

Battery Evidence

  • Commit: f19fe59f9
  • battery rc=0 wall=830s (GREEN)

Closes #2131

@ehartford
ehartford merged commit 3d73b98 into main Oct 18, 2026
@ehartford
ehartford deleted the wasm32-bundles-2131 branch October 18, 2026 06:40
ehartford added a commit that referenced this pull request Oct 18, 2026
…1159); aarch64 seeds cut from 3d73b98 (#2305); pub_lint one pass (#2211) (#2451)

* D118: linux-aarch64 and windows-aarch64 seeds cut from main 3d73b98; the Windows cross link carries with_clang_main (#2305)

linux-aarch64 was bootstrapped natively in tools/docker/linux-aarch64 to a
stage2 == stage3 fixpoint over all 16 units and passed :no-host-toolchain
(the published binary is that run's release compiler, byte for byte).
windows-aarch64 was cross-built from the same tree on the Mac; the native
lane bootstraps and verifies it. Both are assets of the pinned seed release
nightly-20261015-local-1-efcb91c30a6a, and the lock's digests are theirs.

The seed workflow's Windows cross link failed on main with
'lld-link: error: undefined symbol: with_clang_main' since #2447 linked the
embedded clang driver: the two Windows cross-link actions now add the clang
main link lines the native link already has.

* D44: slot, range and entry extraction runs copy glue and refuses a non-Copy element; the ownership audit checks the boundary (#1159)

ListSlot.get, ListRange.get, SlotMapSlot.get, HashMapEntry.get and
HashMapEntry.or_insert read an element out of a container that keeps it,
so the element must be Copy (§2.3: transport is not duplication): Sema
refuses a non-Copy element with a named error, and codegen runs the
element's copy glue (a str retains) instead of byte-copying it. or_insert
and HashMapEntry.set retain the key they store, or_insert drops the default
it did not insert, and set releases the overwritten element through the
owned-insert path. analyze audit:all fails on an extraction intrinsic
whose element type is not Copy, the validator #1159 asked for.

D44's entry and the AGENTS.md paragraph record the compiler compliant:
#1158 and #1187 are closed, and the five non-compliance items are done.

* D22: the compiler is compliant; the 66 acceptance fixtures leave test/non_compliant for the active lanes

The d22 matrix (test/non_compliant/d22, excluded from the green runner
since 2026-07-23) is promoted: 11 behavior tests, 36 compile-error tests
and 19 debug-allocator tests, each under its lane's name. What the
promotion needed: an indexed element `xs[i]` is typed `&Elem` (D27), so
its storage-origin mask reads a stored view handle only when the element
is itself a view; the non-Copy join diagnostic names the remedy (clone the
borrowed side, borrow the owned side, or implement Clone); comptime
returns a list or map value under the declared collection type, knows
`capacity` and the remaining builtin collection methods, and gives an
untyped integer or tuple a semantic type. The D27 matrix README (already
fully promoted) goes with it.

CLAUDE.md, the D22 entry, the plan and the AI guide (and its generated
template) no longer call the compiler NON-COMPLIANT for D22.

* D100: pub_lint reads every fact in one analyze pass (#2211)

Three select: queries over the root (declarations, types, references) were
three full compilations; one `facts` run feeds the same three extractions.

---------

Co-authored-by: Eric Hartford <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

std.regex and std.zlib on wasm32: build the bundles for the target, link the target's bundle, carry them in the release

1 participant