Closed Bug 2043477 Opened 5 months ago Closed 2 months ago

Update wasi-sdk to v34

Categories

(Firefox Build System :: Toolchains, task)

task

Tracking

(firefox157 fixed)

RESOLVED FIXED
157 Branch
Tracking Status
firefox157 --- fixed

People

(Reporter: RyanVM, Assigned: RyanVM)

References

Details

Attachments

(1 external file)

wasi-sdk-33 builds its sysroot through its own cmake build system rather than the Makefile we
previously drove with stub files, so the build scripts are rewritten accordingly and the separate
compiler-rt and sysroot scripts are merged into a single build-wasi-sdk.sh selected by a mode
argument. The local patches to wasi-sdk are split into focused files (compat, compiler-rt,
no-llvm-patches), each documenting its rationale in a header comment.

The build pins WASI_SDK_BUILD_SHARED and WASI_SDK_EXCEPTIONS to OFF: Firefox's wasm sysroot doesn't
ship or link against shared libraries, and the wasm code doesn't use C++ exceptions.

The target triple is also moved from the deprecated wasm32-wasi to wasm32-wasip1, with compatibility
symlinks left in the sysroot so consumers still using the old triple keep building.

Following up on your comment in bug 2039812 about separating out the wasip1-related changes: I tried to find a clean split and couldn't land on one that isn't more convoluted than the combined patch, so I'd like to pin down what you'd prefer before reworking.

The constraint is that the wasm32-wasip1 sysroot layout is produced by the wasi-sdk-33 build itself. wasi-sdk-20 only ships the wasm32-wasi layout, so the clang-trunk wasip1 link check (bug 2039812) can't pass without the v33 bump. The existing clang>=22.1 elif in toolchain.configure already makes clang-trunk target wasm32-wasip1; the piece that was missing was a sysroot that actually has that layout.

Given that, the approach here is:

  • Update to wasi-sdk-33, which builds through its own cmake system rather than the Makefile we previously drove with stub files, producing a native wasm32-wasip1 sysroot.
  • Move wasm() to wasm32-wasip1 and drop the now-redundant clang>=22.1 elif, since every supported clang then targets the same triple.
  • Keep wasm32-wasi -> wasm32-wasip1 symlinks in the sysroot so anything still referencing the old triple keeps building.

The configure-side bits (the wasm() move and the elif removal) are the most readily separable, but on their own they don't fix 2039812, and pulling them out would leave an awkward intermediate state without the v33 sysroot underneath them.

You mentioned you'd likely address the wasip1 changes differently than the WIP did. I'm happy to restructure or split it however you'd like, but could you point at what specifically you'd change (the unconditional wasm() move? the symlinks? something else?) so I can take it in that direction rather than guess?

Flags: needinfo?(mh+mozilla)

Updated on top of the recent clang update and minimum version bump.
https://treeherder.mozilla.org/jobs?repo=try&revision=f1de96d9c97ee880b5099c10d65a5ccb78161b5b

Updated Try push after addressing the first round of review comments.
https://treeherder.mozilla.org/jobs?repo=try&revision=43db5cc0838e73cd8843307a4599de93dd39dd88

Flags: needinfo?(mh+mozilla)
Summary: Update wasi-sdk to v33 → Update wasi-sdk to v34
Attachment #9591452 - Attachment description: Bug 2043477 - Update wasi-sdk toolchain to v33. r=glandium → Bug 2043477 - Update wasi-sdk toolchain to v34. r=glandium
Attachment #9591452 - Attachment description: Bug 2043477 - Update wasi-sdk toolchain to v34. r=glandium → Bug 2043477 - Update wasi-sdk toolchain to v34. r=#firefox-build-system-reviewers
Blocks: 2053973
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
See Also: → 2068911
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: