Skip to content

tools: one platform-independent wasi-sysroot on every host, OpenSSL's fixed prefix, and release-only tables - #25

Merged
pinhopro merged 3 commits into
mainfrom
tools/wasi-sysroot
Nov 17, 2026
Merged

pinhopro merged 3 commits into
mainfrom
tools/wasi-sysroot

Conversation

@pinhopro

@pinhopro pinhopro commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

One wasi-sysroot on every host

wasi-sdk's per-host archives each carry their own build of the sysroot and of the compiler-rt builtins. The libc++abi in that sysroot keeps __FILE__ strings with the paths of the machine that built it: /Users/runner/work/wasi-sdk/... in the macOS archive, /src/src/... in the Linux one. So the same WASI program differed by host, by 64 bytes in 48 of hash's KDF programs.

tools/ci/actions/wasi-sdk/install.sh now works the same way in CI and locally:

  • It keeps the runner's own clang and tools.
  • It replaces share/wasi-sysroot and lib/clang/23/lib/wasm32-* with the release's platform-independent wasi-sysroot-34.0.tar.gz and libclang_rt-34.0.tar.gz, each pinned by its SHA-256.
  • It fails, naming the target, on a target those archives lack builtins for.
  • Outside a runner, it installs this machine's build. The README now gives it as the local install.

OpenSSL's fixed prefix

With the sysroot shared, the OpenSSL programs still differed by 80 bytes. libcrypto keeps its --prefix as MODULESDIR and ENGINESDIR, and tools/openssl/build.py configured that prefix inside its random temporary directory, so the bytes changed by host and by run.

Every non-Windows build is now configured with --prefix=/webcpp-openssl and staged with make DESTDIR=... install_dev.

Proof: byte-identical WASI programs

hash's 292 WASI measure programs were built from scratch (-a) on two hosts: macOS arm64, and linux/amd64 in the CI image with this installer. The programs are the space and speed programs of every cell on wasip2 and wasip3, OpenSSL's included.

All 292 are byte-identical: the same SHA-256 and the same size on both hosts. For example:

  • space-hkdf_extract_hash2_hmac_sha2_256 on wasip2: ac1c434d...84f5f, 59,161 bytes.
  • space-hkdf_openssl_hmac_sha2_256 on wasip3: 3574195a...0bc0e15, 2,142,722 bytes.

Before this change:

  • space-hkdf_bearssl_hmac_sha2_256 on wasip2 was 69,317 bytes on macOS and 69,253 on Linux.
  • The OpenSSL programs differed by 80 bytes.

Release-only tables

Prepared environments

The installer's recipe changed, so the owner ran the preparation workflow on this branch (run 43981425615). Its verified ci-environments artifact is committed as tools/ci/environments.json (66e5aa3).

  • The wasi-sdk-linux-x64 bundle now holds three archives: wasi-sdk 34.0 for Linux x86_64, wasi-sysroot-34.0 and libclang_rt-34.0.
  • Its recipe is a00ab454..., which matches the installer.

Verification

  • tools/ci/actions_test.py: four new wasi-sdk cases. They were RED against the old installer, which kept the per-host sysroot.
  • tools/openssl/build_test.py: new prefix case, RED first. tools/test/openssl_test.py: the native and wasip2 source-dependency cases.
  • tools/variants/variants_test.py, tools/test/hash_collect_test.py and tools/test/emscripten_test.py (the size-table cases): all RED first.
  • tools/ci/environment_test.py, download_cache_test.py and tools/shipped_sources_test.py pass.
  • The wasip2 and wasip3 lanes of the test and example of all 13 WASI libraries pass on macOS with the shared sysroot:
    • wasip2: 616 tests passed, 0 failed.
    • wasip3: 658 tests passed, 0 failed.
    • After the rebase, an incremental re-run passes both lanes again (exit 0).
  • Full lint (tools/lint/lint.sh with wasi-sdk's clang-format and clang-tidy, against the shared sysroot), after rebasing onto main (hash: every key derivation defaults to backends::hash2; retire the measure lane and tools/hash/measure.py #26): lint: clean. clang-tidy is clean over 1,037 translation units, and Pyright is clean.

🤖 Generated with Claude Code

R added 3 commits November 16, 2026 21:27
…lease builds

webcpp.size-table requires <variant>release, which its manifests and their
programs inherit whatever the command asks for, and gives variants.py the
variant, which refuses any other. libs/hash moves to the commit whose
bench/collect.py refuses a program not built at variant=release, and data
whose build is not variant=release; tools/test/hash_collect_test.py checks it.
…SL built with one fixed prefix

wasi-sdk's per-host archives carry a sysroot and compiler-rt builtins of
their own build, whose libc++abi keeps __FILE__ strings with the paths of
the machine that built it, so a WASI program differed between macOS and
Linux. tools/ci/actions/wasi-sdk/install.sh keeps the runner's clang and
tools and replaces the sysroot and the builtins with the release's
platform-independent wasi-sysroot-34.0 and libclang_rt-34.0, each pinned by
its SHA-256, and fails on a target those lack builtins for. Outside a runner
it installs this machine's build, which the README now gives as the local
install.

OpenSSL kept its temporary build directory as libcrypto's modules and
engines directories, a residue of 80 bytes that differed by host and by
run. tools/openssl/build.py configures every non-Windows build with the
fixed prefix /webcpp-openssl and stages install_dev under DESTDIR.

The wasi-sdk recipe changes, so the Linux-X64 prepared bundle must be
prepared again before the WASI lanes of the CI can restore it.
…nt wasi-sysroot

The preparation run of tools/wasi-sysroot (run 43981425615) published the
images whose wasi-sdk bundle holds the three archives the installer reads:
wasi-sdk 34.0 for Linux x86_64, wasi-sysroot-34.0 and libclang_rt-34.0.
@pinhopro
pinhopro merged commit 3fa7ca5 into main Nov 17, 2026
12 checks passed
@pinhopro
pinhopro deleted the tools/wasi-sysroot branch November 17, 2026 04:05
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.

1 participant