Skip to content

Conversation

@TartanLlama
Copy link
Contributor

@TartanLlama TartanLlama commented Jan 15, 2026

The bindings generator currently uses the now-archived WebAssembly/wasi-cli repo to download the wit files for wasip2 and wasip3. This repo is no longer being updated, and there is now a wasip3 release candidate that does not have wit files released in that repo.

This PR:

  • updates the bindings generation to pull down wit files with wkg.
  • bumps the targeted wasip3 version from rc-2025-09-16 to rc-2026-01-06
  • updates the wasip3 clocks implementation to use the names that were changed in the latest RC release

@TartanLlama TartanLlama marked this pull request as ready for review January 15, 2026 10:52
@alexcrichton
Copy link
Collaborator

Thanks! Will double-check once CI is passing but otherwise r=me

typedef monotonic_clock_mark_t monotonic_clock_instant_t;
#else
# error "Unknown WASI version"
#endif

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wasi_clocks_system_clock_instant_t.seconds is now int64_t (signed) rather than uint64_t

We'll need to treat p2 and p3 differently L44-47 right? timespec->tv_sec is time_t which is typically long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like time_t is long long in wasi-libc, so I think there's actually some missing checks for overflow on wasip2

@TartanLlama
Copy link
Contributor Author

The tests pass with trunk wasmtime, so I think we review this, then it can sit until the wasmtime release that uses rc-2026-01-06.

uses: bytecodealliance/actions/wasmtime/setup@v1
with:
version: "38.0.3"
version: "40.0.2"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this using dev I think could get things working today

return !__builtin_mul_overflow(timespec->tv_sec, NSEC_PER_SEC, timestamp) &&
!__builtin_add_overflow(*timestamp, timespec->tv_nsec, timestamp);
#elif defined(__wasip2__) || defined(__wasip3__)
#elif defined(__wasip2__) | defined(__wasip3__)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh does a lone | work in C? TIL...

@cpetig
Copy link
Contributor

cpetig commented Jan 23, 2026

I feel that the effort on getting a most up to date toolchain set up increases with this merge waiting for wasmtime-0.42 (four weeks from now, IIRC).

This patch requires a straightforward modification on the already merged p3 clock implementation, but it also requires some build process adaptions (adding wasi:clocks/timezone) which I wasn't able to non-band-aid around. Besides patching llvm, wasm-component-ld.

So, if there is any reasonable way to keep fewer p3 development branches active/waiting, this would help me a lot to combine everything in one place. But you know best on how to weigh this against any upcoming release of wasi-sdk which should still target the old p3 version, because the just released wasmtime still implements the old one.

@ricochet
Copy link

wasmtime 41 is out and I see @alexcrichton is the best and already backported the latest wasip3 rc: bytecodealliance/wasmtime@309028e

@alexcrichton alexcrichton merged commit d1b9bdb into WebAssembly:main Jan 24, 2026
28 checks passed
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.

4 participants