Skip to content

Commit

Permalink
Release Wasmtime 17.0.0 (#7800)
Browse files Browse the repository at this point in the history
* Release Wasmtime 17.0.0

[automatically-tag-and-release-this-commit]

* Change update of gcc on MinGW (#7760)

Try not passing `-y -u` to `pacman` to avoid full system updates.
Currently full system updates might update the `msys2-runtime` package
before actually updating the package we requested, meaning that this
might not actually update anything given an update. This is what's
currently happening on CI which is breaking due to an update of gcc not
actually updating gcc. I'm mostly reading the invocation in
rust-lang/rust CI and seeing that it doesn't pass `-y -u` and hopeing
that by copying that here things might work.

prtest:full

* use released WASI Preview 2 (version 0.2.0) wits (#7817)

* WASI: copy in the version 0.2.0 wits

* wasmtime's wits: use versions 0.2.0 of wasi packages

* bindgens and other fixed version strings: change 0.2.0-rc-etc to 0.2.0

* Enable the component model by default

This commit enables the component model by default in the embedding API
and the CLI. This means that an opt-in of `-W component-model` is no
longer required and additionally `.wasm_component_model(true)` is no
longer required. Note that this won't impact existing embeddings since
the component model feature doesn't do much less `wasmtime::component`
is used, and if that's being used this is probably good news for you.

* Add release notes for 17.0.0

* Fix non-component-model build

---------

Co-authored-by: Wasmtime Publish <wasmtime-publish@users.noreply.github.com>
Co-authored-by: Alex Crichton <alex@alexcrichton.com>
Co-authored-by: Pat Hickey <phickey@fastly.com>
  • Loading branch information
4 people authored Jan 25, 2024
1 parent b239c50 commit ab5a448
Show file tree
Hide file tree
Showing 60 changed files with 215 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ jobs:
if: matrix.target == 'x86_64-pc-windows-gnu'

# Update binutils if MinGW due to https://github.com/rust-lang/rust/issues/112368
- run: C:/msys64/usr/bin/pacman.exe -Syu --needed mingw-w64-x86_64-gcc --noconfirm
- run: C:/msys64/usr/bin/pacman.exe -S --needed mingw-w64-x86_64-gcc --noconfirm
if: matrix.target == 'x86_64-pc-windows-gnu'
- shell: pwsh
run: echo "C:\msys64\mingw64\bin" >> $Env:GITHUB_PATH
Expand Down
69 changes: 68 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,79 @@

## 17.0.0

Unreleased.
Released 2024-01-25

The major feature of this release is that the WASI support in Wasmtime is now
considered stable and flagged at an 0.2.0 version approved by the WASI subgroup.
The release was delayed a few days to hold off until the WASI subgroup voted to
approve the CLI and HTTP worlds and they're now on-by-default! Additionally the
component model is now enabled by default in Wasmtime, for example an opt-in
flag is no longer required on the CLI. Note that embeddings still must opt-in to
using the component model by using the `wasmtime::component` module.

### Added

* Cranelift optimizations have been added for "3-way comparisons", or `Ord::cmp`
in Rust or `<=>` in C++.
[#7636](https://github.com/bytecodealliance/wasmtime/pull/7636)
[#7702](https://github.com/bytecodealliance/wasmtime/pull/7702)

* Components now use Wasmtime's compilation cache used for core wasm modules by
default.
[#7649](https://github.com/bytecodealliance/wasmtime/pull/7649)

* The `Resource<T>` and `ResourceAny` types can now be converted between each
other.
[#7649](https://github.com/bytecodealliance/wasmtime/pull/7649)
[#7712](https://github.com/bytecodealliance/wasmtime/pull/7712)

### Changed

* Minor changes have been made to a number of WITs as they progressed to their
official 0.2.0 status.
[#7625](https://github.com/bytecodealliance/wasmtime/pull/7625)
[#7640](https://github.com/bytecodealliance/wasmtime/pull/7640)
[#7690](https://github.com/bytecodealliance/wasmtime/pull/7690)
[#7781](https://github.com/bytecodealliance/wasmtime/pull/7781)
[#7817](https://github.com/bytecodealliance/wasmtime/pull/7817)

* The component model is now enabled by default.
[#7821](https://github.com/bytecodealliance/wasmtime/pull/7821)

* The implementation of `memory.atomic.{wait,notify}` has been rewritten.
[#7629](https://github.com/bytecodealliance/wasmtime/pull/7629)

* The `wasmtime_wasi::preview2::Table` type has been moved to
`wasmtime::component::ResourceTable`.
[#7655](https://github.com/bytecodealliance/wasmtime/pull/7655)

* Creating a UDP stream now validates the address being sent to.
[#7648](https://github.com/bytecodealliance/wasmtime/pull/7648)

* Defining resource types in `Linker<T>` now takes the type to define as a
runtime parameter.
[#7680](https://github.com/bytecodealliance/wasmtime/pull/7680)

* Socket address checks can now be performed dynamically at runtime.
[#7662](https://github.com/bytecodealliance/wasmtime/pull/7662)

* Wasmtime and Cranelift's MSRV is now 1.73.0.
[#7739](https://github.com/bytecodealliance/wasmtime/pull/7739)

### Fixed

* Bindings for WIT APIs where interfaces have multiple versions are now fixed by
putting the version in the generated binding names.
[#7656](https://github.com/bytecodealliance/wasmtime/pull/7656)

* The preview1 `fd_{read,write}` APIs are now fixed when a shared memory is
used.
[#7755](https://github.com/bytecodealliance/wasmtime/pull/7755)

* The preview1 `fd_{read,write}` APIs no longer leak an intermediate stream
created.
[#7819](https://github.com/bytecodealliance/wasmtime/pull/7819)

--------------------------------------------------------------------------------

## 16.0.0
Expand Down
6 changes: 3 additions & 3 deletions crates/wasi-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ pub mod bindings {
wasmtime::component::bindgen!({
path: "wit",
interfaces: "
import wasi:http/incoming-handler@0.2.0-rc-2024-01-16;
import wasi:http/outgoing-handler@0.2.0-rc-2024-01-16;
import wasi:http/types@0.2.0-rc-2024-01-16;
import wasi:http/incoming-handler@0.2.0;
import wasi:http/outgoing-handler@0.2.0;
import wasi:http/types@0.2.0;
",
tracing: true,
async: false,
Expand Down
4 changes: 2 additions & 2 deletions crates/wasi-http/wit/command-extended.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// All of the same imports and exports available in the wasi:cli/command world
// with addition of HTTP proxy related imports:
world command-extended {
include wasi:cli/command@0.2.0-rc-2024-01-16;
import wasi:http/outgoing-handler@0.2.0-rc-2024-01-16;
include wasi:cli/command@0.2.0;
import wasi:http/outgoing-handler@0.2.0;
}
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/cli/command.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:cli@0.2.0-rc-2024-01-16;
package wasi:cli@0.2.0;

world command {
include imports;
Expand Down
12 changes: 6 additions & 6 deletions crates/wasi-http/wit/deps/cli/imports.wit
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package wasi:cli@0.2.0-rc-2024-01-16;
package wasi:cli@0.2.0;

world imports {
include wasi:clocks/imports@0.2.0-rc-2023-11-10;
include wasi:filesystem/imports@0.2.0-rc-2023-11-10;
include wasi:sockets/imports@0.2.0-rc-2024-01-16;
include wasi:random/imports@0.2.0-rc-2023-11-10;
include wasi:io/imports@0.2.0-rc-2023-11-10;
include wasi:clocks/imports@0.2.0;
include wasi:filesystem/imports@0.2.0;
include wasi:sockets/imports@0.2.0;
include wasi:random/imports@0.2.0;
include wasi:io/imports@0.2.0;

import environment;
import exit;
Expand Down
6 changes: 3 additions & 3 deletions crates/wasi-http/wit/deps/cli/stdio.wit
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
interface stdin {
use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream};
use wasi:io/streams@0.2.0.{input-stream};

get-stdin: func() -> input-stream;
}

interface stdout {
use wasi:io/streams@0.2.0-rc-2023-11-10.{output-stream};
use wasi:io/streams@0.2.0.{output-stream};

get-stdout: func() -> output-stream;
}

interface stderr {
use wasi:io/streams@0.2.0-rc-2023-11-10.{output-stream};
use wasi:io/streams@0.2.0.{output-stream};

get-stderr: func() -> output-stream;
}
4 changes: 2 additions & 2 deletions crates/wasi-http/wit/deps/clocks/monotonic-clock.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.0-rc-2023-11-10;
package wasi:clocks@0.2.0;
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
/// time.
///
Expand All @@ -10,7 +10,7 @@ package wasi:clocks@0.2.0-rc-2023-11-10;
///
/// It is intended for measuring elapsed time.
interface monotonic-clock {
use wasi:io/poll@0.2.0-rc-2023-11-10.{pollable};
use wasi:io/poll@0.2.0.{pollable};

/// An instant in time, in nanoseconds. An instant is relative to an
/// unspecified initial value, and can only be compared to instances from
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/clocks/wall-clock.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.0-rc-2023-11-10;
package wasi:clocks@0.2.0;
/// WASI Wall Clock is a clock API intended to let users query the current
/// time. The name "wall" makes an analogy to a "clock on the wall", which
/// is not necessarily monotonic as it may be reset.
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/clocks/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.0-rc-2023-11-10;
package wasi:clocks@0.2.0;

world imports {
import monotonic-clock;
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/filesystem/preopens.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:filesystem@0.2.0-rc-2023-11-10;
package wasi:filesystem@0.2.0;

interface preopens {
use types.{descriptor};
Expand Down
6 changes: 3 additions & 3 deletions crates/wasi-http/wit/deps/filesystem/types.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:filesystem@0.2.0-rc-2023-11-10;
package wasi:filesystem@0.2.0;
/// WASI filesystem is a filesystem API primarily intended to let users run WASI
/// programs that access their files on their existing filesystems, without
/// significant overhead.
Expand All @@ -24,8 +24,8 @@ package wasi:filesystem@0.2.0-rc-2023-11-10;
///
/// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md
interface types {
use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream, output-stream, error};
use wasi:clocks/wall-clock@0.2.0-rc-2023-11-10.{datetime};
use wasi:io/streams@0.2.0.{input-stream, output-stream, error};
use wasi:clocks/wall-clock@0.2.0.{datetime};

/// File size or length of a region within a file.
type filesize = u64;
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/filesystem/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:filesystem@0.2.0-rc-2023-11-10;
package wasi:filesystem@0.2.0;

world imports {
import types;
Expand Down
12 changes: 6 additions & 6 deletions crates/wasi-http/wit/deps/http/proxy.wit
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package wasi:http@0.2.0-rc-2024-01-16;
package wasi:http@0.2.0;

/// The `wasi:http/proxy` world captures a widely-implementable intersection of
/// hosts that includes HTTP forward and reverse proxies. Components targeting
/// this world may concurrently stream in and out any number of incoming and
/// outgoing HTTP requests.
world proxy {
/// HTTP proxies have access to time and randomness.
include wasi:clocks/imports@0.2.0-rc-2023-11-10;
import wasi:random/random@0.2.0-rc-2023-11-10;
include wasi:clocks/imports@0.2.0;
import wasi:random/random@0.2.0;

/// Proxies have standard output and error streams which are expected to
/// terminate in a developer-facing console provided by the host.
import wasi:cli/stdout@0.2.0-rc-2024-01-16;
import wasi:cli/stderr@0.2.0-rc-2024-01-16;
import wasi:cli/stdout@0.2.0;
import wasi:cli/stderr@0.2.0;

/// TODO: this is a temporary workaround until component tooling is able to
/// gracefully handle the absence of stdin. Hosts must return an eof stream
/// for this import, which is what wasi-libc + tooling will do automatically
/// when this import is properly removed.
import wasi:cli/stdin@0.2.0-rc-2024-01-16;
import wasi:cli/stdin@0.2.0;

/// This is the default handler to use when user code simply wants to make an
/// HTTP request (e.g., via `fetch()`).
Expand Down
8 changes: 4 additions & 4 deletions crates/wasi-http/wit/deps/http/types.wit
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/// HTTP Requests and Responses, both incoming and outgoing, as well as
/// their headers, trailers, and bodies.
interface types {
use wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-10.{duration};
use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream, output-stream};
use wasi:io/error@0.2.0-rc-2023-11-10.{error as io-error};
use wasi:io/poll@0.2.0-rc-2023-11-10.{pollable};
use wasi:clocks/monotonic-clock@0.2.0.{duration};
use wasi:io/streams@0.2.0.{input-stream, output-stream};
use wasi:io/error@0.2.0.{error as io-error};
use wasi:io/poll@0.2.0.{pollable};

/// This type corresponds to HTTP standard Methods.
variant method {
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/io/error.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.0-rc-2023-11-10;
package wasi:io@0.2.0;


interface error {
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/io/poll.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.0-rc-2023-11-10;
package wasi:io@0.2.0;

/// A poll API intended to let users wait for I/O events on multiple handles
/// at once.
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/io/streams.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.0-rc-2023-11-10;
package wasi:io@0.2.0;

/// WASI I/O is an I/O abstraction API which is currently focused on providing
/// stream types.
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/io/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.0-rc-2023-11-10;
package wasi:io@0.2.0;

world imports {
import streams;
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/random/insecure-seed.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:random@0.2.0-rc-2023-11-10;
package wasi:random@0.2.0;
/// The insecure-seed interface for seeding hash-map DoS resistance.
///
/// It is intended to be portable at least between Unix-family platforms and
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/random/insecure.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:random@0.2.0-rc-2023-11-10;
package wasi:random@0.2.0;
/// The insecure interface for insecure pseudo-random numbers.
///
/// It is intended to be portable at least between Unix-family platforms and
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/random/random.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:random@0.2.0-rc-2023-11-10;
package wasi:random@0.2.0;
/// WASI Random is a random data API.
///
/// It is intended to be portable at least between Unix-family platforms and
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/random/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:random@0.2.0-rc-2023-11-10;
package wasi:random@0.2.0;

world imports {
import random;
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/sockets/ip-name-lookup.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

interface ip-name-lookup {
use wasi:io/poll@0.2.0-rc-2023-11-10.{pollable};
use wasi:io/poll@0.2.0.{pollable};
use network.{network, error-code, ip-address};


Expand Down
6 changes: 3 additions & 3 deletions crates/wasi-http/wit/deps/sockets/tcp.wit
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

interface tcp {
use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream, output-stream};
use wasi:io/poll@0.2.0-rc-2023-11-10.{pollable};
use wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-10.{duration};
use wasi:io/streams@0.2.0.{input-stream, output-stream};
use wasi:io/poll@0.2.0.{pollable};
use wasi:clocks/monotonic-clock@0.2.0.{duration};
use network.{network, error-code, ip-socket-address, ip-address-family};

enum shutdown-type {
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/sockets/udp.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

interface udp {
use wasi:io/poll@0.2.0-rc-2023-11-10.{pollable};
use wasi:io/poll@0.2.0.{pollable};
use network.{network, error-code, ip-socket-address, ip-address-family};

/// A received datagram.
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-http/wit/deps/sockets/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:sockets@0.2.0-rc-2024-01-16;
package wasi:sockets@0.2.0;

world imports {
import instance-network;
Expand Down
12 changes: 6 additions & 6 deletions crates/wasi-http/wit/test.wit
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ package wasmtime:wasi;

// only used as part of `test-programs`
world test-reactor {
include wasi:cli/imports@0.2.0-rc-2024-01-16;
include wasi:cli/imports@0.2.0;

export add-strings: func(s: list<string>) -> u32;
export get-strings: func() -> list<string>;

use wasi:io/streams@0.2.0-rc-2023-11-10.{output-stream};
use wasi:io/streams@0.2.0.{output-stream};

export write-strings-to: func(o: output-stream) -> result;

use wasi:filesystem/types@0.2.0-rc-2023-11-10.{descriptor-stat};
use wasi:filesystem/types@0.2.0.{descriptor-stat};
export pass-an-imported-record: func(d: descriptor-stat) -> string;
}

world test-command {
include wasi:cli/imports@0.2.0-rc-2024-01-16;
import wasi:http/types@0.2.0-rc-2024-01-16;
import wasi:http/outgoing-handler@0.2.0-rc-2024-01-16;
include wasi:cli/imports@0.2.0;
import wasi:http/types@0.2.0;
import wasi:http/outgoing-handler@0.2.0;
}
2 changes: 1 addition & 1 deletion crates/wasi-preview1-component-adapter/src/descriptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl Descriptors {

#[cfg(not(feature = "proxy"))]
fn open_preopens(&self, import_alloc: &ImportAlloc, arena: &BumpArena) {
#[link(wasm_import_module = "wasi:filesystem/preopens@0.2.0-rc-2023-11-10")]
#[link(wasm_import_module = "wasi:filesystem/preopens@0.2.0")]
#[allow(improper_ctypes)] // FIXME(bytecodealliance/wit-bindgen#684)
extern "C" {
#[link_name = "get-directories"]
Expand Down
Loading

0 comments on commit ab5a448

Please sign in to comment.