8 Commits

Author SHA1 Message Date
Pat Hickey 1c335c1b29 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
2024-01-25 17:43:57 +00:00
Pat Hickey 10ab511126 wasi implementations: use rc-2024-01-16 for sockets, cli, http (#7781)
* wasi: pull in contents of wasi-sockets, wasi-http, and wasi-cli 0.2.0-rc-2024-01-16

* command-extended and test worlds: use rc-2024-01-16

* sockets implementation: v6only is now mandatory

* adapter: cli imports and exports are from rc-2024-01-16 now

* eliminate ipv6-only methods and tests

* a v6_client.blocking_connect(net, v4_listener) will always fail
  with INVAL right away.
* eliminate the paths where a v6 client is allowed to connect to v4.
* eliminate the udp_dual_stack_conversation from udp_sample_application

* component-basic: update wasi:cli version

* wasi-http: sync wit directory

* wasi-http: fix import version

* code review from dave

* test both ipv4 address on v6 socket, and ipv6-mapped-ipv4 on v6 socket, both fail
2024-01-16 23:55:05 +00:00
Pat Hickey 08d101becb use wasi-http and wasi-cli 0.2.0-rc-2023-12-05 (#7640)
* wasi-cli: update to version 0.2.0-rc-2023-12-05

* wasi-http: update to 0.2.0-rc-2023-12-05

* fix versions in extra (non-wasi) wits

* component adapter: fixes to use cli/imports world, correct versions

* wasmtime-wasi: cli/reactor is now cli/imports

* sync wasi-http/wit with wasi/wit

* fix cli-test component-basic.wat version
2023-12-06 18:57:22 +00:00
Pat Hickey 6aaf682894 WASI wits: use 0.2.0-rc-2023-11-10 (#7533)
* wit deps: use 0.2.0-rc-2023-11-10 from WebAssembly/wasi-* repos

* local wits: depend on rc-2023-11-10

* wit-bindgen invocation: use rc-2023-11-10

* wasi-http wit subdir: sync with wasi

* wasi-http wit-bindgen: update for 11-10 rc

* wasi-preview1-component-adapter: imports are from 11-10 rc

* cli test component-basic: use wasi rc 11-10
2023-11-14 01:46:59 +00:00
Alex Crichton 11b600192d Update WASI versions to 0.2.0-rc-2023-11-05 (#7302)
* Update WASI versions to `0.2.0-rc-2023-11-05`

This commit updates the version numbers on `main` to no longer clash
with the 14.0.0 release after #7299. The version number is chosen as the
branch point for the 15.0.0 release of Wasmtime, at which point we'll
update the versions again.

* Update another version
2023-10-19 23:15:59 +00:00
Alex Crichton 4258dd9a84 Put versions in all WASI WIT files (#7272)
* Put versions in all WASI WIT files

This commit starts exercising the versioning feature of WIT by ensuring
that all WASI descriptions have a version associated with them. The
version chosen is 0.2.0 which reflects the upcoming "preview 2" release
where in theory 0.1.0 was claimed by preview1. This is intended to stay
as 0.2.0 for now and we'll determine how best to update these numbers in
the future once preview2 is released.

Closes #7171

* Allow omitting versions in `with` keys

As a convenience for now this enables omitting the version of an
interface from a `with` key. This has a risk of not working well if two
packages are present and one has a version and one doesn't, but that's
left as a PR to fix in the future as the benefit of avoiding repetition
seems good for now.

* Allow omitting versions in trappable_error_types

* Use 0.2.0-rc-2023-10-18 as a version number

* More test fixes

* Fix another test
2023-10-18 21:48:12 +00:00
Alex Crichton 1155d10e4d Use generated bindings to run components in the CLI (#6869)
* Use generated bindings to run components in the CLI

This commit updates the component support in the `wasmtime` CLI
from #6836 to use the generated bindings for the "command" style of
components rather than having that custom-written in the CLI.

* Fix tests
2023-08-21 16:12:21 +00:00
Alex Crichton 367bdc8c66 Refactor Wasmtime CLI to support components (#6836)
This commit refactors the `wasmtime` CLI executable to be able to
support not only compiling components but additionally executing
components. While I was doing this I've additionally added a new
`--preview2` argument to enable using the new experimental
implementation of preview1 based on preview2 type/structs. This is
off-by-default but is expected to become the default in the future.

Some notable features of this change are:

* The preview1-implemented-with-preview2 module now sports
  `add_to_linker_{async,sync}` to replace the previous `add_to_linker`
  which always did async.

* Some trait bounds in the preview1-implemented-with-preview2 module are
  simplified.

* Some minor changes were made to `wiggle`'s macros to support a "block
  on" that isn't the default wiggle dummy executor (as now we actually
  do need Tokio)

* Many options related to core wasm `Linker` configuration, such as
  `--default-values-unknown-imports`, are not implemented for components
  at this time. When used with components these options return an error.

* Construction of WASI contexts has been refactored to pass around fewer
  arguments to avoid threading through lots of values for both preview1
  and preview2.

* Reading the input to the Wasmtime CLI has been updated to read the
  input in the `run` subcommand before handing it off to the `wasmtime`
  crate's API to enable the CLI to use the contents of what's loaded to
  determine what to do next.

* Our generic `./ci/run-tests.sh` script has been updated to pass the
  `--features component-model` flag to ensure that this CLI support is
  tested during the normal test suite.

* The CLI support for `wasi-nn` supports components as well as core wasm
  modules.
2023-08-19 00:15:01 +00:00