diff --git a/.github/actions/docker-build-cached/action.yml b/.github/actions/docker-build-cached/action.yml index 47585d0a4f52..d4ae9c505475 100644 --- a/.github/actions/docker-build-cached/action.yml +++ b/.github/actions/docker-build-cached/action.yml @@ -19,15 +19,6 @@ runs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - # Disable things that docker has on-by-default from the above which we're - # not interested in. - - name: Disable some docker things that are on-by-default - shell: bash - run: | - echo DOCKER_BUILD_CHECKS_ANNOTATIONS=false >> $GITHUB_ENV - echo DOCKER_BUILD_SUMMARY=false >> $GITHUB_ENV - echo DOCKER_BUILD_RECORD_UPLOAD=false >> $GITHUB_ENV - # We'll be using this cache key and the "local" caching mode of docker. This # allows pretty fine-grained views into what's being cache. Experimentation # found that the default `gha` caching mode sprays quite a lot into the @@ -41,15 +32,24 @@ runs: path: ${{ runner.tool_cache }}/docker-buildx-cache key: ${{ inputs.cache_key_prefix }}-${{ hashFiles(inputs.file) }} + # Note that this is a hand-rolled `docker buildx build` instead of + # `docker/build-push-action` to enable retrying the build. Fetching base + # images from Docker Hub is flaky enough that an unretried build fails + # CI from time to time, and the action itself has no retry option. - name: Build docker image - uses: docker/build-push-action@v7 - with: - context: ${{ inputs.context }} - file: ${{ inputs.file }} - tags: build-image - cache-from: type=local,src=${{ runner.tool_cache }}/docker-buildx-cache - cache-to: type=local,dest=${{ runner.tool_cache }}/docker-buildx-cache - outputs: type=docker + shell: bash + run: | + for attempt in 1 2 3 4 5; do + [ "$attempt" = "5" ] && exit 1 + docker buildx build \ + --file ${{ inputs.file }} \ + --tag build-image \ + --cache-from type=local,src=${{ runner.tool_cache }}/docker-buildx-cache \ + --cache-to type=local,dest=${{ runner.tool_cache }}/docker-buildx-cache \ + --load \ + ${{ inputs.context }} && break + sleep 5 + done # Only save caches on the `main` branch since these docker images are # relatively large. This means that caches aren't filled through the merge diff --git a/.github/actions/install-rust/action.yml b/.github/actions/install-rust/action.yml index e01fd981475f..7be1e2351c9b 100644 --- a/.github/actions/install-rust/action.yml +++ b/.github/actions/install-rust/action.yml @@ -80,3 +80,12 @@ runs: - name: Install the WASI target shell: bash run: rustup target add wasm32-wasip2 wasm32-wasip1 wasm32-unknown-unknown + + - name: Fetch all Cargo dependencies + shell: bash + run: | + for attempt in 1 2 3 4 5; do + [ "$attempt" = "5" ] && exit 1 + cargo fetch --locked && break + sleep 5 + done diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aff0052eddc8..1444c433c075 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -710,8 +710,6 @@ jobs: - uses: ./.github/actions/apt-get-install with: packages: ocaml-nox ocamlbuild ocaml-findlib libzarith-ocaml-dev - - run: cargo fetch - working-directory: ./fuzz - run: cargo fuzz check --dev - run: cargo fuzz check --dev --fuzz-dir ./cranelift/isle/fuzz - run: cargo fuzz check --dev --fuzz-dir ./crates/environ/fuzz --features component-model @@ -843,8 +841,6 @@ jobs: run: echo "C:\msys64\mingw64\bin" >> $Env:GITHUB_PATH if: matrix.target == 'x86_64-pc-windows-gnu' - - run: cargo fetch --locked - - uses: ./.github/actions/apt-get-install name: Install cross-compilation tools if: matrix.gcc_package != '' diff --git a/Cargo.toml b/Cargo.toml index 50b4f3575a48..4fe1b610e053 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -388,7 +388,7 @@ arbitrary = "1.4.2" backtrace = "0.3.76" bumpalo = "3.20.2" mutatis = {version = "0.4.0", features = ["alloc", "derive", "check"] } -cc = "1.2.41" +cc = "1.2.0" # intentionally smaller-than-latest to accommodate rust-lang/rust object = { version = "0.39.0", default-features = false, features = ['read_core', 'elf'] } gimli = { version = "0.33.0", default-features = false, features = ['read'] } addr2line = { version = "0.26.0", default-features = false } diff --git a/RELEASES.md b/RELEASES.md index 761d492a508e..67d85edd85a2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -49,6 +49,11 @@ Unreleased. which can be used to determine which root task performed an import call. [#13510](https://github.com/bytecodealliance/wasmtime/pull/13510) +* Wasmtime now supports WASI 0.3.0 by default and the `component-model-async` + wasm feature is now enabled by default. + [#13612](https://github.com/bytecodealliance/wasmtime/pull/13612) + + ### Changed * Performance of bulk-data-transfer instructions such as @@ -213,6 +218,10 @@ Unreleased. `concurrency_support` have been fixed. [#13542](https://github.com/bytecodealliance/wasmtime/pull/13542) +* A panic in `substituted_component_type` has been fixed when guests have + exported resources. + [#13608](https://github.com/bytecodealliance/wasmtime/pull/13608) + -------------------------------------------------------------------------------- Release notes for previous releases of Wasmtime can be found on the respective diff --git a/ci/vendor-wit.sh b/ci/vendor-wit.sh index 44b7df5e2c70..c912cfbe9f11 100755 --- a/ci/vendor-wit.sh +++ b/ci/vendor-wit.sh @@ -36,7 +36,7 @@ get_github() { } p2=0.2.12 -p3=0.3.0-rc-2026-03-15 +p3=0.3.0 rm -rf crates/wasi-io/wit/deps mkdir -p crates/wasi-io/wit/deps diff --git a/cranelift/codegen/src/isa/pulley_shared/abi.rs b/cranelift/codegen/src/isa/pulley_shared/abi.rs index ceebc15ab88a..e077ef04a3f8 100644 --- a/cranelift/codegen/src/isa/pulley_shared/abi.rs +++ b/cranelift/codegen/src/isa/pulley_shared/abi.rs @@ -713,29 +713,47 @@ impl FrameLayout { &'a self, style: &'a FrameStyle, ) -> impl Iterator + 'a { - let mut offset = self.stack_size(); + // `push_frame_save` always saves the pulley-managed registers at the + // *top* of the allocated frame (the highest addresses, `amt - 8` + // downward). Therefore the manually-managed clobbers must be placed + // *below* that pulley-saved region. The pulley-saved registers are not + // necessarily first in `clobbered_callee_saves` (it is sorted by + // register, and the manually-managed integer registers x0..x15 sort + // before the pulley-managed x16..x31), so we cannot simply walk the + // list from the top assigning slots in order -- doing so would place a + // manually-managed register on top of a pulley-saved one and the two + // stores would collide. + // + // Instead reserve the top `num_saved_by_pulley` 8-byte slots for the + // pulley-managed registers (matching `push_frame_save`) and hand out + // the remaining, lower slots to the manually-managed registers. + let num_saved_by_pulley = match style { + FrameStyle::PulleySetupAndSaveClobbers { + saved_by_pulley, .. + } => u32::from(saved_by_pulley.len()), + _ => 0, + }; + let mut offset = self.stack_size() - num_saved_by_pulley * 8; self.clobbered_callee_saves.iter().filter_map(move |reg| { - // Allocate space for this clobber no matter what. If pulley is - // managing this then we're just accounting for the pulley-saved - // registers as well. Note that all pulley-managed registers come - // first in the list here. - offset -= 8; let r_reg = reg.to_reg(); - let ty = match r_reg.class() { - RegClass::Int => { - // If this register is saved by pulley, skip this clobber. - if let FrameStyle::PulleySetupAndSaveClobbers { - saved_by_pulley, .. - } = style - { - if let Some(reg) = r_reg.hw_enc().checked_sub(16) { - if saved_by_pulley.contains(reg) { - return None; - } + // If this register is saved by pulley, skip it: its slot is one of + // the reserved top slots accounted for above. + if let FrameStyle::PulleySetupAndSaveClobbers { + saved_by_pulley, .. + } = style + { + if r_reg.class() == RegClass::Int { + if let Some(reg) = r_reg.hw_enc().checked_sub(16) { + if saved_by_pulley.contains(reg) { + return None; } } - I64 } + } + // Allocate space for this manually-managed clobber. + offset -= 8; + let ty = match r_reg.class() { + RegClass::Int => I64, RegClass::Float => F64, RegClass::Vector => I8X16, }; diff --git a/cranelift/filetests/filetests/isa/pulley32/preserve-all.clif b/cranelift/filetests/filetests/isa/pulley32/preserve-all.clif index c7d523d4f6a6..67b8297bdd2f 100644 --- a/cranelift/filetests/filetests/isa/pulley32/preserve-all.clif +++ b/cranelift/filetests/filetests/isa/pulley32/preserve-all.clif @@ -419,3 +419,350 @@ block0(v0: i64): ; pop_frame ; ret +function %clobber_save_no_slot_collision(i64, i64) preserve_all { + fn0 = %host(i64) system_v +block0(v0: i64, v1: i64): + call fn0(v0) + call fn0(v1) + return +} + +; VCode: +; push_frame_save 912, {x16} +; xstore64 sp+896, x0 // flags = notrap aligned +; xstore64 sp+888, x1 // flags = notrap aligned +; xstore64 sp+880, x2 // flags = notrap aligned +; xstore64 sp+872, x3 // flags = notrap aligned +; xstore64 sp+864, x4 // flags = notrap aligned +; xstore64 sp+856, x5 // flags = notrap aligned +; xstore64 sp+848, x6 // flags = notrap aligned +; xstore64 sp+840, x7 // flags = notrap aligned +; xstore64 sp+832, x8 // flags = notrap aligned +; xstore64 sp+824, x9 // flags = notrap aligned +; xstore64 sp+816, x10 // flags = notrap aligned +; xstore64 sp+808, x11 // flags = notrap aligned +; xstore64 sp+800, x12 // flags = notrap aligned +; xstore64 sp+792, x13 // flags = notrap aligned +; xstore64 sp+784, x14 // flags = notrap aligned +; xstore64 sp+776, x15 // flags = notrap aligned +; fstore64 sp+768, f0 // flags = notrap aligned +; fstore64 sp+760, f1 // flags = notrap aligned +; fstore64 sp+752, f2 // flags = notrap aligned +; fstore64 sp+744, f3 // flags = notrap aligned +; fstore64 sp+736, f4 // flags = notrap aligned +; fstore64 sp+728, f5 // flags = notrap aligned +; fstore64 sp+720, f6 // flags = notrap aligned +; fstore64 sp+712, f7 // flags = notrap aligned +; fstore64 sp+704, f8 // flags = notrap aligned +; fstore64 sp+696, f9 // flags = notrap aligned +; fstore64 sp+688, f10 // flags = notrap aligned +; fstore64 sp+680, f11 // flags = notrap aligned +; fstore64 sp+672, f12 // flags = notrap aligned +; fstore64 sp+664, f13 // flags = notrap aligned +; fstore64 sp+656, f14 // flags = notrap aligned +; fstore64 sp+648, f15 // flags = notrap aligned +; fstore64 sp+640, f16 // flags = notrap aligned +; fstore64 sp+632, f17 // flags = notrap aligned +; fstore64 sp+624, f18 // flags = notrap aligned +; fstore64 sp+616, f19 // flags = notrap aligned +; fstore64 sp+608, f20 // flags = notrap aligned +; fstore64 sp+600, f21 // flags = notrap aligned +; fstore64 sp+592, f22 // flags = notrap aligned +; fstore64 sp+584, f23 // flags = notrap aligned +; fstore64 sp+576, f24 // flags = notrap aligned +; fstore64 sp+568, f25 // flags = notrap aligned +; fstore64 sp+560, f26 // flags = notrap aligned +; fstore64 sp+552, f27 // flags = notrap aligned +; fstore64 sp+544, f28 // flags = notrap aligned +; fstore64 sp+536, f29 // flags = notrap aligned +; fstore64 sp+528, f30 // flags = notrap aligned +; fstore64 sp+520, f31 // flags = notrap aligned +; vstore128 sp+512, v0 // flags = notrap aligned little +; vstore128 sp+504, v1 // flags = notrap aligned little +; vstore128 sp+496, v2 // flags = notrap aligned little +; vstore128 sp+488, v3 // flags = notrap aligned little +; vstore128 sp+480, v4 // flags = notrap aligned little +; vstore128 sp+472, v5 // flags = notrap aligned little +; vstore128 sp+464, v6 // flags = notrap aligned little +; vstore128 sp+456, v7 // flags = notrap aligned little +; vstore128 sp+448, v8 // flags = notrap aligned little +; vstore128 sp+440, v9 // flags = notrap aligned little +; vstore128 sp+432, v10 // flags = notrap aligned little +; vstore128 sp+424, v11 // flags = notrap aligned little +; vstore128 sp+416, v12 // flags = notrap aligned little +; vstore128 sp+408, v13 // flags = notrap aligned little +; vstore128 sp+400, v14 // flags = notrap aligned little +; vstore128 sp+392, v15 // flags = notrap aligned little +; vstore128 sp+384, v16 // flags = notrap aligned little +; vstore128 sp+376, v17 // flags = notrap aligned little +; vstore128 sp+368, v18 // flags = notrap aligned little +; vstore128 sp+360, v19 // flags = notrap aligned little +; vstore128 sp+352, v20 // flags = notrap aligned little +; vstore128 sp+344, v21 // flags = notrap aligned little +; vstore128 sp+336, v22 // flags = notrap aligned little +; vstore128 sp+328, v23 // flags = notrap aligned little +; vstore128 sp+320, v24 // flags = notrap aligned little +; vstore128 sp+312, v25 // flags = notrap aligned little +; vstore128 sp+304, v26 // flags = notrap aligned little +; vstore128 sp+296, v27 // flags = notrap aligned little +; vstore128 sp+288, v28 // flags = notrap aligned little +; vstore128 sp+280, v29 // flags = notrap aligned little +; vstore128 sp+272, v30 // flags = notrap aligned little +; vstore128 sp+264, v31 // flags = notrap aligned little +; block0: +; xmov x16, x1 +; indirect_call_host CallInfo { dest: TestCase(%host), uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [], clobbers: PRegSet { bits: [65535, 4294967295, 4294967295, 0] }, callee_conv: SystemV, caller_conv: PreserveAll, callee_pop_size: 0, try_call_info: None, patchable: false } +; xmov x0, x16 +; indirect_call_host CallInfo { dest: TestCase(%host), uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [], clobbers: PRegSet { bits: [65535, 4294967295, 4294967295, 0] }, callee_conv: SystemV, caller_conv: PreserveAll, callee_pop_size: 0, try_call_info: None, patchable: false } +; x0 = xload64 sp+896 // flags = notrap aligned +; x1 = xload64 sp+888 // flags = notrap aligned +; x2 = xload64 sp+880 // flags = notrap aligned +; x3 = xload64 sp+872 // flags = notrap aligned +; x4 = xload64 sp+864 // flags = notrap aligned +; x5 = xload64 sp+856 // flags = notrap aligned +; x6 = xload64 sp+848 // flags = notrap aligned +; x7 = xload64 sp+840 // flags = notrap aligned +; x8 = xload64 sp+832 // flags = notrap aligned +; x9 = xload64 sp+824 // flags = notrap aligned +; x10 = xload64 sp+816 // flags = notrap aligned +; x11 = xload64 sp+808 // flags = notrap aligned +; x12 = xload64 sp+800 // flags = notrap aligned +; x13 = xload64 sp+792 // flags = notrap aligned +; x14 = xload64 sp+784 // flags = notrap aligned +; x15 = xload64 sp+776 // flags = notrap aligned +; f0 = fload64 sp+768 // flags = notrap aligned +; f1 = fload64 sp+760 // flags = notrap aligned +; f2 = fload64 sp+752 // flags = notrap aligned +; f3 = fload64 sp+744 // flags = notrap aligned +; f4 = fload64 sp+736 // flags = notrap aligned +; f5 = fload64 sp+728 // flags = notrap aligned +; f6 = fload64 sp+720 // flags = notrap aligned +; f7 = fload64 sp+712 // flags = notrap aligned +; f8 = fload64 sp+704 // flags = notrap aligned +; f9 = fload64 sp+696 // flags = notrap aligned +; f10 = fload64 sp+688 // flags = notrap aligned +; f11 = fload64 sp+680 // flags = notrap aligned +; f12 = fload64 sp+672 // flags = notrap aligned +; f13 = fload64 sp+664 // flags = notrap aligned +; f14 = fload64 sp+656 // flags = notrap aligned +; f15 = fload64 sp+648 // flags = notrap aligned +; f16 = fload64 sp+640 // flags = notrap aligned +; f17 = fload64 sp+632 // flags = notrap aligned +; f18 = fload64 sp+624 // flags = notrap aligned +; f19 = fload64 sp+616 // flags = notrap aligned +; f20 = fload64 sp+608 // flags = notrap aligned +; f21 = fload64 sp+600 // flags = notrap aligned +; f22 = fload64 sp+592 // flags = notrap aligned +; f23 = fload64 sp+584 // flags = notrap aligned +; f24 = fload64 sp+576 // flags = notrap aligned +; f25 = fload64 sp+568 // flags = notrap aligned +; f26 = fload64 sp+560 // flags = notrap aligned +; f27 = fload64 sp+552 // flags = notrap aligned +; f28 = fload64 sp+544 // flags = notrap aligned +; f29 = fload64 sp+536 // flags = notrap aligned +; f30 = fload64 sp+528 // flags = notrap aligned +; f31 = fload64 sp+520 // flags = notrap aligned +; v0 = vload128 sp+512 // flags = notrap aligned little +; v1 = vload128 sp+504 // flags = notrap aligned little +; v2 = vload128 sp+496 // flags = notrap aligned little +; v3 = vload128 sp+488 // flags = notrap aligned little +; v4 = vload128 sp+480 // flags = notrap aligned little +; v5 = vload128 sp+472 // flags = notrap aligned little +; v6 = vload128 sp+464 // flags = notrap aligned little +; v7 = vload128 sp+456 // flags = notrap aligned little +; v8 = vload128 sp+448 // flags = notrap aligned little +; v9 = vload128 sp+440 // flags = notrap aligned little +; v10 = vload128 sp+432 // flags = notrap aligned little +; v11 = vload128 sp+424 // flags = notrap aligned little +; v12 = vload128 sp+416 // flags = notrap aligned little +; v13 = vload128 sp+408 // flags = notrap aligned little +; v14 = vload128 sp+400 // flags = notrap aligned little +; v15 = vload128 sp+392 // flags = notrap aligned little +; v16 = vload128 sp+384 // flags = notrap aligned little +; v17 = vload128 sp+376 // flags = notrap aligned little +; v18 = vload128 sp+368 // flags = notrap aligned little +; v19 = vload128 sp+360 // flags = notrap aligned little +; v20 = vload128 sp+352 // flags = notrap aligned little +; v21 = vload128 sp+344 // flags = notrap aligned little +; v22 = vload128 sp+336 // flags = notrap aligned little +; v23 = vload128 sp+328 // flags = notrap aligned little +; v24 = vload128 sp+320 // flags = notrap aligned little +; v25 = vload128 sp+312 // flags = notrap aligned little +; v26 = vload128 sp+304 // flags = notrap aligned little +; v27 = vload128 sp+296 // flags = notrap aligned little +; v28 = vload128 sp+288 // flags = notrap aligned little +; v29 = vload128 sp+280 // flags = notrap aligned little +; v30 = vload128 sp+272 // flags = notrap aligned little +; v31 = vload128 sp+264 // flags = notrap aligned little +; pop_frame_restore 912, {x16} +; ret +; +; Disassembled: +; push_frame_save 912, x16 +; xstore64le_o32 sp, 896, x0 +; xstore64le_o32 sp, 888, x1 +; xstore64le_o32 sp, 880, x2 +; xstore64le_o32 sp, 872, x3 +; xstore64le_o32 sp, 864, x4 +; xstore64le_o32 sp, 856, x5 +; xstore64le_o32 sp, 848, x6 +; xstore64le_o32 sp, 840, x7 +; xstore64le_o32 sp, 832, x8 +; xstore64le_o32 sp, 824, x9 +; xstore64le_o32 sp, 816, x10 +; xstore64le_o32 sp, 808, x11 +; xstore64le_o32 sp, 800, x12 +; xstore64le_o32 sp, 792, x13 +; xstore64le_o32 sp, 784, x14 +; xstore64le_o32 sp, 776, x15 +; fstore64le_o32 sp, 768, f0 +; fstore64le_o32 sp, 760, f1 +; fstore64le_o32 sp, 752, f2 +; fstore64le_o32 sp, 744, f3 +; fstore64le_o32 sp, 736, f4 +; fstore64le_o32 sp, 728, f5 +; fstore64le_o32 sp, 720, f6 +; fstore64le_o32 sp, 712, f7 +; fstore64le_o32 sp, 704, f8 +; fstore64le_o32 sp, 696, f9 +; fstore64le_o32 sp, 688, f10 +; fstore64le_o32 sp, 680, f11 +; fstore64le_o32 sp, 672, f12 +; fstore64le_o32 sp, 664, f13 +; fstore64le_o32 sp, 656, f14 +; fstore64le_o32 sp, 648, f15 +; fstore64le_o32 sp, 640, f16 +; fstore64le_o32 sp, 632, f17 +; fstore64le_o32 sp, 624, f18 +; fstore64le_o32 sp, 616, f19 +; fstore64le_o32 sp, 608, f20 +; fstore64le_o32 sp, 600, f21 +; fstore64le_o32 sp, 592, f22 +; fstore64le_o32 sp, 584, f23 +; fstore64le_o32 sp, 576, f24 +; fstore64le_o32 sp, 568, f25 +; fstore64le_o32 sp, 560, f26 +; fstore64le_o32 sp, 552, f27 +; fstore64le_o32 sp, 544, f28 +; fstore64le_o32 sp, 536, f29 +; fstore64le_o32 sp, 528, f30 +; fstore64le_o32 sp, 520, f31 +; vstore128le_o32 sp, 512, v0 +; vstore128le_o32 sp, 504, v1 +; vstore128le_o32 sp, 496, v2 +; vstore128le_o32 sp, 488, v3 +; vstore128le_o32 sp, 480, v4 +; vstore128le_o32 sp, 472, v5 +; vstore128le_o32 sp, 464, v6 +; vstore128le_o32 sp, 456, v7 +; vstore128le_o32 sp, 448, v8 +; vstore128le_o32 sp, 440, v9 +; vstore128le_o32 sp, 432, v10 +; vstore128le_o32 sp, 424, v11 +; vstore128le_o32 sp, 416, v12 +; vstore128le_o32 sp, 408, v13 +; vstore128le_o32 sp, 400, v14 +; vstore128le_o32 sp, 392, v15 +; vstore128le_o32 sp, 384, v16 +; vstore128le_o32 sp, 376, v17 +; vstore128le_o32 sp, 368, v18 +; vstore128le_o32 sp, 360, v19 +; vstore128le_o32 sp, 352, v20 +; vstore128le_o32 sp, 344, v21 +; vstore128le_o32 sp, 336, v22 +; vstore128le_o32 sp, 328, v23 +; vstore128le_o32 sp, 320, v24 +; vstore128le_o32 sp, 312, v25 +; vstore128le_o32 sp, 304, v26 +; vstore128le_o32 sp, 296, v27 +; vstore128le_o32 sp, 288, v28 +; vstore128le_o32 sp, 280, v29 +; vstore128le_o32 sp, 272, v30 +; vstore128le_o32 sp, 264, v31 +; xmov x16, x1 +; call_indirect_host 0 +; xmov x0, x16 +; call_indirect_host 0 +; xload64le_o32 x0, sp, 896 +; xload64le_o32 x1, sp, 888 +; xload64le_o32 x2, sp, 880 +; xload64le_o32 x3, sp, 872 +; xload64le_o32 x4, sp, 864 +; xload64le_o32 x5, sp, 856 +; xload64le_o32 x6, sp, 848 +; xload64le_o32 x7, sp, 840 +; xload64le_o32 x8, sp, 832 +; xload64le_o32 x9, sp, 824 +; xload64le_o32 x10, sp, 816 +; xload64le_o32 x11, sp, 808 +; xload64le_o32 x12, sp, 800 +; xload64le_o32 x13, sp, 792 +; xload64le_o32 x14, sp, 784 +; xload64le_o32 x15, sp, 776 +; fload64le_o32 f0, sp, 768 +; fload64le_o32 f1, sp, 760 +; fload64le_o32 f2, sp, 752 +; fload64le_o32 f3, sp, 744 +; fload64le_o32 f4, sp, 736 +; fload64le_o32 f5, sp, 728 +; fload64le_o32 f6, sp, 720 +; fload64le_o32 f7, sp, 712 +; fload64le_o32 f8, sp, 704 +; fload64le_o32 f9, sp, 696 +; fload64le_o32 f10, sp, 688 +; fload64le_o32 f11, sp, 680 +; fload64le_o32 f12, sp, 672 +; fload64le_o32 f13, sp, 664 +; fload64le_o32 f14, sp, 656 +; fload64le_o32 f15, sp, 648 +; fload64le_o32 f16, sp, 640 +; fload64le_o32 f17, sp, 632 +; fload64le_o32 f18, sp, 624 +; fload64le_o32 f19, sp, 616 +; fload64le_o32 f20, sp, 608 +; fload64le_o32 f21, sp, 600 +; fload64le_o32 f22, sp, 592 +; fload64le_o32 f23, sp, 584 +; fload64le_o32 f24, sp, 576 +; fload64le_o32 f25, sp, 568 +; fload64le_o32 f26, sp, 560 +; fload64le_o32 f27, sp, 552 +; fload64le_o32 f28, sp, 544 +; fload64le_o32 f29, sp, 536 +; fload64le_o32 f30, sp, 528 +; fload64le_o32 f31, sp, 520 +; vload128le_o32 v0, sp, 512 +; vload128le_o32 v1, sp, 504 +; vload128le_o32 v2, sp, 496 +; vload128le_o32 v3, sp, 488 +; vload128le_o32 v4, sp, 480 +; vload128le_o32 v5, sp, 472 +; vload128le_o32 v6, sp, 464 +; vload128le_o32 v7, sp, 456 +; vload128le_o32 v8, sp, 448 +; vload128le_o32 v9, sp, 440 +; vload128le_o32 v10, sp, 432 +; vload128le_o32 v11, sp, 424 +; vload128le_o32 v12, sp, 416 +; vload128le_o32 v13, sp, 408 +; vload128le_o32 v14, sp, 400 +; vload128le_o32 v15, sp, 392 +; vload128le_o32 v16, sp, 384 +; vload128le_o32 v17, sp, 376 +; vload128le_o32 v18, sp, 368 +; vload128le_o32 v19, sp, 360 +; vload128le_o32 v20, sp, 352 +; vload128le_o32 v21, sp, 344 +; vload128le_o32 v22, sp, 336 +; vload128le_o32 v23, sp, 328 +; vload128le_o32 v24, sp, 320 +; vload128le_o32 v25, sp, 312 +; vload128le_o32 v26, sp, 304 +; vload128le_o32 v27, sp, 296 +; vload128le_o32 v28, sp, 288 +; vload128le_o32 v29, sp, 280 +; vload128le_o32 v30, sp, 272 +; vload128le_o32 v31, sp, 264 +; pop_frame_restore 912, x16 +; ret + diff --git a/cranelift/filetests/filetests/isa/pulley64/preserve-all.clif b/cranelift/filetests/filetests/isa/pulley64/preserve-all.clif index 2b6a28ce9ece..363a6c3538c7 100644 --- a/cranelift/filetests/filetests/isa/pulley64/preserve-all.clif +++ b/cranelift/filetests/filetests/isa/pulley64/preserve-all.clif @@ -390,3 +390,350 @@ block0(v0: i64): ; pop_frame ; ret +function %clobber_save_no_slot_collision(i64, i64) preserve_all { + fn0 = %host(i64) system_v +block0(v0: i64, v1: i64): + call fn0(v0) + call fn0(v1) + return +} + +; VCode: +; push_frame_save 912, {x16} +; xstore64 sp+896, x0 // flags = notrap aligned +; xstore64 sp+888, x1 // flags = notrap aligned +; xstore64 sp+880, x2 // flags = notrap aligned +; xstore64 sp+872, x3 // flags = notrap aligned +; xstore64 sp+864, x4 // flags = notrap aligned +; xstore64 sp+856, x5 // flags = notrap aligned +; xstore64 sp+848, x6 // flags = notrap aligned +; xstore64 sp+840, x7 // flags = notrap aligned +; xstore64 sp+832, x8 // flags = notrap aligned +; xstore64 sp+824, x9 // flags = notrap aligned +; xstore64 sp+816, x10 // flags = notrap aligned +; xstore64 sp+808, x11 // flags = notrap aligned +; xstore64 sp+800, x12 // flags = notrap aligned +; xstore64 sp+792, x13 // flags = notrap aligned +; xstore64 sp+784, x14 // flags = notrap aligned +; xstore64 sp+776, x15 // flags = notrap aligned +; fstore64 sp+768, f0 // flags = notrap aligned +; fstore64 sp+760, f1 // flags = notrap aligned +; fstore64 sp+752, f2 // flags = notrap aligned +; fstore64 sp+744, f3 // flags = notrap aligned +; fstore64 sp+736, f4 // flags = notrap aligned +; fstore64 sp+728, f5 // flags = notrap aligned +; fstore64 sp+720, f6 // flags = notrap aligned +; fstore64 sp+712, f7 // flags = notrap aligned +; fstore64 sp+704, f8 // flags = notrap aligned +; fstore64 sp+696, f9 // flags = notrap aligned +; fstore64 sp+688, f10 // flags = notrap aligned +; fstore64 sp+680, f11 // flags = notrap aligned +; fstore64 sp+672, f12 // flags = notrap aligned +; fstore64 sp+664, f13 // flags = notrap aligned +; fstore64 sp+656, f14 // flags = notrap aligned +; fstore64 sp+648, f15 // flags = notrap aligned +; fstore64 sp+640, f16 // flags = notrap aligned +; fstore64 sp+632, f17 // flags = notrap aligned +; fstore64 sp+624, f18 // flags = notrap aligned +; fstore64 sp+616, f19 // flags = notrap aligned +; fstore64 sp+608, f20 // flags = notrap aligned +; fstore64 sp+600, f21 // flags = notrap aligned +; fstore64 sp+592, f22 // flags = notrap aligned +; fstore64 sp+584, f23 // flags = notrap aligned +; fstore64 sp+576, f24 // flags = notrap aligned +; fstore64 sp+568, f25 // flags = notrap aligned +; fstore64 sp+560, f26 // flags = notrap aligned +; fstore64 sp+552, f27 // flags = notrap aligned +; fstore64 sp+544, f28 // flags = notrap aligned +; fstore64 sp+536, f29 // flags = notrap aligned +; fstore64 sp+528, f30 // flags = notrap aligned +; fstore64 sp+520, f31 // flags = notrap aligned +; vstore128 sp+512, v0 // flags = notrap aligned little +; vstore128 sp+504, v1 // flags = notrap aligned little +; vstore128 sp+496, v2 // flags = notrap aligned little +; vstore128 sp+488, v3 // flags = notrap aligned little +; vstore128 sp+480, v4 // flags = notrap aligned little +; vstore128 sp+472, v5 // flags = notrap aligned little +; vstore128 sp+464, v6 // flags = notrap aligned little +; vstore128 sp+456, v7 // flags = notrap aligned little +; vstore128 sp+448, v8 // flags = notrap aligned little +; vstore128 sp+440, v9 // flags = notrap aligned little +; vstore128 sp+432, v10 // flags = notrap aligned little +; vstore128 sp+424, v11 // flags = notrap aligned little +; vstore128 sp+416, v12 // flags = notrap aligned little +; vstore128 sp+408, v13 // flags = notrap aligned little +; vstore128 sp+400, v14 // flags = notrap aligned little +; vstore128 sp+392, v15 // flags = notrap aligned little +; vstore128 sp+384, v16 // flags = notrap aligned little +; vstore128 sp+376, v17 // flags = notrap aligned little +; vstore128 sp+368, v18 // flags = notrap aligned little +; vstore128 sp+360, v19 // flags = notrap aligned little +; vstore128 sp+352, v20 // flags = notrap aligned little +; vstore128 sp+344, v21 // flags = notrap aligned little +; vstore128 sp+336, v22 // flags = notrap aligned little +; vstore128 sp+328, v23 // flags = notrap aligned little +; vstore128 sp+320, v24 // flags = notrap aligned little +; vstore128 sp+312, v25 // flags = notrap aligned little +; vstore128 sp+304, v26 // flags = notrap aligned little +; vstore128 sp+296, v27 // flags = notrap aligned little +; vstore128 sp+288, v28 // flags = notrap aligned little +; vstore128 sp+280, v29 // flags = notrap aligned little +; vstore128 sp+272, v30 // flags = notrap aligned little +; vstore128 sp+264, v31 // flags = notrap aligned little +; block0: +; xmov x16, x1 +; indirect_call_host CallInfo { dest: TestCase(%host), uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [], clobbers: PRegSet { bits: [65535, 4294967295, 4294967295, 0] }, callee_conv: SystemV, caller_conv: PreserveAll, callee_pop_size: 0, try_call_info: None, patchable: false } +; xmov x0, x16 +; indirect_call_host CallInfo { dest: TestCase(%host), uses: [CallArgPair { vreg: p0i, preg: p0i }], defs: [], clobbers: PRegSet { bits: [65535, 4294967295, 4294967295, 0] }, callee_conv: SystemV, caller_conv: PreserveAll, callee_pop_size: 0, try_call_info: None, patchable: false } +; x0 = xload64 sp+896 // flags = notrap aligned +; x1 = xload64 sp+888 // flags = notrap aligned +; x2 = xload64 sp+880 // flags = notrap aligned +; x3 = xload64 sp+872 // flags = notrap aligned +; x4 = xload64 sp+864 // flags = notrap aligned +; x5 = xload64 sp+856 // flags = notrap aligned +; x6 = xload64 sp+848 // flags = notrap aligned +; x7 = xload64 sp+840 // flags = notrap aligned +; x8 = xload64 sp+832 // flags = notrap aligned +; x9 = xload64 sp+824 // flags = notrap aligned +; x10 = xload64 sp+816 // flags = notrap aligned +; x11 = xload64 sp+808 // flags = notrap aligned +; x12 = xload64 sp+800 // flags = notrap aligned +; x13 = xload64 sp+792 // flags = notrap aligned +; x14 = xload64 sp+784 // flags = notrap aligned +; x15 = xload64 sp+776 // flags = notrap aligned +; f0 = fload64 sp+768 // flags = notrap aligned +; f1 = fload64 sp+760 // flags = notrap aligned +; f2 = fload64 sp+752 // flags = notrap aligned +; f3 = fload64 sp+744 // flags = notrap aligned +; f4 = fload64 sp+736 // flags = notrap aligned +; f5 = fload64 sp+728 // flags = notrap aligned +; f6 = fload64 sp+720 // flags = notrap aligned +; f7 = fload64 sp+712 // flags = notrap aligned +; f8 = fload64 sp+704 // flags = notrap aligned +; f9 = fload64 sp+696 // flags = notrap aligned +; f10 = fload64 sp+688 // flags = notrap aligned +; f11 = fload64 sp+680 // flags = notrap aligned +; f12 = fload64 sp+672 // flags = notrap aligned +; f13 = fload64 sp+664 // flags = notrap aligned +; f14 = fload64 sp+656 // flags = notrap aligned +; f15 = fload64 sp+648 // flags = notrap aligned +; f16 = fload64 sp+640 // flags = notrap aligned +; f17 = fload64 sp+632 // flags = notrap aligned +; f18 = fload64 sp+624 // flags = notrap aligned +; f19 = fload64 sp+616 // flags = notrap aligned +; f20 = fload64 sp+608 // flags = notrap aligned +; f21 = fload64 sp+600 // flags = notrap aligned +; f22 = fload64 sp+592 // flags = notrap aligned +; f23 = fload64 sp+584 // flags = notrap aligned +; f24 = fload64 sp+576 // flags = notrap aligned +; f25 = fload64 sp+568 // flags = notrap aligned +; f26 = fload64 sp+560 // flags = notrap aligned +; f27 = fload64 sp+552 // flags = notrap aligned +; f28 = fload64 sp+544 // flags = notrap aligned +; f29 = fload64 sp+536 // flags = notrap aligned +; f30 = fload64 sp+528 // flags = notrap aligned +; f31 = fload64 sp+520 // flags = notrap aligned +; v0 = vload128 sp+512 // flags = notrap aligned little +; v1 = vload128 sp+504 // flags = notrap aligned little +; v2 = vload128 sp+496 // flags = notrap aligned little +; v3 = vload128 sp+488 // flags = notrap aligned little +; v4 = vload128 sp+480 // flags = notrap aligned little +; v5 = vload128 sp+472 // flags = notrap aligned little +; v6 = vload128 sp+464 // flags = notrap aligned little +; v7 = vload128 sp+456 // flags = notrap aligned little +; v8 = vload128 sp+448 // flags = notrap aligned little +; v9 = vload128 sp+440 // flags = notrap aligned little +; v10 = vload128 sp+432 // flags = notrap aligned little +; v11 = vload128 sp+424 // flags = notrap aligned little +; v12 = vload128 sp+416 // flags = notrap aligned little +; v13 = vload128 sp+408 // flags = notrap aligned little +; v14 = vload128 sp+400 // flags = notrap aligned little +; v15 = vload128 sp+392 // flags = notrap aligned little +; v16 = vload128 sp+384 // flags = notrap aligned little +; v17 = vload128 sp+376 // flags = notrap aligned little +; v18 = vload128 sp+368 // flags = notrap aligned little +; v19 = vload128 sp+360 // flags = notrap aligned little +; v20 = vload128 sp+352 // flags = notrap aligned little +; v21 = vload128 sp+344 // flags = notrap aligned little +; v22 = vload128 sp+336 // flags = notrap aligned little +; v23 = vload128 sp+328 // flags = notrap aligned little +; v24 = vload128 sp+320 // flags = notrap aligned little +; v25 = vload128 sp+312 // flags = notrap aligned little +; v26 = vload128 sp+304 // flags = notrap aligned little +; v27 = vload128 sp+296 // flags = notrap aligned little +; v28 = vload128 sp+288 // flags = notrap aligned little +; v29 = vload128 sp+280 // flags = notrap aligned little +; v30 = vload128 sp+272 // flags = notrap aligned little +; v31 = vload128 sp+264 // flags = notrap aligned little +; pop_frame_restore 912, {x16} +; ret +; +; Disassembled: +; push_frame_save 912, x16 +; xstore64le_o32 sp, 896, x0 +; xstore64le_o32 sp, 888, x1 +; xstore64le_o32 sp, 880, x2 +; xstore64le_o32 sp, 872, x3 +; xstore64le_o32 sp, 864, x4 +; xstore64le_o32 sp, 856, x5 +; xstore64le_o32 sp, 848, x6 +; xstore64le_o32 sp, 840, x7 +; xstore64le_o32 sp, 832, x8 +; xstore64le_o32 sp, 824, x9 +; xstore64le_o32 sp, 816, x10 +; xstore64le_o32 sp, 808, x11 +; xstore64le_o32 sp, 800, x12 +; xstore64le_o32 sp, 792, x13 +; xstore64le_o32 sp, 784, x14 +; xstore64le_o32 sp, 776, x15 +; fstore64le_o32 sp, 768, f0 +; fstore64le_o32 sp, 760, f1 +; fstore64le_o32 sp, 752, f2 +; fstore64le_o32 sp, 744, f3 +; fstore64le_o32 sp, 736, f4 +; fstore64le_o32 sp, 728, f5 +; fstore64le_o32 sp, 720, f6 +; fstore64le_o32 sp, 712, f7 +; fstore64le_o32 sp, 704, f8 +; fstore64le_o32 sp, 696, f9 +; fstore64le_o32 sp, 688, f10 +; fstore64le_o32 sp, 680, f11 +; fstore64le_o32 sp, 672, f12 +; fstore64le_o32 sp, 664, f13 +; fstore64le_o32 sp, 656, f14 +; fstore64le_o32 sp, 648, f15 +; fstore64le_o32 sp, 640, f16 +; fstore64le_o32 sp, 632, f17 +; fstore64le_o32 sp, 624, f18 +; fstore64le_o32 sp, 616, f19 +; fstore64le_o32 sp, 608, f20 +; fstore64le_o32 sp, 600, f21 +; fstore64le_o32 sp, 592, f22 +; fstore64le_o32 sp, 584, f23 +; fstore64le_o32 sp, 576, f24 +; fstore64le_o32 sp, 568, f25 +; fstore64le_o32 sp, 560, f26 +; fstore64le_o32 sp, 552, f27 +; fstore64le_o32 sp, 544, f28 +; fstore64le_o32 sp, 536, f29 +; fstore64le_o32 sp, 528, f30 +; fstore64le_o32 sp, 520, f31 +; vstore128le_o32 sp, 512, v0 +; vstore128le_o32 sp, 504, v1 +; vstore128le_o32 sp, 496, v2 +; vstore128le_o32 sp, 488, v3 +; vstore128le_o32 sp, 480, v4 +; vstore128le_o32 sp, 472, v5 +; vstore128le_o32 sp, 464, v6 +; vstore128le_o32 sp, 456, v7 +; vstore128le_o32 sp, 448, v8 +; vstore128le_o32 sp, 440, v9 +; vstore128le_o32 sp, 432, v10 +; vstore128le_o32 sp, 424, v11 +; vstore128le_o32 sp, 416, v12 +; vstore128le_o32 sp, 408, v13 +; vstore128le_o32 sp, 400, v14 +; vstore128le_o32 sp, 392, v15 +; vstore128le_o32 sp, 384, v16 +; vstore128le_o32 sp, 376, v17 +; vstore128le_o32 sp, 368, v18 +; vstore128le_o32 sp, 360, v19 +; vstore128le_o32 sp, 352, v20 +; vstore128le_o32 sp, 344, v21 +; vstore128le_o32 sp, 336, v22 +; vstore128le_o32 sp, 328, v23 +; vstore128le_o32 sp, 320, v24 +; vstore128le_o32 sp, 312, v25 +; vstore128le_o32 sp, 304, v26 +; vstore128le_o32 sp, 296, v27 +; vstore128le_o32 sp, 288, v28 +; vstore128le_o32 sp, 280, v29 +; vstore128le_o32 sp, 272, v30 +; vstore128le_o32 sp, 264, v31 +; xmov x16, x1 +; call_indirect_host 0 +; xmov x0, x16 +; call_indirect_host 0 +; xload64le_o32 x0, sp, 896 +; xload64le_o32 x1, sp, 888 +; xload64le_o32 x2, sp, 880 +; xload64le_o32 x3, sp, 872 +; xload64le_o32 x4, sp, 864 +; xload64le_o32 x5, sp, 856 +; xload64le_o32 x6, sp, 848 +; xload64le_o32 x7, sp, 840 +; xload64le_o32 x8, sp, 832 +; xload64le_o32 x9, sp, 824 +; xload64le_o32 x10, sp, 816 +; xload64le_o32 x11, sp, 808 +; xload64le_o32 x12, sp, 800 +; xload64le_o32 x13, sp, 792 +; xload64le_o32 x14, sp, 784 +; xload64le_o32 x15, sp, 776 +; fload64le_o32 f0, sp, 768 +; fload64le_o32 f1, sp, 760 +; fload64le_o32 f2, sp, 752 +; fload64le_o32 f3, sp, 744 +; fload64le_o32 f4, sp, 736 +; fload64le_o32 f5, sp, 728 +; fload64le_o32 f6, sp, 720 +; fload64le_o32 f7, sp, 712 +; fload64le_o32 f8, sp, 704 +; fload64le_o32 f9, sp, 696 +; fload64le_o32 f10, sp, 688 +; fload64le_o32 f11, sp, 680 +; fload64le_o32 f12, sp, 672 +; fload64le_o32 f13, sp, 664 +; fload64le_o32 f14, sp, 656 +; fload64le_o32 f15, sp, 648 +; fload64le_o32 f16, sp, 640 +; fload64le_o32 f17, sp, 632 +; fload64le_o32 f18, sp, 624 +; fload64le_o32 f19, sp, 616 +; fload64le_o32 f20, sp, 608 +; fload64le_o32 f21, sp, 600 +; fload64le_o32 f22, sp, 592 +; fload64le_o32 f23, sp, 584 +; fload64le_o32 f24, sp, 576 +; fload64le_o32 f25, sp, 568 +; fload64le_o32 f26, sp, 560 +; fload64le_o32 f27, sp, 552 +; fload64le_o32 f28, sp, 544 +; fload64le_o32 f29, sp, 536 +; fload64le_o32 f30, sp, 528 +; fload64le_o32 f31, sp, 520 +; vload128le_o32 v0, sp, 512 +; vload128le_o32 v1, sp, 504 +; vload128le_o32 v2, sp, 496 +; vload128le_o32 v3, sp, 488 +; vload128le_o32 v4, sp, 480 +; vload128le_o32 v5, sp, 472 +; vload128le_o32 v6, sp, 464 +; vload128le_o32 v7, sp, 456 +; vload128le_o32 v8, sp, 448 +; vload128le_o32 v9, sp, 440 +; vload128le_o32 v10, sp, 432 +; vload128le_o32 v11, sp, 424 +; vload128le_o32 v12, sp, 416 +; vload128le_o32 v13, sp, 408 +; vload128le_o32 v14, sp, 400 +; vload128le_o32 v15, sp, 392 +; vload128le_o32 v16, sp, 384 +; vload128le_o32 v17, sp, 376 +; vload128le_o32 v18, sp, 368 +; vload128le_o32 v19, sp, 360 +; vload128le_o32 v20, sp, 352 +; vload128le_o32 v21, sp, 344 +; vload128le_o32 v22, sp, 336 +; vload128le_o32 v23, sp, 328 +; vload128le_o32 v24, sp, 320 +; vload128le_o32 v25, sp, 312 +; vload128le_o32 v26, sp, 304 +; vload128le_o32 v27, sp, 296 +; vload128le_o32 v28, sp, 288 +; vload128le_o32 v29, sp, 280 +; vload128le_o32 v30, sp, 272 +; vload128le_o32 v31, sp, 264 +; pop_frame_restore 912, x16 +; ret + diff --git a/crates/test-programs/src/bin/p2_ip_name_lookup.rs b/crates/test-programs/src/bin/p2_ip_name_lookup.rs index 3930d8e6083b..6eb14381ed7f 100644 --- a/crates/test-programs/src/bin/p2_ip_name_lookup.rs +++ b/crates/test-programs/src/bin/p2_ip_name_lookup.rs @@ -3,7 +3,7 @@ use test_programs::wasi::sockets::network::{ErrorCode, IpAddress}; fn main() { // Valid domains - resolve("localhost").unwrap(); + assert_resolves("localhost"); resolve_at_least_one_of(&[ "example.com", @@ -18,30 +18,27 @@ fn main() { let _ = resolve("münchen.de"); // Valid IP addresses - assert_eq!(resolve_one("0.0.0.0").unwrap(), IpAddress::IPV4_UNSPECIFIED); - assert_eq!(resolve_one("127.0.0.1").unwrap(), IpAddress::IPV4_LOOPBACK); - assert_eq!( - resolve_one("192.0.2.0").unwrap(), - IpAddress::Ipv4((192, 0, 2, 0)) - ); - assert_eq!(resolve_one("::").unwrap(), IpAddress::IPV6_UNSPECIFIED); - assert_eq!(resolve_one("::1").unwrap(), IpAddress::IPV6_LOOPBACK); - assert_eq!(resolve_one("[::]").unwrap(), IpAddress::IPV6_UNSPECIFIED); - assert_eq!( - resolve_one("2001:0db8:0:0:0:0:0:0").unwrap(), - IpAddress::Ipv6((0x2001, 0x0db8, 0, 0, 0, 0, 0, 0)) + assert_resolves_to("0.0.0.0", IpAddress::IPV4_UNSPECIFIED); + assert_resolves_to("127.0.0.1", IpAddress::IPV4_LOOPBACK); + assert_resolves_to("192.0.2.0", IpAddress::Ipv4((192, 0, 2, 0))); + assert_resolves_to("::", IpAddress::IPV6_UNSPECIFIED); + assert_resolves_to("::1", IpAddress::IPV6_LOOPBACK); + assert_resolves_to("[::]", IpAddress::IPV6_UNSPECIFIED); + assert_resolves_to( + "2001:0db8:0:0:0:0:0:0", + IpAddress::Ipv6((0x2001, 0x0db8, 0, 0, 0, 0, 0, 0)), ); - assert_eq!( - resolve_one("dead:beef::").unwrap(), - IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)) + assert_resolves_to( + "dead:beef::", + IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)), ); - assert_eq!( - resolve_one("dead:beef::0").unwrap(), - IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)) + assert_resolves_to( + "dead:beef::0", + IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)), ); - assert_eq!( - resolve_one("DEAD:BEEF::0").unwrap(), - IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)) + assert_resolves_to( + "DEAD:BEEF::0", + IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)), ); // Invalid inputs @@ -63,20 +60,49 @@ fn main() { /// succeeds. Intended to help make this test less flaky while still also /// testing live services. fn resolve_at_least_one_of(domains: &[&str]) { + let mut timeouts = 0; for domain in domains { match resolve(domain) { Ok(_) => return, - Err(e) => eprintln!("failed to resolve `{domain}`: {e}"), + Err(e) => { + eprintln!("failed to resolve `{domain}`: {e}"); + if let ErrorCode::Timeout = e { + timeouts += 1; + } + } } } + // If everything timed out just assume this is a bad CI weather day. + if timeouts == domains.len() { + return; + } panic!("should have been able to resolve at least one domain"); } -fn resolve(name: &str) -> Result, ErrorCode> { - Network::default().permissive_blocking_resolve_addresses(name) +/// Asserts that `name` resolves successfully, tolerating timeouts. +/// +/// All resolutions, even of IP address literals, seem to occasionally time out +/// on CI, so just ignore timeouts here. +fn assert_resolves(name: &str) -> Option> { + match resolve(name) { + Ok(addresses) => Some(addresses), + Err(ErrorCode::Timeout) => { + eprintln!("resolution of `{name}` timed out, skipping"); + None + } + Err(e) => panic!("failed to resolve `{name}`: {e}"), + } +} + +/// Same as `assert_resolves`, additionally asserting that `name` resolved to +/// `expected` if the resolution didn't time out. +fn assert_resolves_to(name: &str, expected: IpAddress) { + if let Some(addresses) = assert_resolves(name) { + assert_eq!(addresses.first(), Some(&expected), "resolution of `{name}`"); + } } -fn resolve_one(name: &str) -> Result { - Ok(resolve(name)?.first().unwrap().to_owned()) +fn resolve(name: &str) -> Result, ErrorCode> { + Network::default().permissive_blocking_resolve_addresses(name) } diff --git a/crates/test-programs/src/bin/p3_cli_many_tasks.rs b/crates/test-programs/src/bin/p3_cli_many_tasks.rs index f7b161ac6bb1..ceafa7ce2ca6 100644 --- a/crates/test-programs/src/bin/p3_cli_many_tasks.rs +++ b/crates/test-programs/src/bin/p3_cli_many_tasks.rs @@ -1,6 +1,6 @@ use test_programs::p3::wasi as wasip3; -#[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15")] +#[link(wasm_import_module = "wasi:clocks/monotonic-clock@0.3.0")] unsafe extern "C" { #[link_name = "[async-lower]wait-for"] fn wait_for(dur: u64) -> u32; diff --git a/crates/test-programs/src/bin/p3_http_middleware.rs b/crates/test-programs/src/bin/p3_http_middleware.rs index 54fb11cb9b9f..9b2330846ebd 100644 --- a/crates/test-programs/src/bin/p3_http_middleware.rs +++ b/crates/test-programs/src/bin/p3_http_middleware.rs @@ -18,19 +18,19 @@ wit_bindgen::generate!({ path: "../wasi-http/src/p3/wit", world: "wasi:http/middleware", with: { - "wasi:http/handler@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::handler, - "wasi:http/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::types, - "wasi:http/client@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::client, - "wasi:random/random@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::random, - "wasi:random/insecure@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure, - "wasi:random/insecure-seed@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure_seed, - "wasi:cli/stdout@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdout, - "wasi:cli/stderr@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stderr, - "wasi:cli/stdin@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdin, - "wasi:cli/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::types, - "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::monotonic_clock, - "wasi:clocks/system-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::system_clock, - "wasi:clocks/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::types, + "wasi:http/handler@0.3.0": test_programs::p3::wasi::http::handler, + "wasi:http/types@0.3.0": test_programs::p3::wasi::http::types, + "wasi:http/client@0.3.0": test_programs::p3::wasi::http::client, + "wasi:random/random@0.3.0": test_programs::p3::wasi::random::random, + "wasi:random/insecure@0.3.0": test_programs::p3::wasi::random::insecure, + "wasi:random/insecure-seed@0.3.0": test_programs::p3::wasi::random::insecure_seed, + "wasi:cli/stdout@0.3.0": test_programs::p3::wasi::cli::stdout, + "wasi:cli/stderr@0.3.0": test_programs::p3::wasi::cli::stderr, + "wasi:cli/stdin@0.3.0": test_programs::p3::wasi::cli::stdin, + "wasi:cli/types@0.3.0": test_programs::p3::wasi::cli::types, + "wasi:clocks/monotonic-clock@0.3.0": test_programs::p3::wasi::clocks::monotonic_clock, + "wasi:clocks/system-clock@0.3.0": test_programs::p3::wasi::clocks::system_clock, + "wasi:clocks/types@0.3.0": test_programs::p3::wasi::clocks::types, }, }); diff --git a/crates/test-programs/src/bin/p3_http_middleware_with_chain.rs b/crates/test-programs/src/bin/p3_http_middleware_with_chain.rs index cf14e3532b99..fbc71a5820f3 100644 --- a/crates/test-programs/src/bin/p3_http_middleware_with_chain.rs +++ b/crates/test-programs/src/bin/p3_http_middleware_with_chain.rs @@ -6,13 +6,13 @@ mod bindings { package local:local; world middleware-with-chain { - include wasi:http/service@0.3.0-rc-2026-03-15; + include wasi:http/service@0.3.0; import chain-http; } interface chain-http { - use wasi:http/types@0.3.0-rc-2026-03-15.{request, response, error-code}; + use wasi:http/types@0.3.0.{request, response, error-code}; handle: async func(request: request) -> result; } @@ -20,18 +20,18 @@ interface chain-http { // workaround https://github.com/bytecodealliance/wit-bindgen/issues/1544 // generate_all with: { - "wasi:http/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::types, - "wasi:http/client@0.3.0-rc-2026-03-15": test_programs::p3::wasi::http::client, - "wasi:random/random@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::random, - "wasi:random/insecure@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure, - "wasi:random/insecure-seed@0.3.0-rc-2026-03-15": test_programs::p3::wasi::random::insecure_seed, - "wasi:cli/stdout@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdout, - "wasi:cli/stderr@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stderr, - "wasi:cli/stdin@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::stdin, - "wasi:cli/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::cli::types, - "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::monotonic_clock, - "wasi:clocks/system-clock@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::system_clock, - "wasi:clocks/types@0.3.0-rc-2026-03-15": test_programs::p3::wasi::clocks::types, + "wasi:http/types@0.3.0": test_programs::p3::wasi::http::types, + "wasi:http/client@0.3.0": test_programs::p3::wasi::http::client, + "wasi:random/random@0.3.0": test_programs::p3::wasi::random::random, + "wasi:random/insecure@0.3.0": test_programs::p3::wasi::random::insecure, + "wasi:random/insecure-seed@0.3.0": test_programs::p3::wasi::random::insecure_seed, + "wasi:cli/stdout@0.3.0": test_programs::p3::wasi::cli::stdout, + "wasi:cli/stderr@0.3.0": test_programs::p3::wasi::cli::stderr, + "wasi:cli/stdin@0.3.0": test_programs::p3::wasi::cli::stdin, + "wasi:cli/types@0.3.0": test_programs::p3::wasi::cli::types, + "wasi:clocks/monotonic-clock@0.3.0": test_programs::p3::wasi::clocks::monotonic_clock, + "wasi:clocks/system-clock@0.3.0": test_programs::p3::wasi::clocks::system_clock, + "wasi:clocks/types@0.3.0": test_programs::p3::wasi::clocks::types, }, }); diff --git a/crates/test-programs/src/bin/p3_sockets_ip_name_lookup.rs b/crates/test-programs/src/bin/p3_sockets_ip_name_lookup.rs index 6437c09b01d9..5352729ce619 100644 --- a/crates/test-programs/src/bin/p3_sockets_ip_name_lookup.rs +++ b/crates/test-programs/src/bin/p3_sockets_ip_name_lookup.rs @@ -1,3 +1,6 @@ +use core::pin::pin; +use futures::future::{Either, select}; +use test_programs::p3::wasi::clocks::monotonic_clock; use test_programs::p3::wasi::sockets::ip_name_lookup::{ErrorCode, resolve_addresses}; use test_programs::p3::wasi::sockets::types::IpAddress; @@ -5,32 +8,66 @@ struct Component; test_programs::p3::export!(Component); -async fn resolve_one(name: &str) -> Result { - Ok(resolve_addresses(name.into()) - .await? - .first() - .unwrap() - .to_owned()) +/// Resolves `name`, returning `None` if the resolution didn't complete within +/// enough time. +async fn resolve(name: &str) -> Option, ErrorCode>> { + const TIMEOUT_NS: u64 = 1_000_000_000; + let resolve = pin!(resolve_addresses(name.into())); + let timeout = pin!(monotonic_clock::wait_for(TIMEOUT_NS)); + match select(resolve, timeout).await { + Either::Left((result, _)) => Some(result), + Either::Right(((), _)) => None, + } +} + +/// Asserts that `name` resolves successfully, tolerating timeouts. +/// +/// Timed out resolutions are skipped rather than failing the test. See +/// `resolve` for why timeouts don't fail the test. +async fn assert_resolves(name: &str) -> Option> { + match resolve(name).await { + Some(Ok(addresses)) => Some(addresses), + None => { + eprintln!("resolution of `{name}` timed out, skipping"); + None + } + Some(Err(e)) => panic!("failed to resolve `{name}`: {e}"), + } +} + +/// Same as `assert_resolves`, additionally asserting that `name` resolved to +/// `expected` if the resolution didn't time out. +async fn assert_resolves_to(name: &str, expected: IpAddress) { + if let Some(addresses) = assert_resolves(name).await { + assert_eq!(addresses.first(), Some(&expected), "resolution of `{name}`"); + } } /// Attempts to resolve at least one of `domains`. Allows failure so long as one /// succeeds. Intended to help make this test less flaky while still also /// testing live services. async fn resolve_at_least_one_of(domains: &[&str]) { + let mut timeouts = 0; for domain in domains { - match resolve_one(domain).await { - Ok(_) => return, - Err(e) => eprintln!("failed to resolve `{domain}`: {e}"), + match resolve(domain).await { + Some(Ok(_)) => return, + None => timeouts += 1, + Some(Err(e)) => eprintln!("failed to resolve `{domain}`: {e}"), } } + // Ignore if everything times out. + if timeouts == domains.len() { + return; + } + panic!("should have been able to resolve at least one domain"); } impl test_programs::p3::exports::wasi::cli::run::Guest for Component { async fn run() -> Result<(), ()> { // Valid domains - resolve_one("localhost").await.unwrap(); + assert_resolves("localhost").await; resolve_at_least_one_of(&[ "example.com", @@ -46,43 +83,32 @@ impl test_programs::p3::exports::wasi::cli::run::Guest for Component { let _ = resolve_addresses("münchen.de".into()).await; // Valid IP addresses - assert_eq!( - resolve_one("0.0.0.0").await.unwrap(), - IpAddress::IPV4_UNSPECIFIED - ); - assert_eq!( - resolve_one("127.0.0.1").await.unwrap(), - IpAddress::IPV4_LOOPBACK - ); - assert_eq!( - resolve_one("192.0.2.0").await.unwrap(), - IpAddress::Ipv4((192, 0, 2, 0)) - ); - assert_eq!( - resolve_one("::").await.unwrap(), - IpAddress::IPV6_UNSPECIFIED - ); - assert_eq!(resolve_one("::1").await.unwrap(), IpAddress::IPV6_LOOPBACK); - assert_eq!( - resolve_one("[::]").await.unwrap(), - IpAddress::IPV6_UNSPECIFIED - ); - assert_eq!( - resolve_one("2001:0db8:0:0:0:0:0:0").await.unwrap(), - IpAddress::Ipv6((0x2001, 0x0db8, 0, 0, 0, 0, 0, 0)) - ); - assert_eq!( - resolve_one("dead:beef::").await.unwrap(), - IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)) - ); - assert_eq!( - resolve_one("dead:beef::0").await.unwrap(), - IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)) - ); - assert_eq!( - resolve_one("DEAD:BEEF::0").await.unwrap(), - IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)) - ); + assert_resolves_to("0.0.0.0", IpAddress::IPV4_UNSPECIFIED).await; + assert_resolves_to("127.0.0.1", IpAddress::IPV4_LOOPBACK).await; + assert_resolves_to("192.0.2.0", IpAddress::Ipv4((192, 0, 2, 0))).await; + assert_resolves_to("::", IpAddress::IPV6_UNSPECIFIED).await; + assert_resolves_to("::1", IpAddress::IPV6_LOOPBACK).await; + assert_resolves_to("[::]", IpAddress::IPV6_UNSPECIFIED).await; + assert_resolves_to( + "2001:0db8:0:0:0:0:0:0", + IpAddress::Ipv6((0x2001, 0x0db8, 0, 0, 0, 0, 0, 0)), + ) + .await; + assert_resolves_to( + "dead:beef::", + IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)), + ) + .await; + assert_resolves_to( + "dead:beef::0", + IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)), + ) + .await; + assert_resolves_to( + "DEAD:BEEF::0", + IpAddress::Ipv6((0xdead, 0xbeef, 0, 0, 0, 0, 0, 0)), + ) + .await; // Invalid inputs assert!(matches!( diff --git a/crates/test-programs/src/bin/p3_sockets_tcp_busy_poll.rs b/crates/test-programs/src/bin/p3_sockets_tcp_busy_poll.rs index 6583eed0df48..e23370edc6fe 100644 --- a/crates/test-programs/src/bin/p3_sockets_tcp_busy_poll.rs +++ b/crates/test-programs/src/bin/p3_sockets_tcp_busy_poll.rs @@ -11,7 +11,7 @@ use test_programs::p3::wit_stream; use test_programs::sockets::supports_ipv6; use wit_bindgen::StreamResult; -#[link(wasm_import_module = "wasi:http/types@0.3.0-rc-2026-03-15")] +#[link(wasm_import_module = "wasi:http/types@0.3.0")] unsafe extern "C" { #[link_name = "[async-lower][stream-read-0][static]request.new"] fn stream_read(_: u32, _: *mut u8, _: usize) -> u32; diff --git a/crates/test-programs/src/p3/mod.rs b/crates/test-programs/src/p3/mod.rs index 9e49bb1c1952..abe3ebd048c1 100644 --- a/crates/test-programs/src/p3/mod.rs +++ b/crates/test-programs/src/p3/mod.rs @@ -6,13 +6,13 @@ wit_bindgen::generate!({ package wasmtime:test; world testp3 { - include wasi:cli/imports@0.3.0-rc-2026-03-15; + include wasi:cli/imports@0.3.0; include wasi:tls/imports@0.3.0-draft; - import wasi:http/types@0.3.0-rc-2026-03-15; - import wasi:http/client@0.3.0-rc-2026-03-15; - import wasi:http/handler@0.3.0-rc-2026-03-15; + import wasi:http/types@0.3.0; + import wasi:http/client@0.3.0; + import wasi:http/handler@0.3.0; - export wasi:cli/run@0.3.0-rc-2026-03-15; + export wasi:cli/run@0.3.0; } ", path: [ @@ -32,19 +32,19 @@ pub mod service { default_bindings_module: "test_programs::p3::service", pub_export_macro: true, with: { - "wasi:http/handler@0.3.0-rc-2026-03-15": crate::p3::wasi::http::handler, - "wasi:http/types@0.3.0-rc-2026-03-15": crate::p3::wasi::http::types, - "wasi:http/client@0.3.0-rc-2026-03-15": crate::p3::wasi::http::client, - "wasi:random/random@0.3.0-rc-2026-03-15": crate::p3::wasi::random::random, - "wasi:random/insecure@0.3.0-rc-2026-03-15": crate::p3::wasi::random::insecure, - "wasi:random/insecure-seed@0.3.0-rc-2026-03-15": crate::p3::wasi::random::insecure_seed, - "wasi:cli/stdout@0.3.0-rc-2026-03-15": crate::p3::wasi::cli::stdout, - "wasi:cli/stderr@0.3.0-rc-2026-03-15": crate::p3::wasi::cli::stderr, - "wasi:cli/stdin@0.3.0-rc-2026-03-15": crate::p3::wasi::cli::stdin, - "wasi:cli/types@0.3.0-rc-2026-03-15": crate::p3::wasi::cli::types, - "wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15": crate::p3::wasi::clocks::monotonic_clock, - "wasi:clocks/system-clock@0.3.0-rc-2026-03-15": crate::p3::wasi::clocks::system_clock, - "wasi:clocks/types@0.3.0-rc-2026-03-15": crate::p3::wasi::clocks::types, + "wasi:http/handler@0.3.0": crate::p3::wasi::http::handler, + "wasi:http/types@0.3.0": crate::p3::wasi::http::types, + "wasi:http/client@0.3.0": crate::p3::wasi::http::client, + "wasi:random/random@0.3.0": crate::p3::wasi::random::random, + "wasi:random/insecure@0.3.0": crate::p3::wasi::random::insecure, + "wasi:random/insecure-seed@0.3.0": crate::p3::wasi::random::insecure_seed, + "wasi:cli/stdout@0.3.0": crate::p3::wasi::cli::stdout, + "wasi:cli/stderr@0.3.0": crate::p3::wasi::cli::stderr, + "wasi:cli/stdin@0.3.0": crate::p3::wasi::cli::stdin, + "wasi:cli/types@0.3.0": crate::p3::wasi::cli::types, + "wasi:clocks/monotonic-clock@0.3.0": crate::p3::wasi::clocks::monotonic_clock, + "wasi:clocks/system-clock@0.3.0": crate::p3::wasi::clocks::system_clock, + "wasi:clocks/types@0.3.0": crate::p3::wasi::clocks::types, }, }); } diff --git a/crates/wasi-http/src/p3/wit/deps/cli.wit b/crates/wasi-http/src/p3/wit/deps/cli.wit index 8ba52c5cd594..7aae56c17ed7 100644 --- a/crates/wasi-http/src/p3/wit/deps/cli.wit +++ b/crates/wasi-http/src/p3/wit/deps/cli.wit @@ -1,6 +1,6 @@ -package wasi:cli@0.3.0-rc-2026-03-15; +package wasi:cli@0.3.0; -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface environment { /// Get the POSIX-style environment variables. /// @@ -10,23 +10,23 @@ interface environment { /// Morally, these are a value import, but until value imports are available /// in the component model, this import function should return the same /// values each time it is called. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-environment: func() -> list>; /// Get the POSIX-style arguments to the program. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-arguments: func() -> list; /// Return a path that programs should use as their initial current working /// directory, interpreting `.` as shorthand for this. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-initial-cwd: func() -> option; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface exit { /// Exit the current instance and any linked instances. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) exit: func(status: result); /// Exit the current instance and any linked instances, reporting the @@ -37,20 +37,20 @@ interface exit { /// /// This function does not return; the effect is analogous to a trap, but /// without the connotation that something bad has happened. - @unstable(feature = cli-exit-with-code) + @since(version = 0.3.0) exit-with-code: func(status-code: u8); } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface run { /// Run the program. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) run: async func() -> result; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum error-code { /// Input/output error io, @@ -61,7 +61,7 @@ interface types { } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stdin { use types.{error-code}; @@ -78,11 +78,11 @@ interface stdin { /// /// Multiple streams may be active at the same time. The behavior of concurrent /// reads is implementation-specific. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-via-stream: func() -> tuple, future>>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stdout { use types.{error-code}; @@ -94,11 +94,11 @@ interface stdout { /// /// Otherwise if there is an error the readable end of the stream will be /// dropped and this function will return an error-code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream) -> future>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stderr { use types.{error-code}; @@ -110,7 +110,7 @@ interface stderr { /// /// Otherwise if there is an error the readable end of the stream will be /// dropped and this function will return an error-code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream) -> future>; } @@ -119,10 +119,10 @@ interface stderr { /// In the future, this may include functions for disabling echoing, /// disabling input buffering so that keyboard events are sent through /// immediately, querying supported features, and so on. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-input { /// The input side of a terminal. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource terminal-input; } @@ -131,126 +131,126 @@ interface terminal-input { /// In the future, this may include functions for querying the terminal /// size, being notified of terminal size changes, querying supported /// features, and so on. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-output { /// The output side of a terminal. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource terminal-output; } /// An interface providing an optional `terminal-input` for stdin as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stdin { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-input.{terminal-input}; /// If stdin is connected to a terminal, return a `terminal-input` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stdin: func() -> option; } /// An interface providing an optional `terminal-output` for stdout as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stdout { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-output.{terminal-output}; /// If stdout is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stdout: func() -> option; } /// An interface providing an optional `terminal-output` for stderr as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stderr { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-output.{terminal-output}; /// If stderr is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stderr: func() -> option; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import environment; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import exit; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stderr; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-input; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-output; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stderr; - import wasi:clocks/types@0.3.0-rc-2026-03-15; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:filesystem/types@0.3.0-rc-2026-03-15; - import wasi:filesystem/preopens@0.3.0-rc-2026-03-15; - import wasi:sockets/types@0.3.0-rc-2026-03-15; - import wasi:sockets/ip-name-lookup@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:filesystem/types@0.3.0; + import wasi:filesystem/preopens@0.3.0; + import wasi:sockets/types@0.3.0; + import wasi:sockets/ip-name-lookup@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world command { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import environment; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import exit; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stderr; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-input; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-output; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stderr; - import wasi:clocks/types@0.3.0-rc-2026-03-15; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:filesystem/types@0.3.0-rc-2026-03-15; - import wasi:filesystem/preopens@0.3.0-rc-2026-03-15; - import wasi:sockets/types@0.3.0-rc-2026-03-15; - import wasi:sockets/ip-name-lookup@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:filesystem/types@0.3.0; + import wasi:filesystem/preopens@0.3.0; + import wasi:sockets/types@0.3.0; + import wasi:sockets/ip-name-lookup@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) export run; } diff --git a/crates/wasi-http/src/p3/wit/deps/clocks.wit b/crates/wasi-http/src/p3/wit/deps/clocks.wit index 19fc4bcd59e9..d8b8cfe4e3a7 100644 --- a/crates/wasi-http/src/p3/wit/deps/clocks.wit +++ b/crates/wasi-http/src/p3/wit/deps/clocks.wit @@ -1,10 +1,10 @@ -package wasi:clocks@0.3.0-rc-2026-03-15; +package wasi:clocks@0.3.0; /// This interface common types used throughout wasi:clocks. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { /// A duration of time, in nanoseconds. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type duration = u64; } @@ -16,14 +16,14 @@ interface types { /// /// A monotonic clock is a clock which has an unspecified initial value, and /// successive reads of the clock will produce non-decreasing values. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface monotonic-clock { use types.{duration}; /// A mark on a monotonic clock is a number of nanoseconds since an /// unspecified initial value, and can only be compared to instances from /// the same monotonic-clock. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type mark = u64; /// Read the current value of the clock. @@ -35,20 +35,20 @@ interface monotonic-clock { /// the value of the clock in a `mark`. Consequently, implementations /// should ensure that the starting time is low enough to avoid the /// possibility of overflow in practice. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) now: func() -> mark; /// Query the resolution of the clock. Returns the duration of time /// corresponding to a clock tick. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-resolution: func() -> duration; /// Wait until the specified mark has occurred. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) wait-until: async func(when: mark); /// Wait for the specified duration to elapse. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) wait-for: async func(how-long: duration); } @@ -62,7 +62,7 @@ interface monotonic-clock { /// monotonic, making it unsuitable for measuring elapsed time. /// /// It is intended for reporting the current date and time for humans. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface system-clock { use types.{duration}; @@ -82,7 +82,7 @@ interface system-clock { /// /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record instant { seconds: s64, nanoseconds: u32, @@ -94,12 +94,12 @@ interface system-clock { /// will not necessarily produce a sequence of non-decreasing values. /// /// The nanoseconds field of the output is always less than 1000000000. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) now: func() -> instant; /// Query the resolution of the clock. Returns the smallest duration of time /// that the implementation permits distinguishing. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-resolution: func() -> duration; } @@ -148,13 +148,13 @@ interface timezone { to-debug-string: func() -> string; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import monotonic-clock; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import system-clock; @unstable(feature = clocks-timezone) import timezone; diff --git a/crates/wasi-http/src/p3/wit/deps/filesystem.wit b/crates/wasi-http/src/p3/wit/deps/filesystem.wit index 697681f30c5e..e4a778f3d237 100644 --- a/crates/wasi-http/src/p3/wit/deps/filesystem.wit +++ b/crates/wasi-http/src/p3/wit/deps/filesystem.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.3.0-rc-2026-03-15; +package wasi:filesystem@0.3.0; /// WASI filesystem is a filesystem API primarily intended to let users run WASI /// programs that access their files on their existing filesystems, without @@ -35,19 +35,19 @@ package wasi:filesystem@0.3.0-rc-2026-03-15; /// store or a database instead. /// /// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) - use wasi:clocks/system-clock@0.3.0-rc-2026-03-15.{instant}; + @since(version = 0.3.0) + use wasi:clocks/system-clock@0.3.0.{instant}; /// File size or length of a region within a file. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type filesize = u64; /// The type of a filesystem object referenced by a descriptor. /// /// Note: This was called `filetype` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant descriptor-type { /// The descriptor refers to a block device inode. block-device, @@ -71,7 +71,7 @@ interface types { /// Descriptor flags. /// /// Note: This was called `fdflags` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags descriptor-flags { /// Read mode: Data can be read. read, @@ -113,7 +113,7 @@ interface types { } /// Flags determining the method of how paths are resolved. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags path-flags { /// As long as the resolved path corresponds to a symbolic link, it is /// expanded. @@ -121,7 +121,7 @@ interface types { } /// Open flags used by `open-at`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags open-flags { /// Create file if it does not exist, similar to `O_CREAT` in POSIX. create, @@ -134,13 +134,13 @@ interface types { } /// Number of hard links to an inode. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type link-count = u64; /// File attributes. /// /// Note: This was called `filestat` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record descriptor-stat { /// File type. %type: descriptor-type, @@ -167,7 +167,7 @@ interface types { } /// When setting a timestamp, this gives the value to set it to. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant new-timestamp { /// Leave the timestamp set to its previous value. no-change, @@ -179,7 +179,7 @@ interface types { } /// A directory entry. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record directory-entry { /// The type of the file referred to by this directory entry. %type: descriptor-type, @@ -191,7 +191,7 @@ interface types { /// Not all of these error codes are returned by the functions provided by this /// API; some are used in higher-level library layers, and others are provided /// merely for alignment with POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Permission denied, similar to `EACCES` in POSIX. access, @@ -272,7 +272,7 @@ interface types { } /// File or memory access pattern advisory information. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum advice { /// The application has no advice to give on its behavior with respect /// to the specified data. @@ -296,7 +296,7 @@ interface types { /// A 128-bit hash value, split into parts because wasm doesn't have a /// 128-bit integer type. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record metadata-hash-value { /// 64 bits of a 128-bit hash value. lower: u64, @@ -307,7 +307,7 @@ interface types { /// A descriptor is a reference to a filesystem object, which may be a file, /// directory, named pipe, special file, or other object on which filesystem /// calls may be made. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource descriptor { /// Return a stream for reading from a file. /// @@ -325,7 +325,7 @@ interface types { /// resolves to `err` with an `error-code`. /// /// Note: This is similar to `pread` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-via-stream: func(offset: filesize) -> tuple, future>>; /// Return a stream for writing to a file, if available. /// @@ -339,7 +339,7 @@ interface types { /// written or an error is encountered. /// /// Note: This is similar to `pwrite` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream, offset: filesize) -> future>; /// Return a stream for appending to a file, if available. /// @@ -349,12 +349,12 @@ interface types { /// written or an error is encountered. /// /// Note: This is similar to `write` with `O_APPEND` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) append-via-stream: func(data: stream) -> future>; /// Provide file advisory information on a descriptor. /// /// This is similar to `posix_fadvise` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) advise: async func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; /// Synchronize the data of a file to disk. /// @@ -362,7 +362,7 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fdatasync` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) sync-data: async func() -> result<_, error-code>; /// Get flags associated with a descriptor. /// @@ -370,7 +370,7 @@ interface types { /// /// Note: This returns the value that was the `fs_flags` value returned /// from `fdstat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-flags: async func() -> result; /// Get the dynamic type of a descriptor. /// @@ -382,20 +382,20 @@ interface types { /// /// Note: This returns the value that was the `fs_filetype` value returned /// from `fdstat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-type: async func() -> result; /// Adjust the size of an open file. If this increases the file's size, the /// extra bytes are filled with zeros. /// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-size: async func(size: filesize) -> result<_, error-code>; /// Adjust the timestamps of an open file or directory. /// /// Note: This is similar to `futimens` in POSIX. /// /// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-times: async func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; /// Read directory entries from a directory. /// @@ -409,7 +409,7 @@ interface types { /// /// This function returns a future, which will resolve to an error code if /// reading full contents of the directory fails. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-directory: func() -> tuple, future>>; /// Synchronize the data and metadata of a file to disk. /// @@ -417,12 +417,12 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fsync` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) sync: async func() -> result<_, error-code>; /// Create a directory. /// /// Note: This is similar to `mkdirat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create-directory-at: async func(path: string) -> result<_, error-code>; /// Return the attributes of an open file or directory. /// @@ -433,7 +433,7 @@ interface types { /// modified, use `metadata-hash`. /// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) stat: async func() -> result; /// Return the attributes of a file or directory. /// @@ -442,7 +442,7 @@ interface types { /// discussion of alternatives. /// /// Note: This was called `path_filestat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) stat-at: async func(path-flags: path-flags, path: string) -> result; /// Adjust the timestamps of a file or directory. /// @@ -450,7 +450,7 @@ interface types { /// /// Note: This was called `path_filestat_set_times` in earlier versions of /// WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-times-at: async func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; /// Create a hard link. /// @@ -459,7 +459,7 @@ interface types { /// `error-code::not-permitted` if the old path is not a file. /// /// Note: This is similar to `linkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) link-at: async func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; /// Open a file or directory. /// @@ -473,7 +473,7 @@ interface types { /// `error-code::read-only`. /// /// Note: This is similar to `openat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) open-at: async func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; /// Read the contents of a symbolic link. /// @@ -481,19 +481,19 @@ interface types { /// filesystem, this function fails with `error-code::not-permitted`. /// /// Note: This is similar to `readlinkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) readlink-at: async func(path: string) -> result; /// Remove a directory. /// /// Return `error-code::not-empty` if the directory is not empty. /// /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) remove-directory-at: async func(path: string) -> result<_, error-code>; /// Rename a filesystem object. /// /// Note: This is similar to `renameat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) rename-at: async func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; /// Create a symbolic link (also known as a "symlink"). /// @@ -501,7 +501,7 @@ interface types { /// `error-code::not-permitted`. /// /// Note: This is similar to `symlinkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) symlink-at: async func(old-path: string, new-path: string) -> result<_, error-code>; /// Unlink a filesystem object that is not a directory. /// @@ -512,7 +512,7 @@ interface types { /// If the filesystem object is a directory, `error-code::access` or /// `error-code::is-directory` may be returned instead of the /// POSIX-specified `error-code::not-permitted`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) unlink-file-at: async func(path: string) -> result<_, error-code>; /// Test whether two descriptors refer to the same filesystem object. /// @@ -520,7 +520,7 @@ interface types { /// same device (`st_dev`) and inode (`st_ino` or `d_ino`) numbers. /// wasi-filesystem does not expose device and inode numbers, so this function /// may be used instead. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) is-same-object: async func(other: borrow) -> bool; /// Return a hash of the metadata associated with a filesystem object referred /// to by a descriptor. @@ -541,35 +541,35 @@ interface types { /// computed hash. /// /// However, none of these is required. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) metadata-hash: async func() -> result; /// Return a hash of the metadata associated with a filesystem object referred /// to by a directory descriptor and a relative path. /// /// This performs the same hash computation as `metadata-hash`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) metadata-hash-at: async func(path-flags: path-flags, path: string) -> result; } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface preopens { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use types.{descriptor}; /// Return the set of preopened directories, and their paths. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-directories: func() -> list>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/types@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) + import wasi:clocks/types@0.3.0; + @since(version = 0.3.0) + import wasi:clocks/system-clock@0.3.0; + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import preopens; } diff --git a/crates/wasi-http/src/p3/wit/deps/http.wit b/crates/wasi-http/src/p3/wit/deps/http.wit index c1c1e68e75ba..08458f7c6848 100644 --- a/crates/wasi-http/src/p3/wit/deps/http.wit +++ b/crates/wasi-http/src/p3/wit/deps/http.wit @@ -1,13 +1,13 @@ -package wasi:http@0.3.0-rc-2026-03-15; +package wasi:http@0.3.0; /// This interface defines all of the types and methods for implementing HTTP /// Requests and Responses, as well as their headers, trailers, and bodies. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - use wasi:clocks/types@0.3.0-rc-2026-03-15.{duration}; + use wasi:clocks/types@0.3.0.{duration}; /// This type corresponds to HTTP standard Methods. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant method { get, head, @@ -22,7 +22,7 @@ interface types { } /// This type corresponds to HTTP standard Related Schemes. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant scheme { HTTP, HTTPS, @@ -30,21 +30,21 @@ interface types { } /// Defines the case payload type for `DNS-error` above: - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record DNS-error-payload { rcode: option, info-code: option, } /// Defines the case payload type for `TLS-alert-received` above: - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record TLS-alert-received-payload { alert-id: option, alert-message: option, } /// Defines the case payload type for `HTTP-response-{header,trailer}-size` above: - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record field-size-payload { field-name: option, field-size: option, @@ -52,7 +52,7 @@ interface types { /// These cases are inspired by the IANA HTTP Proxy Error Types: /// - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { DNS-timeout, DNS-error(DNS-error-payload), @@ -102,7 +102,7 @@ interface types { /// This type enumerates the different kinds of errors that may occur when /// setting or appending to a `fields` resource. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant header-error { /// This error indicates that a `field-name` or `field-value` was /// syntactically invalid when used with an operation that sets headers in a @@ -130,7 +130,7 @@ interface types { /// This type enumerates the different kinds of errors that may occur when /// setting fields of a `request-options` resource. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant request-options-error { /// Indicates the specified field is not supported by this implementation. not-supported, @@ -150,13 +150,13 @@ interface types { /// /// Field names should always be treated as case insensitive by the `fields` /// resource for the purposes of equality checking. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type field-name = string; /// Field values should always be ASCII strings. However, in /// reality, HTTP implementations often have to interpret malformed values, /// so they are provided as a list of bytes. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type field-value = list; /// This following block defines the `fields` resource which corresponds to @@ -178,7 +178,7 @@ interface types { /// Implementations may impose limits on individual field values and on total /// aggregate field section size. Operations that would exceed these limits /// fail with `header-error.size-exceeded` - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource fields { /// Construct an empty HTTP Fields. /// @@ -254,15 +254,15 @@ interface types { } /// Headers is an alias for Fields. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type headers = fields; /// Trailers is an alias for Fields. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type trailers = fields; /// Represents an HTTP Request. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource request { /// Construct a new `request` with a default `method` of `GET`, and /// `none` values for `path-with-query`, `scheme`, and `authority`. @@ -349,7 +349,7 @@ interface types { /// /// These timeouts are separate from any the user may use to bound an /// asynchronous call. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource request-options { /// Construct a default `request-options` value. constructor(); @@ -378,11 +378,11 @@ interface types { } /// This type corresponds to the HTTP standard Status Code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type status-code = u16; /// Represents an HTTP Response. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource response { /// Construct a new `response`, with a default `status-code` of `200`. /// If a different `status-code` is needed, it must be set via the @@ -431,7 +431,7 @@ interface types { /// /// In `wasi:http/middleware` this interface is both exported and imported as /// the "downstream" and "upstream" directions of the middleware chain. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface handler { use types.{request, response, error-code}; @@ -450,7 +450,7 @@ interface handler { /// (including WIT itself) is unable to represent a component importing two /// instances of the same interface. A `client.send` import may be linked /// directly to a `handler.handle` export to bypass the network. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface client { use types.{request, response, error-code}; @@ -462,22 +462,22 @@ interface client { /// The `wasi:http/service` world captures a broad category of HTTP services /// including web applications, API servers, and proxies. It may be `include`d /// in more specific worlds such as `wasi:http/middleware`. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world service { - import wasi:cli/types@0.3.0-rc-2026-03-15; - import wasi:cli/stdout@0.3.0-rc-2026-03-15; - import wasi:cli/stderr@0.3.0-rc-2026-03-15; - import wasi:cli/stdin@0.3.0-rc-2026-03-15; - import wasi:clocks/types@0.3.0-rc-2026-03-15; + import wasi:cli/types@0.3.0; + import wasi:cli/stdout@0.3.0; + import wasi:cli/stderr@0.3.0; + import wasi:cli/stdin@0.3.0; + import wasi:clocks/types@0.3.0; import types; import client; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; export handler; } @@ -487,23 +487,23 @@ world service { /// Components may implement this world to allow them to participate in handler /// "chains" where a `request` flows through handlers on its way to some terminal /// `service` and corresponding `response` flows in the opposite direction. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world middleware { - import wasi:clocks/types@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; import types; import handler; - import wasi:cli/types@0.3.0-rc-2026-03-15; - import wasi:cli/stdout@0.3.0-rc-2026-03-15; - import wasi:cli/stderr@0.3.0-rc-2026-03-15; - import wasi:cli/stdin@0.3.0-rc-2026-03-15; + import wasi:cli/types@0.3.0; + import wasi:cli/stdout@0.3.0; + import wasi:cli/stderr@0.3.0; + import wasi:cli/stdin@0.3.0; import client; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; export handler; } diff --git a/crates/wasi-http/src/p3/wit/deps/random.wit b/crates/wasi-http/src/p3/wit/deps/random.wit index 026f44a10949..0b9a55fc09a6 100644 --- a/crates/wasi-http/src/p3/wit/deps/random.wit +++ b/crates/wasi-http/src/p3/wit/deps/random.wit @@ -1,10 +1,10 @@ -package wasi:random@0.3.0-rc-2026-03-15; +package wasi:random@0.3.0; /// The insecure-seed interface for seeding hash-map DoS resistance. /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface insecure-seed { /// Return a 128-bit value that may contain a pseudo-random value. /// @@ -23,7 +23,7 @@ interface insecure-seed { /// This will likely be changed to a value import, to prevent it from being /// called multiple times and potentially used for purposes other than DoS /// protection. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-seed: func() -> tuple; } @@ -31,7 +31,7 @@ interface insecure-seed { /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface insecure { /// Return up to `max-len` insecure pseudo-random bytes. /// @@ -48,14 +48,14 @@ interface insecure { /// Implementations MUST return at least 1 byte when `max-len` is greater /// than zero. When `max-len` is zero, implementations MUST return an empty /// list without trapping. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-random-bytes: func(max-len: u64) -> list; /// Return an insecure pseudo-random `u64` value. /// /// This function returns the same type of pseudo-random data as /// `get-insecure-random-bytes`, represented as a `u64`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-random-u64: func() -> u64; } @@ -63,7 +63,7 @@ interface insecure { /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface random { /// Return up to `max-len` cryptographically-secure random or pseudo-random /// bytes. @@ -85,23 +85,23 @@ interface random { /// This function must always return fresh data. Deterministic environments /// must omit this function, rather than implementing it with deterministic /// data. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-random-bytes: func(max-len: u64) -> list; /// Return a cryptographically-secure random or pseudo-random `u64` value. /// /// This function returns the same type of data as `get-random-bytes`, /// represented as a `u64`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-random-u64: func() -> u64; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import random; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import insecure; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import insecure-seed; } diff --git a/crates/wasi-http/src/p3/wit/deps/sockets.wit b/crates/wasi-http/src/p3/wit/deps/sockets.wit index cde2e4d6ebe0..0dd27a4fc4b2 100644 --- a/crates/wasi-http/src/p3/wit/deps/sockets.wit +++ b/crates/wasi-http/src/p3/wit/deps/sockets.wit @@ -1,9 +1,9 @@ -package wasi:sockets@0.3.0-rc-2026-03-15; +package wasi:sockets@0.3.0; -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) - use wasi:clocks/types@0.3.0-rc-2026-03-15.{duration}; + @since(version = 0.3.0) + use wasi:clocks/types@0.3.0.{duration}; /// Error codes. /// @@ -16,7 +16,7 @@ interface types { /// - `out-of-memory` /// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Access denied. /// @@ -80,7 +80,7 @@ interface types { other(option), } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum ip-address-family { /// Similar to `AF_INET` in POSIX. ipv4, @@ -88,19 +88,19 @@ interface types { ipv6, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type ipv4-address = tuple; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type ipv6-address = tuple; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant ip-address { ipv4(ipv4-address), ipv6(ipv6-address), } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record ipv4-socket-address { /// sin_port port: u16, @@ -108,7 +108,7 @@ interface types { address: ipv4-address, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record ipv6-socket-address { /// sin6_port port: u16, @@ -120,7 +120,7 @@ interface types { scope-id: u32, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant ip-socket-address { ipv4(ipv4-socket-address), ipv6(ipv6-socket-address), @@ -135,7 +135,7 @@ interface types { /// - `connecting` /// - `connected` /// - `closed` - /// See + /// See /// for more information. /// /// Note: Except where explicitly mentioned, whenever this documentation uses @@ -158,7 +158,7 @@ interface types { /// In addition to the general error codes documented on the /// `types::error-code` type, TCP socket methods may always return /// `error(invalid-state)` when in the `closed` state. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource tcp-socket { /// Create a new TCP socket. /// @@ -178,7 +178,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. /// @@ -213,7 +213,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Connect to a remote endpoint. /// @@ -249,7 +249,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) connect: async func(remote-address: ip-socket-address) -> result<_, error-code>; /// Start listening and return a stream of new inbound connections. /// @@ -321,7 +321,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) listen: func() -> result, error-code>; /// Transmit data to peer. /// @@ -345,7 +345,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) send: func(data: stream) -> future>; /// Read data from peer. /// @@ -374,7 +374,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) receive: func() -> tuple, future>>; /// Get the bound local address. /// @@ -393,7 +393,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-local-address: func() -> result; /// Get the remote address. /// @@ -405,19 +405,19 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-remote-address: func() -> result; /// Whether the socket is in the `listening` state. /// /// Equivalent to the SO_ACCEPTCONN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-is-listening: func() -> bool; /// Whether this is a IPv4 or IPv6 socket. /// /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-address-family: func() -> ip-address-family; /// Hints the desired listen queue size. Implementations are free to /// ignore this. @@ -430,7 +430,7 @@ interface types { /// - `not-supported`: (set) The platform does not support changing the backlog size after the initial listen. /// - `invalid-argument`: (set) The provided value was 0. /// - `invalid-state`: (set) The socket is in the `connecting` or `connected` state. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-listen-backlog-size: func(value: u64) -> result<_, error-code>; /// Enables or disables keepalive. /// @@ -442,9 +442,9 @@ interface types { /// false, but only come into effect when `keep-alive-enabled` is true. /// /// Equivalent to the SO_KEEPALIVE socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-enabled: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; /// Amount of time the connection has to be idle before TCP starts /// sending keepalive packets. @@ -458,9 +458,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-idle-time: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; /// The time between keepalive packets. /// @@ -473,9 +473,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-interval: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-interval: func(value: duration) -> result<_, error-code>; /// The maximum amount of keepalive packets TCP should send before /// aborting the connection. @@ -489,9 +489,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-count: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-count: func(value: u32) -> result<_, error-code>; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -499,9 +499,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-hop-limit: func(value: u8) -> result<_, error-code>; /// Kernel buffer space reserved for sending/receiving on this socket. /// Implementations usually treat this as a cap the buffer can grow to, @@ -524,18 +524,18 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } /// A UDP socket handle. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource udp-socket { /// Create a new UDP socket. /// @@ -552,7 +552,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. /// @@ -573,7 +573,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Associate this socket with a specific peer address. /// @@ -611,7 +611,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) connect: func(remote-address: ip-socket-address) -> result<_, error-code>; /// Dissociate this socket from its peer address. /// @@ -628,7 +628,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) disconnect: func() -> result<_, error-code>; /// Send a message on the socket to a particular peer. /// @@ -672,7 +672,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) send: async func(data: list, remote-address: option) -> result<_, error-code>; /// Receive a message on the socket. /// @@ -697,7 +697,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) receive: async func() -> result, ip-socket-address>, error-code>; /// Get the current bound address. /// @@ -716,7 +716,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-local-address: func() -> result; /// Get the address the socket is currently "connected" to. /// @@ -728,14 +728,14 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-remote-address: func() -> result; /// Whether this is a IPv4 or IPv6 socket. /// /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-address-family: func() -> ip-address-family; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -743,9 +743,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-unicast-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; /// Kernel buffer space reserved for sending/receiving on this socket. /// Implementations usually treat this as a cap the buffer can grow to, @@ -760,24 +760,24 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface ip-name-lookup { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use types.{ip-address}; /// Lookup error codes. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Access denied. /// @@ -824,16 +824,16 @@ interface ip-name-lookup { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resolve-addresses: async func(name: string) -> result, error-code>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/types@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) + import wasi:clocks/types@0.3.0; + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import ip-name-lookup; } diff --git a/crates/wasi-http/src/p3/wit/world.wit b/crates/wasi-http/src/p3/wit/world.wit index 8e7c32424586..8f5009396914 100644 --- a/crates/wasi-http/src/p3/wit/world.wit +++ b/crates/wasi-http/src/p3/wit/world.wit @@ -2,5 +2,5 @@ package wasmtime:wasi-http; world bindings { - include wasi:http/service@0.3.0-rc-2026-03-15; + include wasi:http/service@0.3.0; } diff --git a/crates/wasi-http/tests/all/p3/mod.rs b/crates/wasi-http/tests/all/p3/mod.rs index af3fdb0b9fcd..532cbfd80dd6 100644 --- a/crates/wasi-http/tests/all/p3/mod.rs +++ b/crates/wasi-http/tests/all/p3/mod.rs @@ -405,7 +405,7 @@ async fn test_http_middleware_with_chain(host_to_host: bool) -> Result<()> { "local:local/chain-http".to_owned(), InstantiationArg { instance: "local:local/chain-http".into(), - export: Some("wasi:http/handler@0.3.0-rc-2026-03-15".into()), + export: Some("wasi:http/handler@0.3.0".into()), }, )] .into_iter() diff --git a/crates/wasi/src/p3/bindings.rs b/crates/wasi/src/p3/bindings.rs index d6c11da7703e..ab774e909f53 100644 --- a/crates/wasi/src/p3/bindings.rs +++ b/crates/wasi/src/p3/bindings.rs @@ -23,7 +23,7 @@ //! // An example of extending the `wasi:cli/command` world with a //! // custom host interface. //! world my-world { -//! include wasi:cli/command@0.3.0-rc-2026-03-15; +//! include wasi:cli/command@0.3.0; //! //! import custom-host; //! } diff --git a/crates/wasi/src/p3/cli/mod.rs b/crates/wasi/src/p3/cli/mod.rs index 5e96b919ddae..630bc748eaa7 100644 --- a/crates/wasi/src/p3/cli/mod.rs +++ b/crates/wasi/src/p3/cli/mod.rs @@ -62,19 +62,7 @@ pub fn add_to_linker(linker: &mut Linker) -> wasmtime::Result<()> where T: WasiCliView + 'static, { - let exit_options = exit::LinkOptions::default(); - add_to_linker_with_options(linker, &exit_options) -} - -/// Similar to [`add_to_linker`], but with the ability to enable unstable features. -pub fn add_to_linker_with_options( - linker: &mut Linker, - exit_options: &exit::LinkOptions, -) -> wasmtime::Result<()> -where - T: WasiCliView + 'static, -{ - exit::add_to_linker::<_, WasiCli>(linker, exit_options, T::cli)?; + exit::add_to_linker::<_, WasiCli>(linker, T::cli)?; environment::add_to_linker::<_, WasiCli>(linker, T::cli)?; stdin::add_to_linker::<_, WasiCli>(linker, T::cli)?; stdout::add_to_linker::<_, WasiCli>(linker, T::cli)?; diff --git a/crates/wasi/src/p3/mod.rs b/crates/wasi/src/p3/mod.rs index ecbb31a6e0cc..96df64a06724 100644 --- a/crates/wasi/src/p3/mod.rs +++ b/crates/wasi/src/p3/mod.rs @@ -178,12 +178,12 @@ where /// Similar to [`add_to_linker`], but with the ability to enable unstable features. pub fn add_to_linker_with_options( linker: &mut Linker, - options: &LinkOptions, + _options: &LinkOptions, ) -> wasmtime::Result<()> where T: WasiView + 'static, { - cli::add_to_linker_with_options(linker, &options.into())?; + cli::add_to_linker(linker)?; clocks::add_to_linker(linker)?; filesystem::add_to_linker(linker)?; random::add_to_linker(linker)?; diff --git a/crates/wasi/src/p3/wit/deps/cli.wit b/crates/wasi/src/p3/wit/deps/cli.wit index 8ba52c5cd594..7aae56c17ed7 100644 --- a/crates/wasi/src/p3/wit/deps/cli.wit +++ b/crates/wasi/src/p3/wit/deps/cli.wit @@ -1,6 +1,6 @@ -package wasi:cli@0.3.0-rc-2026-03-15; +package wasi:cli@0.3.0; -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface environment { /// Get the POSIX-style environment variables. /// @@ -10,23 +10,23 @@ interface environment { /// Morally, these are a value import, but until value imports are available /// in the component model, this import function should return the same /// values each time it is called. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-environment: func() -> list>; /// Get the POSIX-style arguments to the program. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-arguments: func() -> list; /// Return a path that programs should use as their initial current working /// directory, interpreting `.` as shorthand for this. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-initial-cwd: func() -> option; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface exit { /// Exit the current instance and any linked instances. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) exit: func(status: result); /// Exit the current instance and any linked instances, reporting the @@ -37,20 +37,20 @@ interface exit { /// /// This function does not return; the effect is analogous to a trap, but /// without the connotation that something bad has happened. - @unstable(feature = cli-exit-with-code) + @since(version = 0.3.0) exit-with-code: func(status-code: u8); } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface run { /// Run the program. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) run: async func() -> result; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum error-code { /// Input/output error io, @@ -61,7 +61,7 @@ interface types { } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stdin { use types.{error-code}; @@ -78,11 +78,11 @@ interface stdin { /// /// Multiple streams may be active at the same time. The behavior of concurrent /// reads is implementation-specific. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-via-stream: func() -> tuple, future>>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stdout { use types.{error-code}; @@ -94,11 +94,11 @@ interface stdout { /// /// Otherwise if there is an error the readable end of the stream will be /// dropped and this function will return an error-code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream) -> future>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface stderr { use types.{error-code}; @@ -110,7 +110,7 @@ interface stderr { /// /// Otherwise if there is an error the readable end of the stream will be /// dropped and this function will return an error-code. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream) -> future>; } @@ -119,10 +119,10 @@ interface stderr { /// In the future, this may include functions for disabling echoing, /// disabling input buffering so that keyboard events are sent through /// immediately, querying supported features, and so on. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-input { /// The input side of a terminal. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource terminal-input; } @@ -131,126 +131,126 @@ interface terminal-input { /// In the future, this may include functions for querying the terminal /// size, being notified of terminal size changes, querying supported /// features, and so on. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-output { /// The output side of a terminal. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource terminal-output; } /// An interface providing an optional `terminal-input` for stdin as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stdin { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-input.{terminal-input}; /// If stdin is connected to a terminal, return a `terminal-input` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stdin: func() -> option; } /// An interface providing an optional `terminal-output` for stdout as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stdout { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-output.{terminal-output}; /// If stdout is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stdout: func() -> option; } /// An interface providing an optional `terminal-output` for stderr as a /// link-time authority. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface terminal-stderr { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use terminal-output.{terminal-output}; /// If stderr is connected to a terminal, return a `terminal-output` handle /// allowing further interaction with it. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-terminal-stderr: func() -> option; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import environment; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import exit; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stderr; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-input; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-output; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stderr; - import wasi:clocks/types@0.3.0-rc-2026-03-15; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:filesystem/types@0.3.0-rc-2026-03-15; - import wasi:filesystem/preopens@0.3.0-rc-2026-03-15; - import wasi:sockets/types@0.3.0-rc-2026-03-15; - import wasi:sockets/ip-name-lookup@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:filesystem/types@0.3.0; + import wasi:filesystem/preopens@0.3.0; + import wasi:sockets/types@0.3.0; + import wasi:sockets/ip-name-lookup@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world command { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import environment; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import exit; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import stderr; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-input; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-output; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdin; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stdout; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import terminal-stderr; - import wasi:clocks/types@0.3.0-rc-2026-03-15; - import wasi:clocks/monotonic-clock@0.3.0-rc-2026-03-15; - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; + import wasi:clocks/types@0.3.0; + import wasi:clocks/monotonic-clock@0.3.0; + import wasi:clocks/system-clock@0.3.0; @unstable(feature = clocks-timezone) - import wasi:clocks/timezone@0.3.0-rc-2026-03-15; - import wasi:filesystem/types@0.3.0-rc-2026-03-15; - import wasi:filesystem/preopens@0.3.0-rc-2026-03-15; - import wasi:sockets/types@0.3.0-rc-2026-03-15; - import wasi:sockets/ip-name-lookup@0.3.0-rc-2026-03-15; - import wasi:random/random@0.3.0-rc-2026-03-15; - import wasi:random/insecure@0.3.0-rc-2026-03-15; - import wasi:random/insecure-seed@0.3.0-rc-2026-03-15; + import wasi:clocks/timezone@0.3.0; + import wasi:filesystem/types@0.3.0; + import wasi:filesystem/preopens@0.3.0; + import wasi:sockets/types@0.3.0; + import wasi:sockets/ip-name-lookup@0.3.0; + import wasi:random/random@0.3.0; + import wasi:random/insecure@0.3.0; + import wasi:random/insecure-seed@0.3.0; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) export run; } diff --git a/crates/wasi/src/p3/wit/deps/clocks.wit b/crates/wasi/src/p3/wit/deps/clocks.wit index 19fc4bcd59e9..d8b8cfe4e3a7 100644 --- a/crates/wasi/src/p3/wit/deps/clocks.wit +++ b/crates/wasi/src/p3/wit/deps/clocks.wit @@ -1,10 +1,10 @@ -package wasi:clocks@0.3.0-rc-2026-03-15; +package wasi:clocks@0.3.0; /// This interface common types used throughout wasi:clocks. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { /// A duration of time, in nanoseconds. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type duration = u64; } @@ -16,14 +16,14 @@ interface types { /// /// A monotonic clock is a clock which has an unspecified initial value, and /// successive reads of the clock will produce non-decreasing values. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface monotonic-clock { use types.{duration}; /// A mark on a monotonic clock is a number of nanoseconds since an /// unspecified initial value, and can only be compared to instances from /// the same monotonic-clock. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type mark = u64; /// Read the current value of the clock. @@ -35,20 +35,20 @@ interface monotonic-clock { /// the value of the clock in a `mark`. Consequently, implementations /// should ensure that the starting time is low enough to avoid the /// possibility of overflow in practice. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) now: func() -> mark; /// Query the resolution of the clock. Returns the duration of time /// corresponding to a clock tick. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-resolution: func() -> duration; /// Wait until the specified mark has occurred. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) wait-until: async func(when: mark); /// Wait for the specified duration to elapse. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) wait-for: async func(how-long: duration); } @@ -62,7 +62,7 @@ interface monotonic-clock { /// monotonic, making it unsuitable for measuring elapsed time. /// /// It is intended for reporting the current date and time for humans. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface system-clock { use types.{duration}; @@ -82,7 +82,7 @@ interface system-clock { /// /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record instant { seconds: s64, nanoseconds: u32, @@ -94,12 +94,12 @@ interface system-clock { /// will not necessarily produce a sequence of non-decreasing values. /// /// The nanoseconds field of the output is always less than 1000000000. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) now: func() -> instant; /// Query the resolution of the clock. Returns the smallest duration of time /// that the implementation permits distinguishing. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-resolution: func() -> duration; } @@ -148,13 +148,13 @@ interface timezone { to-debug-string: func() -> string; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import monotonic-clock; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import system-clock; @unstable(feature = clocks-timezone) import timezone; diff --git a/crates/wasi/src/p3/wit/deps/filesystem.wit b/crates/wasi/src/p3/wit/deps/filesystem.wit index 697681f30c5e..e4a778f3d237 100644 --- a/crates/wasi/src/p3/wit/deps/filesystem.wit +++ b/crates/wasi/src/p3/wit/deps/filesystem.wit @@ -1,4 +1,4 @@ -package wasi:filesystem@0.3.0-rc-2026-03-15; +package wasi:filesystem@0.3.0; /// WASI filesystem is a filesystem API primarily intended to let users run WASI /// programs that access their files on their existing filesystems, without @@ -35,19 +35,19 @@ package wasi:filesystem@0.3.0-rc-2026-03-15; /// store or a database instead. /// /// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) - use wasi:clocks/system-clock@0.3.0-rc-2026-03-15.{instant}; + @since(version = 0.3.0) + use wasi:clocks/system-clock@0.3.0.{instant}; /// File size or length of a region within a file. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type filesize = u64; /// The type of a filesystem object referenced by a descriptor. /// /// Note: This was called `filetype` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant descriptor-type { /// The descriptor refers to a block device inode. block-device, @@ -71,7 +71,7 @@ interface types { /// Descriptor flags. /// /// Note: This was called `fdflags` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags descriptor-flags { /// Read mode: Data can be read. read, @@ -113,7 +113,7 @@ interface types { } /// Flags determining the method of how paths are resolved. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags path-flags { /// As long as the resolved path corresponds to a symbolic link, it is /// expanded. @@ -121,7 +121,7 @@ interface types { } /// Open flags used by `open-at`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) flags open-flags { /// Create file if it does not exist, similar to `O_CREAT` in POSIX. create, @@ -134,13 +134,13 @@ interface types { } /// Number of hard links to an inode. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type link-count = u64; /// File attributes. /// /// Note: This was called `filestat` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record descriptor-stat { /// File type. %type: descriptor-type, @@ -167,7 +167,7 @@ interface types { } /// When setting a timestamp, this gives the value to set it to. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant new-timestamp { /// Leave the timestamp set to its previous value. no-change, @@ -179,7 +179,7 @@ interface types { } /// A directory entry. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record directory-entry { /// The type of the file referred to by this directory entry. %type: descriptor-type, @@ -191,7 +191,7 @@ interface types { /// Not all of these error codes are returned by the functions provided by this /// API; some are used in higher-level library layers, and others are provided /// merely for alignment with POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Permission denied, similar to `EACCES` in POSIX. access, @@ -272,7 +272,7 @@ interface types { } /// File or memory access pattern advisory information. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum advice { /// The application has no advice to give on its behavior with respect /// to the specified data. @@ -296,7 +296,7 @@ interface types { /// A 128-bit hash value, split into parts because wasm doesn't have a /// 128-bit integer type. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record metadata-hash-value { /// 64 bits of a 128-bit hash value. lower: u64, @@ -307,7 +307,7 @@ interface types { /// A descriptor is a reference to a filesystem object, which may be a file, /// directory, named pipe, special file, or other object on which filesystem /// calls may be made. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource descriptor { /// Return a stream for reading from a file. /// @@ -325,7 +325,7 @@ interface types { /// resolves to `err` with an `error-code`. /// /// Note: This is similar to `pread` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-via-stream: func(offset: filesize) -> tuple, future>>; /// Return a stream for writing to a file, if available. /// @@ -339,7 +339,7 @@ interface types { /// written or an error is encountered. /// /// Note: This is similar to `pwrite` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) write-via-stream: func(data: stream, offset: filesize) -> future>; /// Return a stream for appending to a file, if available. /// @@ -349,12 +349,12 @@ interface types { /// written or an error is encountered. /// /// Note: This is similar to `write` with `O_APPEND` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) append-via-stream: func(data: stream) -> future>; /// Provide file advisory information on a descriptor. /// /// This is similar to `posix_fadvise` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) advise: async func(offset: filesize, length: filesize, advice: advice) -> result<_, error-code>; /// Synchronize the data of a file to disk. /// @@ -362,7 +362,7 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fdatasync` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) sync-data: async func() -> result<_, error-code>; /// Get flags associated with a descriptor. /// @@ -370,7 +370,7 @@ interface types { /// /// Note: This returns the value that was the `fs_flags` value returned /// from `fdstat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-flags: async func() -> result; /// Get the dynamic type of a descriptor. /// @@ -382,20 +382,20 @@ interface types { /// /// Note: This returns the value that was the `fs_filetype` value returned /// from `fdstat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-type: async func() -> result; /// Adjust the size of an open file. If this increases the file's size, the /// extra bytes are filled with zeros. /// /// Note: This was called `fd_filestat_set_size` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-size: async func(size: filesize) -> result<_, error-code>; /// Adjust the timestamps of an open file or directory. /// /// Note: This is similar to `futimens` in POSIX. /// /// Note: This was called `fd_filestat_set_times` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-times: async func(data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; /// Read directory entries from a directory. /// @@ -409,7 +409,7 @@ interface types { /// /// This function returns a future, which will resolve to an error code if /// reading full contents of the directory fails. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) read-directory: func() -> tuple, future>>; /// Synchronize the data and metadata of a file to disk. /// @@ -417,12 +417,12 @@ interface types { /// opened for writing. /// /// Note: This is similar to `fsync` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) sync: async func() -> result<_, error-code>; /// Create a directory. /// /// Note: This is similar to `mkdirat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create-directory-at: async func(path: string) -> result<_, error-code>; /// Return the attributes of an open file or directory. /// @@ -433,7 +433,7 @@ interface types { /// modified, use `metadata-hash`. /// /// Note: This was called `fd_filestat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) stat: async func() -> result; /// Return the attributes of a file or directory. /// @@ -442,7 +442,7 @@ interface types { /// discussion of alternatives. /// /// Note: This was called `path_filestat_get` in earlier versions of WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) stat-at: async func(path-flags: path-flags, path: string) -> result; /// Adjust the timestamps of a file or directory. /// @@ -450,7 +450,7 @@ interface types { /// /// Note: This was called `path_filestat_set_times` in earlier versions of /// WASI. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-times-at: async func(path-flags: path-flags, path: string, data-access-timestamp: new-timestamp, data-modification-timestamp: new-timestamp) -> result<_, error-code>; /// Create a hard link. /// @@ -459,7 +459,7 @@ interface types { /// `error-code::not-permitted` if the old path is not a file. /// /// Note: This is similar to `linkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) link-at: async func(old-path-flags: path-flags, old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; /// Open a file or directory. /// @@ -473,7 +473,7 @@ interface types { /// `error-code::read-only`. /// /// Note: This is similar to `openat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) open-at: async func(path-flags: path-flags, path: string, open-flags: open-flags, %flags: descriptor-flags) -> result; /// Read the contents of a symbolic link. /// @@ -481,19 +481,19 @@ interface types { /// filesystem, this function fails with `error-code::not-permitted`. /// /// Note: This is similar to `readlinkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) readlink-at: async func(path: string) -> result; /// Remove a directory. /// /// Return `error-code::not-empty` if the directory is not empty. /// /// Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) remove-directory-at: async func(path: string) -> result<_, error-code>; /// Rename a filesystem object. /// /// Note: This is similar to `renameat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) rename-at: async func(old-path: string, new-descriptor: borrow, new-path: string) -> result<_, error-code>; /// Create a symbolic link (also known as a "symlink"). /// @@ -501,7 +501,7 @@ interface types { /// `error-code::not-permitted`. /// /// Note: This is similar to `symlinkat` in POSIX. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) symlink-at: async func(old-path: string, new-path: string) -> result<_, error-code>; /// Unlink a filesystem object that is not a directory. /// @@ -512,7 +512,7 @@ interface types { /// If the filesystem object is a directory, `error-code::access` or /// `error-code::is-directory` may be returned instead of the /// POSIX-specified `error-code::not-permitted`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) unlink-file-at: async func(path: string) -> result<_, error-code>; /// Test whether two descriptors refer to the same filesystem object. /// @@ -520,7 +520,7 @@ interface types { /// same device (`st_dev`) and inode (`st_ino` or `d_ino`) numbers. /// wasi-filesystem does not expose device and inode numbers, so this function /// may be used instead. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) is-same-object: async func(other: borrow) -> bool; /// Return a hash of the metadata associated with a filesystem object referred /// to by a descriptor. @@ -541,35 +541,35 @@ interface types { /// computed hash. /// /// However, none of these is required. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) metadata-hash: async func() -> result; /// Return a hash of the metadata associated with a filesystem object referred /// to by a directory descriptor and a relative path. /// /// This performs the same hash computation as `metadata-hash`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) metadata-hash-at: async func(path-flags: path-flags, path: string) -> result; } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface preopens { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use types.{descriptor}; /// Return the set of preopened directories, and their paths. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-directories: func() -> list>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/types@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/system-clock@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) + import wasi:clocks/types@0.3.0; + @since(version = 0.3.0) + import wasi:clocks/system-clock@0.3.0; + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import preopens; } diff --git a/crates/wasi/src/p3/wit/deps/random.wit b/crates/wasi/src/p3/wit/deps/random.wit index 026f44a10949..0b9a55fc09a6 100644 --- a/crates/wasi/src/p3/wit/deps/random.wit +++ b/crates/wasi/src/p3/wit/deps/random.wit @@ -1,10 +1,10 @@ -package wasi:random@0.3.0-rc-2026-03-15; +package wasi:random@0.3.0; /// The insecure-seed interface for seeding hash-map DoS resistance. /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface insecure-seed { /// Return a 128-bit value that may contain a pseudo-random value. /// @@ -23,7 +23,7 @@ interface insecure-seed { /// This will likely be changed to a value import, to prevent it from being /// called multiple times and potentially used for purposes other than DoS /// protection. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-seed: func() -> tuple; } @@ -31,7 +31,7 @@ interface insecure-seed { /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface insecure { /// Return up to `max-len` insecure pseudo-random bytes. /// @@ -48,14 +48,14 @@ interface insecure { /// Implementations MUST return at least 1 byte when `max-len` is greater /// than zero. When `max-len` is zero, implementations MUST return an empty /// list without trapping. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-random-bytes: func(max-len: u64) -> list; /// Return an insecure pseudo-random `u64` value. /// /// This function returns the same type of pseudo-random data as /// `get-insecure-random-bytes`, represented as a `u64`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-insecure-random-u64: func() -> u64; } @@ -63,7 +63,7 @@ interface insecure { /// /// It is intended to be portable at least between Unix-family platforms and /// Windows. -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface random { /// Return up to `max-len` cryptographically-secure random or pseudo-random /// bytes. @@ -85,23 +85,23 @@ interface random { /// This function must always return fresh data. Deterministic environments /// must omit this function, rather than implementing it with deterministic /// data. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-random-bytes: func(max-len: u64) -> list; /// Return a cryptographically-secure random or pseudo-random `u64` value. /// /// This function returns the same type of data as `get-random-bytes`, /// represented as a `u64`. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-random-u64: func() -> u64; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import random; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import insecure; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import insecure-seed; } diff --git a/crates/wasi/src/p3/wit/deps/sockets.wit b/crates/wasi/src/p3/wit/deps/sockets.wit index cde2e4d6ebe0..0dd27a4fc4b2 100644 --- a/crates/wasi/src/p3/wit/deps/sockets.wit +++ b/crates/wasi/src/p3/wit/deps/sockets.wit @@ -1,9 +1,9 @@ -package wasi:sockets@0.3.0-rc-2026-03-15; +package wasi:sockets@0.3.0; -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface types { - @since(version = 0.3.0-rc-2026-03-15) - use wasi:clocks/types@0.3.0-rc-2026-03-15.{duration}; + @since(version = 0.3.0) + use wasi:clocks/types@0.3.0.{duration}; /// Error codes. /// @@ -16,7 +16,7 @@ interface types { /// - `out-of-memory` /// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Access denied. /// @@ -80,7 +80,7 @@ interface types { other(option), } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) enum ip-address-family { /// Similar to `AF_INET` in POSIX. ipv4, @@ -88,19 +88,19 @@ interface types { ipv6, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type ipv4-address = tuple; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) type ipv6-address = tuple; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant ip-address { ipv4(ipv4-address), ipv6(ipv6-address), } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record ipv4-socket-address { /// sin_port port: u16, @@ -108,7 +108,7 @@ interface types { address: ipv4-address, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) record ipv6-socket-address { /// sin6_port port: u16, @@ -120,7 +120,7 @@ interface types { scope-id: u32, } - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant ip-socket-address { ipv4(ipv4-socket-address), ipv6(ipv6-socket-address), @@ -135,7 +135,7 @@ interface types { /// - `connecting` /// - `connected` /// - `closed` - /// See + /// See /// for more information. /// /// Note: Except where explicitly mentioned, whenever this documentation uses @@ -158,7 +158,7 @@ interface types { /// In addition to the general error codes documented on the /// `types::error-code` type, TCP socket methods may always return /// `error(invalid-state)` when in the `closed` state. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource tcp-socket { /// Create a new TCP socket. /// @@ -178,7 +178,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. /// @@ -213,7 +213,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Connect to a remote endpoint. /// @@ -249,7 +249,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) connect: async func(remote-address: ip-socket-address) -> result<_, error-code>; /// Start listening and return a stream of new inbound connections. /// @@ -321,7 +321,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) listen: func() -> result, error-code>; /// Transmit data to peer. /// @@ -345,7 +345,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) send: func(data: stream) -> future>; /// Read data from peer. /// @@ -374,7 +374,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) receive: func() -> tuple, future>>; /// Get the bound local address. /// @@ -393,7 +393,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-local-address: func() -> result; /// Get the remote address. /// @@ -405,19 +405,19 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-remote-address: func() -> result; /// Whether the socket is in the `listening` state. /// /// Equivalent to the SO_ACCEPTCONN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-is-listening: func() -> bool; /// Whether this is a IPv4 or IPv6 socket. /// /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-address-family: func() -> ip-address-family; /// Hints the desired listen queue size. Implementations are free to /// ignore this. @@ -430,7 +430,7 @@ interface types { /// - `not-supported`: (set) The platform does not support changing the backlog size after the initial listen. /// - `invalid-argument`: (set) The provided value was 0. /// - `invalid-state`: (set) The socket is in the `connecting` or `connected` state. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-listen-backlog-size: func(value: u64) -> result<_, error-code>; /// Enables or disables keepalive. /// @@ -442,9 +442,9 @@ interface types { /// false, but only come into effect when `keep-alive-enabled` is true. /// /// Equivalent to the SO_KEEPALIVE socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-enabled: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; /// Amount of time the connection has to be idle before TCP starts /// sending keepalive packets. @@ -458,9 +458,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-idle-time: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; /// The time between keepalive packets. /// @@ -473,9 +473,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-interval: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-interval: func(value: duration) -> result<_, error-code>; /// The maximum amount of keepalive packets TCP should send before /// aborting the connection. @@ -489,9 +489,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-keep-alive-count: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-keep-alive-count: func(value: u32) -> result<_, error-code>; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -499,9 +499,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-hop-limit: func(value: u8) -> result<_, error-code>; /// Kernel buffer space reserved for sending/receiving on this socket. /// Implementations usually treat this as a cap the buffer can grow to, @@ -524,18 +524,18 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } /// A UDP socket handle. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resource udp-socket { /// Create a new UDP socket. /// @@ -552,7 +552,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. /// @@ -573,7 +573,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Associate this socket with a specific peer address. /// @@ -611,7 +611,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) connect: func(remote-address: ip-socket-address) -> result<_, error-code>; /// Dissociate this socket from its peer address. /// @@ -628,7 +628,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) disconnect: func() -> result<_, error-code>; /// Send a message on the socket to a particular peer. /// @@ -672,7 +672,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) send: async func(data: list, remote-address: option) -> result<_, error-code>; /// Receive a message on the socket. /// @@ -697,7 +697,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) receive: async func() -> result, ip-socket-address>, error-code>; /// Get the current bound address. /// @@ -716,7 +716,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-local-address: func() -> result; /// Get the address the socket is currently "connected" to. /// @@ -728,14 +728,14 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-remote-address: func() -> result; /// Whether this is a IPv4 or IPv6 socket. /// /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-address-family: func() -> ip-address-family; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. /// @@ -743,9 +743,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-unicast-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; /// Kernel buffer space reserved for sending/receiving on this socket. /// Implementations usually treat this as a cap the buffer can grow to, @@ -760,24 +760,24 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) interface ip-name-lookup { - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) use types.{ip-address}; /// Lookup error codes. - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) variant error-code { /// Access denied. /// @@ -824,16 +824,16 @@ interface ip-name-lookup { /// - /// - /// - - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) resolve-addresses: async func(name: string) -> result, error-code>; } -@since(version = 0.3.0-rc-2026-03-15) +@since(version = 0.3.0) world imports { - @since(version = 0.3.0-rc-2026-03-15) - import wasi:clocks/types@0.3.0-rc-2026-03-15; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) + import wasi:clocks/types@0.3.0; + @since(version = 0.3.0) import types; - @since(version = 0.3.0-rc-2026-03-15) + @since(version = 0.3.0) import ip-name-lookup; } diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs index 685a6ae8d457..a1ded765b84d 100644 --- a/crates/wasmtime/src/config.rs +++ b/crates/wasmtime/src/config.rs @@ -2450,6 +2450,12 @@ impl Config { WasmFeatures::COMPONENT_MODEL, cfg!(feature = "component-model"), ); + features.set( + WasmFeatures::CM_ASYNC, + self.tunables + .concurrency_support + .unwrap_or(cfg!(feature = "component-model-async")), + ); // From the default set of proposals remove any that the current // compiler backend may panic on if the module contains them. diff --git a/crates/wasmtime/src/runtime/component/matching.rs b/crates/wasmtime/src/runtime/component/matching.rs index 47aeeabaf980..9c2dccf3bae4 100644 --- a/crates/wasmtime/src/runtime/component/matching.rs +++ b/crates/wasmtime/src/runtime/component/matching.rs @@ -205,7 +205,7 @@ impl<'a> InstanceType<'a> { match self.types[index] { TypeResourceTable::Concrete { ty, .. } => self .resources - .map(|t| t[ty]) + .and_then(|t| t.get(ty).copied()) .unwrap_or_else(|| ResourceType::uninstantiated(&self.types, ty)), TypeResourceTable::Abstract(ty) => ResourceType::abstract_(&self.types, ty), } diff --git a/src/common.rs b/src/common.rs index 204c7cd44d48..15c0bcea6b84 100644 --- a/src/common.rs +++ b/src/common.rs @@ -14,10 +14,7 @@ use wasmtime_wasi::WasiCtxBuilder; use wasmtime::component::Component; /// Whether or not WASIp3 is enabled by default. -/// -/// Currently this is disabled (the `&& false`), but that'll get removed in the -/// future. -pub const P3_DEFAULT: bool = cfg!(feature = "component-model-async") && false; +pub const P3_DEFAULT: bool = cfg!(feature = "component-model-async"); #[derive(Clone)] pub enum RunTarget { @@ -472,8 +469,7 @@ impl RunCommon { #[cfg(feature = "component-model-async")] if self.common.wasi.p3.unwrap_or(P3_DEFAULT) { - let mut p3_options = wasmtime_wasi::p3::bindings::LinkOptions::default(); - p3_options.cli_exit_with_code(self.common.wasi.cli_exit_with_code.unwrap_or(false)); + let p3_options = wasmtime_wasi::p3::bindings::LinkOptions::default(); wasmtime_wasi::p3::add_to_linker_with_options(linker, &p3_options) .context("failed to link `wasi:cli@0.3.x`")?; } diff --git a/tests/all/component_model/dynamic.rs b/tests/all/component_model/dynamic.rs index 95f6d6ba278f..e214410064d5 100644 --- a/tests/all/component_model/dynamic.rs +++ b/tests/all/component_model/dynamic.rs @@ -1238,6 +1238,82 @@ fn introspection() -> Result<()> { Ok(()) } +#[test] +fn substituted_component_type_with_exported_resource() -> Result<()> { + // Regression test: `Linker::substituted_component_type` builds a + // `types::Component` whose resource substitution map only covers *imported* + // resources, but is nonetheless `Some(..)`. Introspecting an exported + // function that references an *exported* (non-imported) resource used to + // panic with an index-out-of-bounds when resolving the resource type, + // because the resolver hard-indexed that partial map instead of falling + // back to treating the resource as uninstantiated (which is what + // `Component::component_type()` does via `resources: None`). + let engine = super::engine(); + + let component = Component::new( + &engine, + r#" + (component + (type $t' (resource (rep i32))) + (export $t "t" (type $t')) + + (core func $ctor (canon resource.new $t)) + (func (export "[constructor]t") (param "x" u32) (result (own $t)) + (canon lift (core func $ctor))) + + (core module $m + (func (export "f") (param i32)) + ) + (core instance $i (instantiate $m)) + (func (export "[method]t.use") (param "self" (borrow $t)) + (canon lift (core func $i "f"))) + ) + "#, + )?; + + let linker = Linker::<()>::new(&engine); + + // This must not panic, even though `t` is an exported resource that is + // absent from the linker's imported-resource substitution map. + let component_ty = linker.substituted_component_type(&component)?; + + let mut exports = component_ty.exports(linker.engine()); + + // The exported resource itself. + let (name, _t_ty) = exports.next().unwrap(); + assert_eq!(name, "t"); + + // `[constructor]t` returns `own`. + let (name, ctor_ty) = exports.next().unwrap(); + assert_eq!(name, "[constructor]t"); + let ComponentItem::ComponentFunc(ctor_ty) = ctor_ty.ty else { + panic!("`[constructor]t` export item of wrong type") + }; + assert_eq!(ctor_ty.params().len(), 1); + let mut ctor_results = ctor_ty.results(); + assert_eq!(ctor_results.len(), 1); + let types::Type::Own(_) = ctor_results.next().unwrap() else { + panic!("`[constructor]t` should return an `own` handle") + }; + + // `[method]t.use` takes `borrow`. + let (name, method_ty) = exports.next().unwrap(); + assert_eq!(name, "[method]t.use"); + let ComponentItem::ComponentFunc(method_ty) = method_ty.ty else { + panic!("`[method]t.use` export item of wrong type") + }; + let mut method_params = method_ty.params(); + assert_eq!(method_params.len(), 1); + let (name, param) = method_params.next().unwrap(); + assert_eq!(name, "self"); + let types::Type::Borrow(_) = param else { + panic!("`[method]t.use` should take a `borrow` handle") + }; + assert_eq!(method_ty.results().len(), 0); + + Ok(()) +} + #[test] fn flags_beyond_end() -> Result<()> { let engine = super::engine();