-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Always fall back to custom platform for Wasmtime This commit updates Wasmtime's platform support to no longer require an opt-in `RUSTFLAGS` `--cfg` flag to be specified. With `no_std` becoming officially supported this should provide a better onboarding experience where the fallback custom platform is used. This will cause linker errors if the symbols aren't implemented and searching/googling should lead back to our docs/repo (eventually, hopefully). * Change Wasmtime's TLS state to a single pointer This commit updates the management of TLS to rely on just a single pointer rather than a pair of a pointer and a `bool`. Additionally management of the TLS state is pushed into platform-specific modules to enable different means of managing it, namely the "custom" platform now has a C function required to implement TLS state for Wasmtime. * Delay conversion to `Instant` in atomic intrinsics The `Duration` type is available in `no_std` but the `Instant` type is not. The intention is to only support the `threads` proposal if `std` is active but to assist with this split push the `Duration` further into Wasmtime to avoid using a type that can't be mentioned in `no_std`. * Gate more parts of Wasmtime on the `profiling` feature Move `serde_json` to an optional dependency and gate the guest profiler entirely on the `profiling` feature. * Refactor conversion to `anyhow::Error` in `wasmtime-environ` Have a dedicated trait for consuming `self` in addition to a `Result`-friendly trait. * Gate `gimli` in Wasmtime on `addr2line` Cut down the dependency list if `addr2line` isn't enabled since then the dependency is not used. While here additionally lift the version requirement for `addr2line` up to the workspace level. * Update `bindgen!` to have `no_std`-compatible output Pull most types from Wasmtime's `__internal` module as the source of truth. * Use an `Option` for `gc_store` instead of `OnceCell` No need for synchronization here when mutability is already available in the necessary contexts. * Enable embedder-defined host feature detection * Add `#![no_std]` support to the `wasmtime` crate This commit enables compiling the `runtime`, `gc`, and `component-model` features of the `wasmtime` crate on targets that do not have `std`. This tags the crate as `#![no_std]` and then updates everything internally to import from `core` or `alloc` and adapt for the various idioms. This ended up requiring some relatively extensive changes, but nothing too too bad in the grand scheme of things. * Require `std` for the perfmap profiling agent prtest:full * Fix build on wasm * Fix windows build * Remove unused import * Fix Windows/Unix build without `std` feature * Fix some doc links * Remove unused import * Fix build of wasi-common in isolation * Fix no_std build on macos * Re-fix build * Fix standalone build of wasmtime-cli-flags * Resolve a merge conflict * Review comments * Remove unused import
- Loading branch information
1 parent
fd50e79
commit 81a8916
Showing
147 changed files
with
1,765 additions
and
919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ serde_json = { workspace = true } | |
|
||
[features] | ||
async = [] | ||
std = ['wasmtime-wit-bindgen/std'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// The output of `bindgen!` should be compatible with `no_std` by default, so | ||
// test that here with a no_std crate. | ||
|
||
#![no_std] | ||
|
||
extern crate std; | ||
|
||
macro_rules! gentest { | ||
($id:ident $name:tt $path:tt) => { | ||
mod $id { | ||
wasmtime::component::bindgen!(in $path); | ||
} | ||
}; | ||
} | ||
|
||
component_macro_test_helpers::foreach!(gentest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.