commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
22ed2a6ac53066a1ae6fd7402fc3e7a18ddef37c | Pat Hickey | 2023-04-29T02:09:25 | and now views work for wasi-common as well | diff --git a/host/Cargo.toml b/host/Cargo.toml
index 7cd16ed11..1b35af94f 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -9,6 +9,8 @@ cap-std = { workspace = true }
wasmtime = { workspace = true }
wasi-common = { workspace = true }
wasi-cap-std-sync = { workspace = true }
+wasmtime-wasi-sockets = { workspace ... | 17 | 172 | 151 |
8b760951561ec40dc02d2b9e326bd84d63735e3e | Pat Hickey | 2023-04-29T00:57:27 | move context construction duties from wasi-cap-std-sync to wasmtime-wasi-sockets-sync | diff --git a/wasi-common/cap-std-sync/src/lib.rs b/wasi-common/cap-std-sync/src/lib.rs
index 0069bcabd..6842cf9eb 100644
--- a/wasi-common/cap-std-sync/src/lib.rs
+++ b/wasi-common/cap-std-sync/src/lib.rs
@@ -35,65 +35,53 @@
pub mod clocks;
pub mod dir;
pub mod file;
-pub mod net;
pub mod sched;
pub mod stdio;
... | 2 | 20 | 68 |
f443a3fe913e8c553a310d31d25d1f0bfd98d81c | Pat Hickey | 2023-04-29T00:47:02 | wasi-sockets: moved net impl from cap-std-sync there and it builds | diff --git a/wasi-common/cap-std-sync/src/net.rs b/wasi-common/cap-std-sync/src/net.rs
deleted file mode 100644
index fc427391b..000000000
--- a/wasi-common/cap-std-sync/src/net.rs
+++ /dev/null
@@ -1,453 +0,0 @@
-use cap_net_ext::{AddressFamily, Blocking, PoolExt, TcpListenerExt, UdpSocketExt};
-use cap_std::net::{Poo... | 1 | 0 | 453 |
3621386ff2756daeece86aabbe039d33a0d3468b | Pat Hickey | 2023-04-29T00:36:30 | wasi-sockets: crate builds | diff --git a/wasi-common/Cargo.toml b/wasi-common/Cargo.toml
index c80b56c51..dd4384dc1 100644
--- a/wasi-common/Cargo.toml
+++ b/wasi-common/Cargo.toml
@@ -19,11 +19,9 @@ tracing = { workspace = true }
cap-std = { workspace = true }
cap-rand = { workspace = true }
cap-fs-ext = { workspace = true }
-cap-net-ext = { ... | 1 | 0 | 2 |
9baf5d4c73f3042d7f27bdc7761dc10258e9176a | Pat Hickey | 2023-04-29T00:14:55 | wasi-common: remove all sockets from ctx and scheduler
in the scheduler code, it is only commented out. we need to really
redesign that whole deal if we are going to support pollables in other
crates. that is too ambitious for this first PR. | diff --git a/wasi-common/src/ctx.rs b/wasi-common/src/ctx.rs
index b4a71b732..f198a3ce4 100644
--- a/wasi-common/src/ctx.rs
+++ b/wasi-common/src/ctx.rs
@@ -1,15 +1,9 @@
use crate::clocks::WasiClocks;
use crate::dir::WasiDir;
-use crate::network::WasiNetwork;
use crate::sched::WasiSched;
use crate::stream::{InputSt... | 8 | 17 | 120 |
493aa23d67de281d729c63440e1aa5b56b982be1 | Pat Hickey | 2023-04-29T00:14:08 | move existing wasi-common sockets proposal interfaces to wasmtime-wasi-sockets | diff --git a/wasi-common/src/network.rs b/wasi-common/src/network.rs
deleted file mode 100644
index 3670265c4..000000000
--- a/wasi-common/src/network.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-//! IP Networks.
-
-use crate::Error;
-use std::any::Any;
-
-/// An IP network.
-#[async_trait::async_trait]
-pub trait WasiNetwork: S... | 7 | 0 | 767 |
0d5708835ef7c4c3519f246a644ccae01af0020c | Alex Crichton | 2023-05-02T20:13:27 | Turn down default instantiate timeout to 100ms (#6330)
The previous timeout was 20 seconds which while it won't ever time out
on OSS-Fuzz a wasm module is highly unlikely to do anything interesting
past the first bit as if it takes longer it's probably an uninteresting
infinite loop. Additionally this should improve l... | diff --git a/crates/fuzzing/src/generators/config.rs b/crates/fuzzing/src/generators/config.rs
index d564cabbd..4c7f1a691 100644
--- a/crates/fuzzing/src/generators/config.rs
+++ b/crates/fuzzing/src/generators/config.rs
@@ -267,7 +267,7 @@ impl Config {
/// Generates an arbitrary method of timing out an instance,... | 2 | 7 | 4 |
1cbca5a5c46f24f091e5aa6b994e5b399ad61c69 | Saúl Cabrera | 2023-05-02T19:48:56 | winch: Handle relocations and traps (#6298)
* winch: Handle relocations and traps
This change introduces handling of traps and relocations in Winch, which
was left out in https://github.com/bytecodealliance/wasmtime/pull/6119.
In order to so, this change moves the `CompiledFunction` struct to the
`wasmtime-cranelift... | diff --git a/crates/cranelift-shared/src/compiled_function.rs b/crates/cranelift-shared/src/compiled_function.rs
new file mode 100644
index 000000000..d9501c4da
--- /dev/null
+++ b/crates/cranelift-shared/src/compiled_function.rs
@@ -0,0 +1,224 @@
+use crate::{mach_reloc_to_reloc, mach_trap_to_trap, Relocation};
+use c... | 14 | 437 | 366 |
42f8ab14932069e4f7225565a36abc2b6d6ea1ec | Alex Crichton | 2023-05-02T19:24:03 | Improve longevity for fuzzing corpus of wasm modules (#6322)
* Improve longevity for fuzzing corpus of wasm modules
This commit is an improvement to the longevity of Wasmtime's corpus of
fuzz inputs to the `instantiate` fuzzer. Currently the input to this
fuzzers is arbitrary binary data which is a "DNA" of sorts of ... | diff --git a/Cargo.toml b/Cargo.toml
index af55b046f..1f2069b5f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -207,6 +207,7 @@ toml = "0.5.9"
serde = "1.0.94"
serde_json = "1.0.80"
glob = "0.3.0"
+libfuzzer-sys = "0.4.0"
[features]
default = [
diff --git a/cranelift/isle/fuzz/Cargo.toml b/cranelift/isle/fuzz/Cargo... | 7 | 374 | 26 |
a7b58c41cb89f601030033c3c75a19ec0f85b1fc | Alex Crichton | 2023-05-02T00:43:01 | Split out platform-specific logic for `Mmap` (#6318)
* Split out platform-specific logic for `Mmap`
This commit refactors the implementation of the `wasmtime_runtime::Mmap`
structure to have the platform-specific bits separated by file rather
than interspersed throughout `mmap.rs`. I plan in the near future to add
a ... | diff --git a/crates/runtime/src/cow.rs b/crates/runtime/src/cow.rs
index dc87a2c27..6bced64b6 100644
--- a/crates/runtime/src/cow.rs
+++ b/crates/runtime/src/cow.rs
@@ -899,14 +899,14 @@ mod test {
assert!(memfd.is_dirty());
// We should be able to access this 64 KiB (try both ends) and
// it... | 7 | 494 | 413 |
be6f4a5330c087586a36cd4e21ae993906ce0508 | Trevor Elliott | 2023-05-01T22:06:00 | Add an `--emit-clif` option to `wasmtime compile` (#6307)
* Add a `--emit-clif` option to `wasmtime compile`
* Better validation for the --emit-clif argument
* Better docstring for --emit-clif
Co-authored-by: Rainy Sinclair <844493+itsrainy@users.noreply.github.com>
* Fix doc build error
---------
Co-authored-by... | diff --git a/crates/cranelift/src/builder.rs b/crates/cranelift/src/builder.rs
index 1e32eed6f..5fcf8e05f 100644
--- a/crates/cranelift/src/builder.rs
+++ b/crates/cranelift/src/builder.rs
@@ -9,6 +9,7 @@ use cranelift_codegen::{
CodegenResult,
};
use std::fmt;
+use std::path;
use std::sync::Arc;
use wasmtime_... | 5 | 63 | 2 |
d5d2e854f97daa3acc6820299231e73cbb0b246c | Alex Crichton | 2023-05-01T18:08:51 | Fix mutability warnings on Nightly rust (#6316)
Looks like some warnings have improved so remove some unused `mut`
annotations. | diff --git a/cranelift/codegen/src/machinst/buffer.rs b/cranelift/codegen/src/machinst/buffer.rs
index bbb03dabd..72ac3ab94 100644
--- a/cranelift/codegen/src/machinst/buffer.rs
+++ b/cranelift/codegen/src/machinst/buffer.rs
@@ -695,7 +695,7 @@ impl<I: VCodeInst> MachBuffer<I> {
// (end of buffer)
... | 3 | 4 | 4 |
b1d63f01a5cb6b547ab1e4fbe50cc32ca10819ee | Alex Crichton | 2023-05-01T15:44:12 | Update test case generation for component_api fuzzer (#6315)
This commit updates the test case generation for the `component_api`
fuzzer to prepare for an update to the `arbitrary` crate. The current
algorithm, with the latest `arbitrary` crate, generates a 20MB source
file which is a bit egregious. The goal here was ... | diff --git a/crates/fuzzing/src/generators/component_types.rs b/crates/fuzzing/src/generators/component_types.rs
index 4c99ee3f9..879f59f29 100644
--- a/crates/fuzzing/src/generators/component_types.rs
+++ b/crates/fuzzing/src/generators/component_types.rs
@@ -129,80 +129,57 @@ pub fn arbitrary_val(ty: &component::Type... | 4 | 234 | 180 |
8eccc63c46503adbc6ba91034324963b69a7523b | Alex Crichton | 2023-04-29T04:37:10 | Fix tests in `--release` mode (#6308)
Add `#[cfg]` annotations to some tests which rely on `debug_assert!` for
panics. | diff --git a/cranelift/codegen/src/ir/builder.rs b/cranelift/codegen/src/ir/builder.rs
index e4c434cbf..0b640e760 100644
--- a/cranelift/codegen/src/ir/builder.rs
+++ b/cranelift/codegen/src/ir/builder.rs
@@ -218,7 +218,7 @@ mod tests {
use crate::cursor::{Cursor, FuncCursor};
use crate::ir::condcodes::*;
... | 2 | 6 | 1 |
75a92d3820194c9ed7458a35bbd239e09158517f | Pat Hickey | 2023-04-28T23:48:19 | fix build of all moved code, and the tests | diff --git a/host/Cargo.toml b/host/Cargo.toml
index 365868123..7cd16ed11 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -6,13 +6,16 @@ edition.workspace = true
[dependencies]
anyhow = { workspace = true }
cap-std = { workspace = true }
-wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev =... | 15 | 227 | 164 |
fd6cc9a116ae44064c5a1793eb4c9dc9fc1f68bc | Alex Crichton | 2023-04-28T22:40:05 | Slightly shrink compiled wasm modules (#6302)
* Slightly shrink compiled wasm modules
This commit shuffles trampolines to the end of a compiled ELF file
instead of interspersed throughout. Additionally trampolines are no
longer given a higher alignment requirement than is required by the ISA
as is given to functions ... | diff --git a/cranelift/codegen/src/isa/aarch64/inst/mod.rs b/cranelift/codegen/src/isa/aarch64/inst/mod.rs
index 6077e7bac..3f668bcc4 100644
--- a/cranelift/codegen/src/isa/aarch64/inst/mod.rs
+++ b/cranelift/codegen/src/isa/aarch64/inst/mod.rs
@@ -3,7 +3,7 @@
use crate::binemit::{Addend, CodeOffset, Reloc};
use crat... | 18 | 123 | 61 |
eb082a22d9e22979875e3f4cedcba356cf9a3e1d | Pat Hickey | 2023-04-28T22:10:34 | move all of host library into wasi_common
leaving just host as an executable | diff --git a/host/Cargo.toml b/host/Cargo.toml
index d8b945c8d..365868123 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -5,13 +5,7 @@ edition.workspace = true
[dependencies]
anyhow = { workspace = true }
-thiserror = { workspace = true }
-async-trait = { workspace = true }
cap-std = { workspace = true }
-c... | 21 | 3 | 12 |
0923bed956eee775456b480440bfd9f263c411d8 | Alex Crichton | 2023-04-28T16:45:42 | Fix the component_api fuzzer (#6305)
This looks like a bug that's been lingering for quite some time now on
OSS-Fuzz which was mistakenly thought to be a different issue (my mistake). | diff --git a/crates/misc/component-fuzz-util/src/lib.rs b/crates/misc/component-fuzz-util/src/lib.rs
index 1d9d29697..0ef1286ab 100644
--- a/crates/misc/component-fuzz-util/src/lib.rs
+++ b/crates/misc/component-fuzz-util/src/lib.rs
@@ -23,10 +23,10 @@ const MAX_ARITY: u32 = 5;
const MAX_TYPE_DEPTH: u32 = 99;
/// T... | 1 | 8 | 8 |
bf945bdc0a0ff0c3e07a7bc8ffae941d2bab6c94 | Alex Crichton | 2023-04-28T16:20:46 | Cut down on boilerplate in Wasmtime's Cranelift integration (#6304)
Move the setup/teardown of contexts for each function's compile into a
new `FunctionCompiler` structure which handles more internally between
trampolines and normal wasm functions. | diff --git a/crates/cranelift/src/compiler.rs b/crates/cranelift/src/compiler.rs
index be81034a6..9b7a95715 100644
--- a/crates/cranelift/src/compiler.rs
+++ b/crates/cranelift/src/compiler.rs
@@ -116,30 +116,6 @@ impl Compiler {
}
}
- fn take_context(&self) -> CompilerContext {
- let candidat... | 2 | 136 | 295 |
87f74e9d1a6d647582ea41cd351a13e1b28d90fd | Pat Hickey | 2023-04-27T22:27:51 | adapter: path_ apis return NOTDIR instead of BADF when passed file; fixes path_open_dirfd test. (#152)
* adapter: special case for NOTDIR instead of BADF fixes path_open_dirfd test.
* get_dir now fails with NOTDIR for non-dir files
* get rid of special case
* complete test coverage for all path_ functions giv... | diff --git a/src/descriptors.rs b/src/descriptors.rs
index 6340da968..a9f9bc5bd 100644
--- a/src/descriptors.rs
+++ b/src/descriptors.rs
@@ -324,6 +324,16 @@ impl Descriptors {
}
}
+ pub fn get_file_or_dir(&self, fd: Fd) -> Result<&File, Errno> {
+ match self.get(fd)? {
+ Descriptor... | 1 | 19 | 0 |
c8fa55efb78494d40ea24c52e8807e3021ce5ab1 | Pat Hickey | 2023-04-27T22:27:51 | adapter: path_ apis return NOTDIR instead of BADF when passed file; fixes path_open_dirfd test. (#152)
* adapter: special case for NOTDIR instead of BADF fixes path_open_dirfd test.
* get_dir now fails with NOTDIR for non-dir files
* get rid of special case
* complete test coverage for all path_ functions giv... | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 17d724f57..f96753aba 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -433,7 +433,7 @@ async fn run_path_open_create_existing(store: Store<WasiCtx>, wasi: Command) ->
async fn run_path_open_dirfd_not_dir(store: Store<WasiCtx>, wasi: Co... | 2 | 56 | 1 |
ec6755512f7607c92a5dfd28bc8af782ee973ed6 | Dan Gohman | 2023-04-26T01:33:09 | Remove `maintenance` badges from the Cargo.toml files. (#6286)
Several of these badges were out of date, with some crates in wide production
use marked as "experimental". Insted of trying to keep them up to date, just
remove them, since they are [no longer displayed on crates.io].
[no longer displayed on crates.io]: ... | diff --git a/Cargo.toml b/Cargo.toml
index d6249952c..af55b046f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -239,9 +239,6 @@ winch = ["wasmtime/winch"]
# backend is the default now.
experimental_x64 = []
-[badges]
-maintenance = { status = "actively-developed" }
-
[[test]]
name = "host_segfault"
harness = false
... | 29 | 0 | 88 |
68c33b1934168a78867ba7ffc86eb68da0964485 | Pat Hickey | 2023-04-25T20:45:34 | wasi-common ctx: new push methods | diff --git a/wasi-common/src/ctx.rs b/wasi-common/src/ctx.rs
index 8ca95672b..03c6ab05d 100644
--- a/wasi-common/src/ctx.rs
+++ b/wasi-common/src/ctx.rs
@@ -83,6 +83,14 @@ impl WasiCtx {
self.table_mut().push(Box::new(dir))
}
+ pub fn push_input_stream(&mut self, i: Box<dyn InputStream>) -> Result<u3... | 1 | 8 | 0 |
c7b83e8ef902c3f03bd7d8c5a2f6543ae8c9b5f6 | Jamey Sharp | 2023-04-25T14:15:53 | wasmtime: remove `drop(&mut ...)` used to silence warnings (#6278)
The `Config` needs to be mutable while building a compiler, but in a
build configuration without a compiler, declaring it as `mut` produces a
warning since nothing else needs that.
I found the existing workaround for this warning confusing, so this PR... | diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs
index 504d8d22b..99b7ca860 100644
--- a/crates/wasmtime/src/config.rs
+++ b/crates/wasmtime/src/config.rs
@@ -1520,7 +1520,7 @@ impl Config {
}
#[cfg(compiler)]
- pub(crate) fn build_compiler(&mut self) -> Result<Box<dyn wasmtime_... | 2 | 4 | 5 |
51137396010680500f2eeae211bf1efd985df7b9 | Afonso Bordado | 2023-04-25T11:03:16 | riscv64: Enable more instructions in the fuzzer (#6271)
These have been fixed in the past, and I've been forgeting to re-enable them. | diff --git a/cranelift/fuzzgen/src/function_generator.rs b/cranelift/fuzzgen/src/function_generator.rs
index b6f118624..504ee906d 100644
--- a/cranelift/fuzzgen/src/function_generator.rs
+++ b/cranelift/fuzzgen/src/function_generator.rs
@@ -699,26 +699,21 @@ fn valid_for_target(triple: &Triple, op: Opcode, args: &[Type... | 1 | 7 | 12 |
bd473dba3188ada4542bb8c0acdc4498bceec972 | Jamey Sharp | 2023-04-25T01:02:54 | wasmtime-runtime: Re-export backtrace `Frame` type (#6280)
This crate re-exports the `Backtrace` type at top-level from a nested
module. `Backtrace` in turn has `Frame` in its public API, which is not
re-exported anywhere. This is legal and external users can call methods
on `Frame`, but it doesn't appear in the rustd... | diff --git a/crates/runtime/src/lib.rs b/crates/runtime/src/lib.rs
index 3428a0ffb..826c05298 100644
--- a/crates/runtime/src/lib.rs
+++ b/crates/runtime/src/lib.rs
@@ -68,7 +68,7 @@ pub use crate::table::{Table, TableElement};
pub use crate::trampolines::prepare_host_to_wasm_trampoline;
pub use crate::traphandlers::... | 2 | 2 | 2 |
fa859eac22f6fbb4179e560813461835bb58436a | Pat Hickey | 2023-04-24T22:11:16 | remove test expectations around rights (#153)
* Revert "wasi-tests: add configuration to ignore rights readback (#81)"
This reverts commit d006b1bead0d688cc083fd07628f06d381abbefc.
* wasi-tests: pull in all changes from upstream which remove support for rights
https://github.com/bytecodealliance/wasmtime/pull... | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 67c8c0bc0..17d724f57 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -306,8 +306,6 @@ async fn run_default_clocks(mut store: Store<WasiCtx>, wasi: Command) -> Result<
async fn run_with_temp_dir(mut store: Store<WasiCtx>, wasi: Command) ... | 17 | 41 | 232 |
022926019bed1686deebf2d3ae9921ab49d874c4 | Pat Hickey | 2023-04-24T22:08:42 | adapter poll_oneoff: when descriptors.get_*_stream(fd) fails, die with that error (#154)
* adapter poll_oneoff: when descriptors.get_*_stream(fd) fails, die with that error
There was a special case in poll_oneoff that put in a fake clock stream
when a read/write stream for a descriptor wasn't available. The
poll_... | diff --git a/src/lib.rs b/src/lib.rs
index ab7c55592..1ffc15358 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1585,7 +1585,6 @@ pub unsafe extern "C" fn poll_oneoff(
)
.trapping_unwrap()
);
-
// Store the pollable handles at the beginning, and the bool results at the
// e... | 1 | 8 | 22 |
6f44c9168e7d36d792ef26f63bbc17f1cca9d2fd | Pat Hickey | 2023-04-24T22:08:42 | adapter poll_oneoff: when descriptors.get_*_stream(fd) fails, die with that error (#154)
* adapter poll_oneoff: when descriptors.get_*_stream(fd) fails, die with that error
There was a special case in poll_oneoff that put in a fake clock stream
when a read/write stream for a descriptor wasn't available. The
poll_... | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 89b642f43..67c8c0bc0 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -466,10 +466,11 @@ async fn run_path_symlink_trailing_slashes(store: Store<WasiCtx>, wasi: Command)
}
async fn run_poll_oneoff_files(store: Store<WasiCtx>, wasi: Co... | 1 | 5 | 4 |
c9a9c2c1919858057ef51b91dc92216cf13ea477 | yuyang | 2023-04-24T16:11:34 | Specify a `read` parameter for `ISLE`'s `Lexer`. (#6123)
* fix col
* fix test failure
* specify read method.
* modify isle lexer
* remove a fn | diff --git a/cranelift/isle/isle/src/lexer.rs b/cranelift/isle/isle/src/lexer.rs
index 2c8ee2540..6a41ee21e 100644
--- a/cranelift/isle/isle/src/lexer.rs
+++ b/cranelift/isle/isle/src/lexer.rs
@@ -2,7 +2,7 @@
use crate::error::{Error, Errors, Span};
use std::borrow::Cow;
-use std::path::Path;
+use std::path::{Path,... | 1 | 15 | 11 |
4b703f9dce7ae8aa587453de5b7099de38f708ba | Alex Crichton | 2023-04-24T16:00:24 | Fix differential fuzzing when Wasmtime hits an OOM (#6273)
OSS-Fuzz found a case where the `differential` fuzzer was failing and
the underlying cause was that Wasmtime was hitting an OOM while Wasmi
wasn't. This meant that the two modules were producing "different
results" since memories had differing lengths, but thi... | diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs
index 6c10de3db..c0e149853 100644
--- a/crates/fuzzing/src/oracles.rs
+++ b/crates/fuzzing/src/oracles.rs
@@ -83,6 +83,7 @@ impl StoreLimits {
}
fn alloc(&mut self, amt: usize) -> bool {
+ log::trace!("alloc {amt:#x} bytes");
... | 2 | 24 | 1 |
3e06a0a2bd248ae92b6b24be11ee73db4ac2375b | Brendan Burns | 2023-04-24T15:50:53 | Minor cleanups. (#6270) | diff --git a/crates/wasi-http/src/http_impl.rs b/crates/wasi-http/src/http_impl.rs
index 5b0e3862d..7232dac8b 100644
--- a/crates/wasi-http/src/http_impl.rs
+++ b/crates/wasi-http/src/http_impl.rs
@@ -24,21 +24,16 @@ impl crate::default_outgoing_http::Host for WasiHttp {
request_id: crate::default_outgoing_htt... | 1 | 9 | 14 |
43ec4816f1280086987a6743d06368a606406bea | Brendan Burns | 2023-04-21T18:17:06 | Make streams owned by request/response that they are tied to. (#6228)
* Make streams owned by request/response that they are tied to.
* Address comments, fix tests.
* Address comment.
* Update crates/wasi-http/src/streams_impl.rs
Co-authored-by: Pat Hickey <pat@moreproductive.org>
* Switch to BytesMut
---------
... | diff --git a/crates/wasi-http/src/http_impl.rs b/crates/wasi-http/src/http_impl.rs
index 69c94d848..5b0e3862d 100644
--- a/crates/wasi-http/src/http_impl.rs
+++ b/crates/wasi-http/src/http_impl.rs
@@ -1,5 +1,5 @@
use crate::r#struct::ActiveResponse;
-pub use crate::r#struct::WasiHttp;
+use crate::r#struct::{Stream, Wa... | 4 | 68 | 26 |
efdfc361f83294cc520d1f2f9f05479050e3baa2 | Jamey Sharp | 2023-04-21T16:55:35 | Allow WASI to open directories without O_DIRECTORY (#6163)
* Allow WASI to open directories without O_DIRECTORY
The `O_DIRECTORY` flag is a request that open should fail if the named
path is not a directory. Opening a path which turns out to be a
directory is not supposed to fail if this flag is not specified.
Howeve... | diff --git a/crates/test-programs/wasi-tests/src/bin/fd_readdir.rs b/crates/test-programs/wasi-tests/src/bin/fd_readdir.rs
index 87aa112c2..bc4bdd2d8 100644
--- a/crates/test-programs/wasi-tests/src/bin/fd_readdir.rs
+++ b/crates/test-programs/wasi-tests/src/bin/fd_readdir.rs
@@ -65,10 +65,9 @@ unsafe fn exec_fd_readdi... | 8 | 170 | 93 |
91d1d246cd2ee8d854bba220900ce6efd255b02b | bjorn3 | 2023-04-21T12:39:15 | Allow serializing all cranelift-module data structures (#6172)
* Remove ModuleCompiledFunction
The same information can be retrieved using
ctx.compiled_code().unwrap().code_info().total_size
In addition for Module implementations that don't immediately compile the
given function there is no correct value that can b... | diff --git a/Cargo.lock b/Cargo.lock
index 8e5c41137..9811cb8cb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -747,6 +747,7 @@ dependencies = [
"cranelift-codegen",
"cranelift-control",
"hashbrown 0.13.2",
+ "serde",
]
[[package]]
diff --git a/cranelift/codegen/src/ir/function.rs b/cranelift/codegen/src/ir/func... | 8 | 359 | 100 |
806d23d37cdf568fb8450b1d1c55e530ec91938e | Pat Hickey | 2023-04-21T00:20:39 | delete spurrious extra line in adapter (this same var is created below) | diff --git a/src/lib.rs b/src/lib.rs
index c2a9f7148..ab7c55592 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -803,8 +803,6 @@ pub unsafe extern "C" fn fd_read(
State::with(|state| {
match state.descriptors().get(fd)? {
Descriptor::Streams(streams) => {
- let wasi_stream = stream... | 1 | 0 | 2 |
d62b98643a69323bbc2e059b4bc93c6e18949fb8 | Pat Hickey | 2023-04-21T00:19:48 | fix bug in adapter fd_fdstat_set_flags to frob the append flag.
this fixes the fd_flags_set test. | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 71169eb39..89b642f43 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -374,8 +374,7 @@ async fn run_fd_filestat_set(store: Store<WasiCtx>, wasi: Command) -> Result<()>
}
async fn run_fd_flags_set(store: Store<WasiCtx>, wasi: Command) ... | 2 | 9 | 5 |
f0ed67a15c4a85f10260b0c0f44464b8b5c6767b | Pat Hickey | 2023-04-21T00:19:48 | fix bug in adapter fd_fdstat_set_flags to frob the append flag.
this fixes the fd_flags_set test. | diff --git a/src/lib.rs b/src/lib.rs
index 37f800e02..c2a9f7148 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -526,8 +526,8 @@ pub unsafe extern "C" fn fd_fdstat_get(fd: Fd, stat: *mut Fdstat) -> Errno {
/// Note: This is similar to `fcntl(fd, F_SETFL, flags)` in POSIX.
#[no_mangle]
pub unsafe extern "C" fn fd_fdstat_... | 1 | 3 | 2 |
93e4bd16301b8bb49a0d9ea39e143bb6ed595a90 | Pat Hickey | 2023-04-20T22:49:34 | NFC, looks more consistient to my eye though | diff --git a/src/lib.rs b/src/lib.rs
index fe98dd75f..37f800e02 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1103,11 +1103,10 @@ pub unsafe extern "C" fn fd_seek(
// Seeking only works on files.
if let StreamType::File(file) = &stream.type_ {
- match file.descriptor_type {
+ if... | 1 | 2 | 3 |
c5b796a57bce8032a494c9cf2063e293d3c907d4 | Pat Hickey | 2023-04-20T22:47:42 | fd_seek: error with invalid offsets in the adapter | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 6c48d3f4a..71169eb39 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -392,7 +392,7 @@ async fn run_file_pread_pwrite(store: Store<WasiCtx>, wasi: Command) -> Result<(
async fn run_file_seek_tell(store: Store<WasiCtx>, wasi: Command) -... | 1 | 1 | 1 |
fddf6ca5aadc885b4d06f8fbbc3defaa8b3c8b61 | Pat Hickey | 2023-04-20T22:47:42 | fd_seek: error with invalid offsets in the adapter | diff --git a/src/lib.rs b/src/lib.rs
index 0e027e3eb..fe98dd75f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1109,12 +1109,16 @@ pub unsafe extern "C" fn fd_seek(
filesystem::DescriptorType::Directory => return Err(ERRNO_BADF),
_ => {}
}
- // It's ok to cast the... | 1 | 9 | 5 |
1192697c7ec323285745113e500a267c7d59037a | Remo Senekowitsch | 2023-04-20T22:24:32 | refactor BlockLoweringOrder::new (#6255)
Co-authored-by: Falk Zwimpfer <24669719+FalkZ@users.noreply.github.com>
Co-authored-by: Moritz Waser <mzrw.dev@pm.me> | diff --git a/cranelift/codegen/src/machinst/blockorder.rs b/cranelift/codegen/src/machinst/blockorder.rs
index a67909f46..f6358b9bf 100644
--- a/cranelift/codegen/src/machinst/blockorder.rs
+++ b/cranelift/codegen/src/machinst/blockorder.rs
@@ -188,14 +188,10 @@ impl BlockLoweringOrder {
// Step 2: walk the po... | 1 | 8 | 7 |
1c08c651e6a32ed2172d055f24b58eea1af480d0 | Pat Hickey | 2023-04-20T21:03:54 | unlink file trailing slashes: i have no idea why windows returns NOTDIR for this now, but cool | diff --git a/test-programs/wasi-tests/src/bin/unlink_file_trailing_slashes.rs b/test-programs/wasi-tests/src/bin/unlink_file_trailing_slashes.rs
index bedecd9aa..8c390f804 100644
--- a/test-programs/wasi-tests/src/bin/unlink_file_trailing_slashes.rs
+++ b/test-programs/wasi-tests/src/bin/unlink_file_trailing_slashes.rs... | 1 | 1 | 2 |
b5f3b824cca90ef5fc74694876316e8418781d68 | Pat Hickey | 2023-04-20T20:48:52 | cap-std-sync: explicitly error with notsup for opening with sync fdflags on windows? | diff --git a/wasi-common/cap-std-sync/src/dir.rs b/wasi-common/cap-std-sync/src/dir.rs
index 8e0ed6ae7..334de51f7 100644
--- a/wasi-common/cap-std-sync/src/dir.rs
+++ b/wasi-common/cap-std-sync/src/dir.rs
@@ -66,12 +66,21 @@ impl Dir {
use cap_fs_ext::OpenOptionsSyncExt;
if fdflags.contains(wasi_com... | 1 | 9 | 0 |
1ba5488cf66aafdcd51a3cc6150c6b5067b72430 | Pat Hickey | 2023-04-20T20:05:18 | with prev commit, some tests that previously failed only on windows pass | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 56baa7e51..4229cb33d 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -350,19 +350,11 @@ async fn run_overwrite_preopen(store: Store<WasiCtx>, wasi: Command) -> Result<(
}
async fn run_dangling_fd(store: Store<WasiCtx>, wasi: Command)... | 1 | 6 | 30 |
77b98bec26a60539c25cc9c7c970f15838f163a6 | Pat Hickey | 2023-04-20T19:45:43 | command tests: set the whole suite of test config env variables for windows, mac, unix | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 53debed1b..56baa7e51 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -308,6 +308,19 @@ async fn run_with_temp_dir(mut store: Store<WasiCtx>, wasi: Command) -> Result<(
store.data_mut().push_env("NO_RIGHTS_READBACK_SUPPORT", "1");
... | 1 | 13 | 0 |
b0fed76389af629463ce8e32f48b02b4d59db70f | Pat Hickey | 2023-04-20T19:08:47 | adapter: change logic around interpeting ATIM and ATIM_NOW (and MTIM equiv) to be consistient with upstream
in wasi-common preview1, ATIM and ATIM_NOW (and MTIM and MTIM now) were mutually exclusive and would result in an INVAL error, whereas in the adapter previously, ATIM_NOW implied ATIM, but would silently do noth... | diff --git a/src/lib.rs b/src/lib.rs
index 9c30ceb8b..ad9b4dfdc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -618,6 +618,21 @@ pub unsafe extern "C" fn fd_filestat_set_size(fd: Fd, size: Filesize) -> Errno {
})
}
+fn systimespec(set: bool, ts: Timestamp, now: bool) -> Result<filesystem::NewTimestamp, Errno> {
+ ... | 1 | 36 | 46 |
1e84032394507749c905307dbf71d56ef70ad516 | Pat Hickey | 2023-04-20T19:08:47 | adapter: change logic around interpeting ATIM and ATIM_NOW (and MTIM equiv) to be consistient with upstream
in wasi-common preview1, ATIM and ATIM_NOW (and MTIM and MTIM now) were mutually exclusive and would result in an INVAL error, whereas in the adapter previously, ATIM_NOW implied ATIM, but would silently do noth... | diff --git a/host/tests/command.rs b/host/tests/command.rs
index a01d14d7e..53debed1b 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -417,7 +417,7 @@ async fn run_path_exists(store: Store<WasiCtx>, wasi: Command) -> Result<()> {
}
async fn run_path_filestat(store: Store<WasiCtx>, wasi: Command) -... | 1 | 1 | 1 |
3a9e8c12fca8e5448851bf4980d6997a8b93025f | Pat Hickey | 2023-04-20T00:21:50 | readlink test: fix warning
this is left over from a prev pr | diff --git a/test-programs/wasi-tests/src/bin/readlink.rs b/test-programs/wasi-tests/src/bin/readlink.rs
index 615647247..eb8b8aa5f 100644
--- a/test-programs/wasi-tests/src/bin/readlink.rs
+++ b/test-programs/wasi-tests/src/bin/readlink.rs
@@ -1,5 +1,5 @@
use std::{env, process};
-use wasi_tests::{assert_errno, creat... | 1 | 1 | 1 |
6326e0abea3608dd2f523ba3cb6088867a74b32e | Pat Hickey | 2023-04-20T00:21:38 | host: remove nonblock descriptor flags and set-flags | diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs
index 328852b49..208867128 100644
--- a/host/src/filesystem.rs
+++ b/host/src/filesystem.rs
@@ -101,9 +101,6 @@ impl From<FdFlags> for wasi::filesystem::DescriptorFlags {
if fdflags.contains(FdFlags::DSYNC) {
flags |= wasi::filesystem::D... | 1 | 0 | 15 |
b8018edad965456b8826ac5277d5e9acb744adab | Pat Hickey | 2023-04-20T00:21:05 | adapter: track blocking state in File, remove uses of set-flags | diff --git a/src/descriptors.rs b/src/descriptors.rs
index 59e8661b1..6340da968 100644
--- a/src/descriptors.rs
+++ b/src/descriptors.rs
@@ -191,6 +191,7 @@ impl Descriptors {
.trapping_unwrap(),
position: Cell::new(0),
append: false,
+ ... | 2 | 56 | 24 |
8e76ec82be9414051c07f346ca3f344f2a715441 | Pat Hickey | 2023-04-19T20:13:25 | wasi-common: export StringArray type (#6244)
reusable elsewhere: @mtr is gonna use it in wasi-nn. | diff --git a/crates/wasi-common/src/lib.rs b/crates/wasi-common/src/lib.rs
index 4a11e4742..b6da9c1f9 100644
--- a/crates/wasi-common/src/lib.rs
+++ b/crates/wasi-common/src/lib.rs
@@ -69,5 +69,5 @@ pub use dir::WasiDir;
pub use error::{Error, ErrorExt, I32Exit};
pub use file::WasiFile;
pub use sched::{Poll, WasiSch... | 1 | 1 | 1 |
b23691032b69c2cedb0934e5f6ae039869bf38a1 | Alex Crichton | 2023-04-19T19:45:48 | Fix default architecture for winch (#6242)
* Fix default architecture for winch
This updates the `winch/codegen/build.rs` script to default to the
target architecture being compiled for as opposed to the host
architecture that's performing the compile.
Closes #6241
* Auto-enable other future architectures | diff --git a/winch/codegen/build.rs b/winch/codegen/build.rs
index 9f18db48a..378ac5173 100644
--- a/winch/codegen/build.rs
+++ b/winch/codegen/build.rs
@@ -3,10 +3,14 @@ fn main() {
return;
}
- if cfg!(target_arch = "x86_64") {
+ let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
+
+ ... | 1 | 6 | 2 |
077d4755d940ee95a7e6a2c9528a56b705ec3b04 | Alex Crichton | 2023-04-19T19:22:25 | Mark loads from `VMCallerCheckedAnyfunc` as readonly (#6243)
This commit marks the loads of `*mut VMContext` and the callee function
pointer as `readonly` in the context of indirect function calls and
additionally calls to imported functions (which are indirect). Once a
`VMCallerCheckedAnyfunc` is initialized it's nev... | diff --git a/crates/cranelift/src/func_environ.rs b/crates/cranelift/src/func_environ.rs
index 305d12355..bb3fc608f 100644
--- a/crates/cranelift/src/func_environ.rs
+++ b/crates/cranelift/src/func_environ.rs
@@ -1595,7 +1595,7 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m
... | 1 | 3 | 3 |
770b0ba826f559134b79195c78ee81f57016cf3c | Pat Hickey | 2023-04-18T21:46:41 | delete truncation_rights test
upstream: https://github.com/bytecodealliance/wasmtime/pull/6236 | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 0718ddfce..7af22c309 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -532,11 +532,6 @@ async fn run_symlink_loop(store: Store<WasiCtx>, wasi: Command) -> Result<()> {
}
}
-async fn run_truncation_rights(store: Store<WasiCtx>, was... | 2 | 0 | 107 |
0a062369a87de27bada88569848fb7115d09a2e3 | Pat Hickey | 2023-04-19T16:40:42 | delete wasi truncation_rights test (#6236)
This test was not meaningfully executing, because wasi-common never
provides rights containing RIGHTS_PATH_FILESTAT_SET_SIZE - this flag is
not even defined in wasi-common/srd/dir.rs as one of the DirCaps flags.
Even when you get rid of that guard that skips the meat of the ... | diff --git a/crates/test-programs/wasi-tests/src/bin/truncation_rights.rs b/crates/test-programs/wasi-tests/src/bin/truncation_rights.rs
deleted file mode 100644
index 0480d74b9..000000000
--- a/crates/test-programs/wasi-tests/src/bin/truncation_rights.rs
+++ /dev/null
@@ -1,98 +0,0 @@
-use std::{env, process};
-use wa... | 1 | 0 | 98 |
51ed20ab4d855343ee68b46b5aa98002c5c63dca | Lann | 2023-04-18T21:21:16 | Add Engine::precompile_compatibility_hash (#5826)
This method returns a Hash, the output of which can be used to index
precompiled binaries from one Engine instance that can be deserialized
by another Engine instance. | diff --git a/crates/wasmtime/src/engine.rs b/crates/wasmtime/src/engine.rs
index a900a435f..2db8602fc 100644
--- a/crates/wasmtime/src/engine.rs
+++ b/crates/wasmtime/src/engine.rs
@@ -239,6 +239,18 @@ impl Engine {
Ok(mmap.to_vec())
}
+ /// Returns a [`std::hash::Hash`] that can be used to check pre... | 2 | 36 | 3 |
24b607cf751930c51f2b6449cdfbf2e81dce1c31 | Pat Hickey | 2023-04-18T18:12:30 | wasi-common: change behavior of path_readlink to truncate on too-small buffers (#6225)
this is the same behavior as exists in posix readlink(2) | diff --git a/crates/test-programs/wasi-tests/src/bin/readlink.rs b/crates/test-programs/wasi-tests/src/bin/readlink.rs
index b06c01c59..615647247 100644
--- a/crates/test-programs/wasi-tests/src/bin/readlink.rs
+++ b/crates/test-programs/wasi-tests/src/bin/readlink.rs
@@ -22,10 +22,10 @@ unsafe fn test_readlink(dir_fd:... | 2 | 9 | 9 |
0219acbe5b05ed3dbbab478c032cc071549e8b8a | Pat Hickey | 2023-04-18T17:50:10 | Add a WASI test for creating an absolute-path symlink
Wasmtime disallows guests from using path_symlink to create absolute-path symlinks, as they could confuse other code into accessing resources on the host that the guest otherwise doesn't have access to.
This patch adds a test for this behavior.
Co-authored-by: Da... | diff --git a/test-programs/wasi-tests/src/bin/symlink_create.rs b/test-programs/wasi-tests/src/bin/symlink_create.rs
index 422da184c..2553f34fc 100644
--- a/test-programs/wasi-tests/src/bin/symlink_create.rs
+++ b/test-programs/wasi-tests/src/bin/symlink_create.rs
@@ -62,6 +62,11 @@ unsafe fn create_symlink_to_director... | 1 | 6 | 0 |
a2bd4d4fbc7cf7dd97a0962f3ccccf6ad96b57aa | Pat Hickey | 2023-04-18T17:34:26 | latest wasmtime, where path works with interfaces
needed to bump the wit crate as well | diff --git a/host/Cargo.toml b/host/Cargo.toml
index 2649e9a24..0f851d9e7 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -12,7 +12,7 @@ cap-rand = { workspace = true }
cap-net-ext = { workspace = true }
tokio = { version = "1.22.0", features = [ "rt", "macros" ] }
tracing = { workspace = true }
-wasmtime = { ... | 2 | 2 | 2 |
299131ae2d6655c49138bfab2c4469650763ef3b | Alex Crichton | 2023-04-18T16:50:48 | Gracefully handle ENOTSUP for `memfd_create` (#6230)
* Gracefully handle ENOTSUP for `memfd_create`
Looks like in #6229 older kernels may not support memfd in which case we
can fall back to manual memory initialization gracefully.
Closes #6229
* Fix tests | diff --git a/crates/runtime/src/cow.rs b/crates/runtime/src/cow.rs
index e043c31d1..dc87a2c27 100644
--- a/crates/runtime/src/cow.rs
+++ b/crates/runtime/src/cow.rs
@@ -157,7 +157,10 @@ impl MemoryImage {
use std::io::Write;
- let memfd = create_memfd()?;
+ let memfd =... | 1 | 21 | 5 |
d4b771e5a30ff3ec5eb929e7276f1bd6ff87c6d9 | Trevor Elliott | 2023-04-17T23:51:52 | Allow inline source and the `path` attribute in the host bindgen! macro (#6226)
* Allow inline source and the `path` attribute in the host bindgen! macro
* Report an error if `world` is passed with `interfaces` | diff --git a/crates/component-macro/src/bindgen.rs b/crates/component-macro/src/bindgen.rs
index 6d55d1970..028659204 100644
--- a/crates/component-macro/src/bindgen.rs
+++ b/crates/component-macro/src/bindgen.rs
@@ -38,17 +38,13 @@ pub fn expand(input: &Config) -> Result<TokenStream> {
Ok(contents)
}
-enum Sou... | 1 | 52 | 28 |
4ee24e1c105cdc4fcccd061f0732f7e79c5334d0 | Pat Hickey | 2023-04-17T22:13:39 | readlink: fix adapter to return right len, and test to expect truncation
truncation behavior is backported to upstream in https://github.com/bytecodealliance/wasmtime/pull/6225 | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 49eccea63..61b9eadbd 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -481,7 +481,7 @@ async fn run_poll_oneoff_stdio(store: Store<WasiCtx>, wasi: Command) -> Result<(
}
async fn run_readlink(store: Store<WasiCtx>, wasi: Command) -> R... | 2 | 5 | 5 |
4bba05d7168c67c3875c2b46c2b53e7f7dcf5fe9 | Pat Hickey | 2023-04-17T22:13:39 | readlink: fix adapter to return right len, and test to expect truncation
truncation behavior is backported to upstream in https://github.com/bytecodealliance/wasmtime/pull/6225 | diff --git a/src/lib.rs b/src/lib.rs
index a2a685f0d..ea4315b1e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1399,12 +1399,14 @@ pub unsafe extern "C" fn path_readlink(
.with_buffer(buf, buf_len, || filesystem::readlink_at(file.fd, path))?
};
- *bufused = path.len();
if use_s... | 1 | 3 | 1 |
9ee613a0b79aeaab01460f36c881d4cb4f634c82 | Pat Hickey | 2023-04-17T21:35:28 | wasi-common: deprecate fd_allocate (#6217)
* wasi-common: remove allocate from WasiFile trait, always fail with NOTSUP
This operation from cloudabi is linux-specific, isn't even
supported across all linux filesystems, and has no support on macos
or windows. Rather than ship spotty support, it has been removed
from pr... | diff --git a/crates/test-programs/tests/wasm_tests/runtime/mod.rs b/crates/test-programs/tests/wasm_tests/runtime/mod.rs
index 9a4fe8202..2ea46982d 100644
--- a/crates/test-programs/tests/wasm_tests/runtime/mod.rs
+++ b/crates/test-programs/tests/wasm_tests/runtime/mod.rs
@@ -12,8 +12,6 @@ pub fn test_suite_environment... | 8 | 26 | 55 |
3d6e55e0fcb1335fd200706ca3fe02a7bf5877d8 | Pat Hickey | 2023-04-17T21:32:41 | adapter: remove incorrect assertions from path_readlink | diff --git a/src/lib.rs b/src/lib.rs
index 0f206eb56..a2a685f0d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1399,9 +1399,6 @@ pub unsafe extern "C" fn path_readlink(
.with_buffer(buf, buf_len, || filesystem::readlink_at(file.fd, path))?
};
- assert_eq!(path.as_ptr(), buf);
- a... | 1 | 0 | 3 |
81b4ffe5e0a641e31a20a8b028c3dfb33b5de19a | Pat Hickey | 2023-04-17T21:29:40 | adapter: fd_allocate gives notsup on all files | diff --git a/src/lib.rs b/src/lib.rs
index 0f206eb56..5304d54db 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -407,8 +407,10 @@ pub unsafe extern "C" fn fd_advise(
pub unsafe extern "C" fn fd_allocate(fd: Fd, offset: Filesize, len: Filesize) -> Errno {
State::with(|state| {
let ds = state.descriptors();
+ ... | 1 | 3 | 1 |
51e6ad1c098a3e1a528de1fc808719966e4e909f | Pat Hickey | 2023-04-17T21:29:40 | adapter: fd_allocate gives notsup on all files | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 49eccea63..bb8e85b34 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -357,7 +357,7 @@ async fn run_directory_seek(store: Store<WasiCtx>, wasi: Command) -> Result<()>
}
async fn run_fd_advise(store: Store<WasiCtx>, wasi: Command) -> R... | 1 | 2 | 2 |
3d1915b2f4dc101532b5d0c07f2767b19c9826e8 | Pat Hickey | 2023-04-17T21:11:38 | tests: always expect fd_allocate to fail with NOTSUP | diff --git a/test-programs/wasi-tests/src/bin/fd_advise.rs b/test-programs/wasi-tests/src/bin/fd_advise.rs
index 62346fdc5..d6c37ae77 100644
--- a/test-programs/wasi-tests/src/bin/fd_advise.rs
+++ b/test-programs/wasi-tests/src/bin/fd_advise.rs
@@ -1,5 +1,5 @@
use std::{env, process};
-use wasi_tests::{open_scratch_di... | 3 | 13 | 30 |
85118c8c26d0e63457315eab84f1a3d3c0fc74ad | kevaundray | 2023-04-17T15:53:34 | Add clippy suggestions (#6203)
* add clippy suggestions
* revert &/ref change
* Update cranelift/isle/isle/src/parser.rs
Co-authored-by: Jamey Sharp <jamey@minilop.net>
---------
Co-authored-by: Jamey Sharp <jamey@minilop.net> | diff --git a/cranelift/codegen/meta/src/cdsl/instructions.rs b/cranelift/codegen/meta/src/cdsl/instructions.rs
index 34961f503..a0bf34e84 100644
--- a/cranelift/codegen/meta/src/cdsl/instructions.rs
+++ b/cranelift/codegen/meta/src/cdsl/instructions.rs
@@ -228,8 +228,8 @@ impl InstructionBuilder {
}
fn buil... | 22 | 140 | 172 |
9dd0b59c2a3ea72278f250080bf5e2b042e2951b | Saúl Cabrera | 2023-04-14T21:13:23 | winch(x64): Improve ABI support in trampolines (#6204)
This commit improves ABI support in Winch's trampolines mainly by:
* Adding support for the `fastcall` calling convention.
* By storing/restoring callee-saved registers.
One of the explicit goals of this change is to make tests available in the x86_64 target
as ... | diff --git a/tests/all/main.rs b/tests/all/main.rs
index bb8670006..754492b0c 100644
--- a/tests/all/main.rs
+++ b/tests/all/main.rs
@@ -34,8 +34,8 @@ mod traps;
mod wait_notify;
mod wasi_testsuite;
mod wast;
-// Currently Winch is only supported in x86_64 unix platforms.
-#[cfg(all(target_arch = "x86_64", target_fa... | 11 | 340 | 89 |
59bbdf1fce4d6c45c174c91c8fd8ae27ffdde90f | Pat Hickey | 2023-04-14T17:19:28 | wasmtime matches trace pr | diff --git a/host/Cargo.toml b/host/Cargo.toml
index f4a609fb7..a4f06f2ef 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -12,7 +12,7 @@ cap-rand = { workspace = true }
cap-net-ext = { workspace = true }
tokio = { version = "1.22.0", features = [ "rt", "macros" ] }
tracing = { workspace = true }
-wasmtime = { ... | 1 | 1 | 1 |
ea15c6f3c508f5ee151fb372e380d13244591ad3 | Pat Hickey | 2023-04-14T15:28:23 | dead code | diff --git a/src/descriptors.rs b/src/descriptors.rs
index fb534b2c1..59e8661b1 100644
--- a/src/descriptors.rs
+++ b/src/descriptors.rs
@@ -374,17 +374,6 @@ impl Descriptors {
}
}
- pub fn get_file_or_dir(&self, fd: Fd, error: Errno) -> Result<&File, Errno> {
- match self.get(fd)? {
- ... | 1 | 0 | 11 |
e56487ce71386c5aeed73938c06ef63893e87831 | Pat Hickey | 2023-04-14T15:19:07 | bump wasmtime to latest main, we need https://github.com/bytecodealliance/wasmtime/pull/6209 | diff --git a/host/Cargo.toml b/host/Cargo.toml
index 65dd52662..2649e9a24 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -12,7 +12,7 @@ cap-rand = { workspace = true }
cap-net-ext = { workspace = true }
tokio = { version = "1.22.0", features = [ "rt", "macros" ] }
tracing = { workspace = true }
-wasmtime = { ... | 1 | 1 | 1 |
51dc803b3b2f2bfdfde392aa4a66a1d53b7ed91e | Pat Hickey | 2023-04-14T15:10:23 | bump wasmtime and use new syntax, but it doesnt quite work yet | diff --git a/host/Cargo.toml b/host/Cargo.toml
index e4f8e5a9b..f4a609fb7 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -12,7 +12,7 @@ cap-rand = { workspace = true }
cap-net-ext = { workspace = true }
tokio = { version = "1.22.0", features = [ "rt", "macros" ] }
tracing = { workspace = true }
-wasmtime = { ... | 2 | 24 | 5 |
b6d5f24abc3c3fbd3a4dea00430e2fb9599e02eb | Pat Hickey | 2023-04-13T23:08:33 | return ERRNO_BADF on directory descriptors in appropriate fd operations | diff --git a/src/descriptors.rs b/src/descriptors.rs
index 036fd88ab..1dd60084a 100644
--- a/src/descriptors.rs
+++ b/src/descriptors.rs
@@ -58,6 +58,12 @@ impl Streams {
match &self.input.get() {
Some(wasi_stream) => Ok(*wasi_stream),
None => match &self.type_ {
+ // F... | 2 | 50 | 5 |
cc1c14ac913be13329e5cfc91c33e053ab722132 | Pat Hickey | 2023-04-13T22:58:53 | wasmtime component bindgen: when tracing is enabled, emit an event for args & results (#6209)
* wasmtime component bindgen: when tracing is enabled, emit an event for arguments and results
This is consistient with what wiggle does (see
https://github.com/bytecodealliance/wasmtime/blob/main/crates/wiggle/generate/src/... | diff --git a/crates/wit-bindgen/src/lib.rs b/crates/wit-bindgen/src/lib.rs
index f564a5a95..5af48778c 100644
--- a/crates/wit-bindgen/src/lib.rs
+++ b/crates/wit-bindgen/src/lib.rs
@@ -1112,11 +1112,12 @@ impl<'a> InterfaceGenerator<'a> {
}
if self.gen.opts.tracing {
- self.src.push_str(&... | 1 | 27 | 4 |
4c1eddcb37e7ebab29cec6fb92b4a9cf4a727eee | Pat Hickey | 2023-04-13T22:58:00 | add dir_fd_op_failures to wasi testsuite
from https://github.com/bytecodealliance/wasmtime/pull/6197 | diff --git a/host/tests/command.rs b/host/tests/command.rs
index ba1a83941..d3120b050 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -554,3 +554,7 @@ async fn run_read_only(mut store: Store<WasiCtx>, wasi: Command) -> Result<()> {
Ok(())
}
+
+async fn run_dir_fd_op_failures(store: Store<WasiC... | 2 | 103 | 0 |
9425a252bb00294194f7ca259f50ca09bd333138 | Trevor Elliott | 2023-04-13T22:02:56 | Rework `only_interfaces` to the `interfaces` field (#6210)
* Rework `only_interfaces` to the `interfaces` field
* Fix the docs
* Remove only_interfaces test from the component-macro package | diff --git a/crates/component-macro/src/bindgen.rs b/crates/component-macro/src/bindgen.rs
index 2a813ef5f..b589665b5 100644
--- a/crates/component-macro/src/bindgen.rs
+++ b/crates/component-macro/src/bindgen.rs
@@ -78,7 +78,16 @@ impl Parse for Config {
Opt::Async(val) => opts.async_ = val,
... | 4 | 23 | 26 |
0fa64f11ab901c1002f8f71af5d26bfd46fd47e3 | Pat Hickey | 2023-04-13T18:13:02 | host main.rs: implement --mapdir cli flag | diff --git a/host/src/main.rs b/host/src/main.rs
index 2a3e3d822..ddd220c69 100644
--- a/host/src/main.rs
+++ b/host/src/main.rs
@@ -1,4 +1,4 @@
-use anyhow::Result;
+use anyhow::{Context, Result};
use host::{command, command::wasi::Command, proxy, proxy::wasi::Proxy, WasiCtx};
use wasi_cap_std_sync::WasiCtxBuilder;
... | 2 | 11 | 5 |
e5a9c5bc6ee8b1e3abb5aae65030e6e289839f4a | Pat Hickey | 2023-04-13T00:42:39 | random: inline implementations into single trait | diff --git a/host/src/random.rs b/host/src/random.rs
index 2cf9b5143..6d1d39630 100644
--- a/host/src/random.rs
+++ b/host/src/random.rs
@@ -3,37 +3,20 @@ use cap_rand::{distributions::Standard, Rng};
use crate::wasi;
use crate::WasiCtx;
-async fn get_random_bytes(ctx: &mut WasiCtx, len: u64) -> anyhow::Result<Vec<... | 1 | 6 | 23 |
7b5819b55a1383e969e468825a817e397777bcc6 | Brendan Burns | 2023-04-13T14:37:49 | Small follow up fix for http tests. (#6207) | diff --git a/crates/test-programs/wasi-http-tests/src/bin/outbound_request.rs b/crates/test-programs/wasi-http-tests/src/bin/outbound_request.rs
index fbb448dbb..384cf0177 100644
--- a/crates/test-programs/wasi-http-tests/src/bin/outbound_request.rs
+++ b/crates/test-programs/wasi-http-tests/src/bin/outbound_request.rs... | 1 | 4 | 5 |
3956a6aa0fbcc807bf003e1c1e3fb747d0c3c0b8 | T0b1-iOS | 2023-04-13T14:30:44 | remove `unsigned_add_overflow_condition` (#6199) | diff --git a/cranelift/codegen/src/isa/aarch64/mod.rs b/cranelift/codegen/src/isa/aarch64/mod.rs
index a5403ca5c..1c3f2809c 100644
--- a/cranelift/codegen/src/isa/aarch64/mod.rs
+++ b/cranelift/codegen/src/isa/aarch64/mod.rs
@@ -1,7 +1,6 @@
//! ARM 64-bit Instruction Set Architecture.
use crate::dominator_tree::Dom... | 9 | 1 | 48 |
391d72582d022d25d497df65a4b289ab900a9752 | Pat Hickey | 2023-04-13T00:42:29 | poll: inline definitions into single trait | diff --git a/host/src/poll.rs b/host/src/poll.rs
index f698a4844..c4fa8a465 100644
--- a/host/src/poll.rs
+++ b/host/src/poll.rs
@@ -30,55 +30,6 @@ pub(crate) enum PollableEntry {
TcpSocket(TcpSocket),
}
-async fn drop_pollable(ctx: &mut WasiCtx, pollable: Pollable) -> anyhow::Result<()> {
- ctx.table_mut()
... | 1 | 48 | 51 |
7fb64c6963d5e3015d482f375e89767e1dae223b | Pat Hickey | 2023-04-12T23:23:27 | io: inline implementation | diff --git a/host/src/io.rs b/host/src/io.rs
index 8c62c3cd9..8f887c0a0 100644
--- a/host/src/io.rs
+++ b/host/src/io.rs
@@ -17,212 +17,18 @@ impl From<wasi_common::Error> for streams::Error {
}
}
-async fn drop_input_stream(ctx: &mut WasiCtx, stream: InputStream) -> anyhow::Result<()> {
- ctx.table_mut()
- ... | 1 | 102 | 218 |
4b22875cf19c25ff76ff2ba247549fa8d2ee19ca | Pat Hickey | 2023-04-12T23:12:12 | host bindgen macros: fixes
* probably there should be a lint if a name provided to `with` doesnt exist | diff --git a/host/src/wasi/command.rs b/host/src/wasi/command.rs
index 727ddbd5c..a3cb3d0ce 100644
--- a/host/src/wasi/command.rs
+++ b/host/src/wasi/command.rs
@@ -11,9 +11,7 @@ wasmtime::component::bindgen!({
},
with: {
"filesystem": crate::wasi::filesystem,
- "instance_monotonic_clock": crate... | 2 | 2 | 3 |
91e36f3449055c19195552c668474e4a1c5e4cf4 | Karl Meakin | 2023-04-12T20:05:44 | Clarify the representation of `icmp` output (#6202)
* Clarify the representation of `icmp` output
* Reformat
* "ie" => "i.e."
* Update `fcmp` documentation as well | diff --git a/cranelift/codegen/meta/src/shared/instructions.rs b/cranelift/codegen/meta/src/shared/instructions.rs
index c082bfb51..0995f116d 100755
--- a/cranelift/codegen/meta/src/shared/instructions.rs
+++ b/cranelift/codegen/meta/src/shared/instructions.rs
@@ -1615,6 +1615,14 @@ pub(crate) fn define(
Whe... | 1 | 16 | 0 |
336746ad157db042b45ac7a54a08c44dc72e8206 | Pat Hickey | 2023-04-12T18:09:09 | de-duplicate command and proxy definitions, useing only_interfaces | diff --git a/host/src/clocks.rs b/host/src/clocks.rs
index b2d4c05ff..16f6490b0 100644
--- a/host/src/clocks.rs
+++ b/host/src/clocks.rs
@@ -1,12 +1,12 @@
#![allow(unused_variables)]
-use crate::command::wasi::{
+use crate::poll::PollableEntry;
+use crate::wasi::{
monotonic_clock::{self, Instant},
poll::Po... | 21 | 173 | 275 |
5b7932bda465cc28c9a90aa306b3f5b223528544 | Pat Hickey | 2023-04-12T18:08:01 | use git wasmtime so we can use the only_interfaces feature on host bindgen | diff --git a/host/Cargo.toml b/host/Cargo.toml
index 8e5941754..e4f8e5a9b 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -12,7 +12,7 @@ cap-rand = { workspace = true }
cap-net-ext = { workspace = true }
tokio = { version = "1.22.0", features = [ "rt", "macros" ] }
tracing = { workspace = true }
-wasmtime = { ... | 1 | 1 | 1 |
d1d381e2984ee3103f164c8045f40b13e2e6db8c | Pat Hickey | 2023-04-12T16:57:53 | add a wasi-test to show a dir_fd always gets ERRNO_BADF on appropriate fd_ operations (#6197)
* add a wasi-test to show a dir_fd always gets ERRNO_BADF on appropriate fd_ operations.
This is a conformance test for the current behavior of preview 1 in wasi-common. It is debatable whether this is the right errno, I thi... | diff --git a/crates/test-programs/wasi-tests/src/bin/dir_fd_op_failures.rs b/crates/test-programs/wasi-tests/src/bin/dir_fd_op_failures.rs
new file mode 100644
index 000000000..35c0f2827
--- /dev/null
+++ b/crates/test-programs/wasi-tests/src/bin/dir_fd_op_failures.rs
@@ -0,0 +1,99 @@
+use std::{env, process};
+use was... | 1 | 99 | 0 |
f2393b8f277318da8678d549f14082e9510c1d93 | kevaundray | 2023-04-11T16:52:11 | Removes debug assertion that was related to issue 796 (#6175)
* fix typo: behaviour -> behavior
* remove debug assertion since 796 has been merged
* Update data_value.rs | diff --git a/cranelift/codegen/src/cursor.rs b/cranelift/codegen/src/cursor.rs
index 3de1b2166..1a09d6f37 100644
--- a/cranelift/codegen/src/cursor.rs
+++ b/cranelift/codegen/src/cursor.rs
@@ -635,28 +635,6 @@ impl<'c, 'f> ir::InstInserterBase<'c> for &'c mut FuncCursor<'f> {
}
fn insert_built_inst(self, in... | 1 | 0 | 22 |
0478ead3f80aa7e798d2218ddb1b4a86edac78fb | bjorn3 | 2023-04-11T16:50:41 | Handle signature() for more libcalls (#6174)
* Handle signature() for more libcalls
This is necessary to be able to call them in the interpreter. All the
remaining libcalls which signature() doesn't handle are never used in
clif ir. Only in code compiled by a backend.
* Fix libcall declarations in cranelift-frontend... | diff --git a/cranelift/codegen/src/ir/libcall.rs b/cranelift/codegen/src/ir/libcall.rs
index 6734258ed..e6b2d539d 100644
--- a/cranelift/codegen/src/ir/libcall.rs
+++ b/cranelift/codegen/src/ir/libcall.rs
@@ -1,7 +1,7 @@
//! Naming well-known routines in the runtime library.
use crate::{
- ir::{types, AbiParam, ... | 6 | 57 | 30 |
52440f0fc88b1e03e00ceccb8b06f6dc671b6c61 | bjorn3 | 2023-04-11T12:15:22 | Remove ImmutableRegisterState and replace {get,set}_value in State with current_frame{,_mut} (#6179)
* Remove ImmutableRegisterState
It was introduced for an SCCP optimization pass, but a simplified
version of this will likely use the egraph infrastructure instead.
* Replace {get,set}_value in State with current_fra... | diff --git a/cranelift/interpreter/src/interpreter.rs b/cranelift/interpreter/src/interpreter.rs
index 87273177d..5c35bc556 100644
--- a/cranelift/interpreter/src/interpreter.rs
+++ b/cranelift/interpreter/src/interpreter.rs
@@ -12,7 +12,7 @@ use crate::value::{DataValueExt, ValueError};
use cranelift_codegen::data_va... | 3 | 216 | 342 |
3ff6e0fe03c1f56b5b5d1325060387a5c181bfb3 | Brendan Burns | 2023-04-11T03:26:19 | Some improvements to the wasi-http client implementation of write. (#6161)
* Improve write implementation for streams
* Add trailers implementation for responses.
* Improve tests.
* Update tests. | diff --git a/Cargo.lock b/Cargo.lock
index 413091c03..7f209bf16 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3045,6 +3045,10 @@ dependencies = [
"cap-std",
"cargo_metadata",
"cfg-if",
+ "http",
+ "http-body",
+ "http-body-util",
+ "hyper",
"os_pipe",
"target-lexicon",
"tempfile",
diff --git a/crates/test-pr... | 8 | 166 | 33 |
8257372621b63cafe8108f7fbb036e5f5c31ef98 | Pat Hickey | 2023-04-11T02:19:11 | fix fd_filestat_get: adapter special-case StreamType::Unknown (#139)
giving an empty Filestat, instead of returning an error.
This implements the behavior expected by the fd_filestat_get test.
We might end up being able to rename StreamType's Unknown variant to
Stdio, since it looks like that is the only place ... | diff --git a/host/tests/command.rs b/host/tests/command.rs
index e8ce255fc..73588bb52 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -361,7 +361,7 @@ async fn run_fd_advise(store: Store<WasiCtx>, wasi: Command) -> Result<()> {
}
async fn run_fd_filestat_get(store: Store<WasiCtx>, wasi: Command) -... | 1 | 1 | 1 |
47554647f35915edb178b07096b7527c6a2e9072 | Pat Hickey | 2023-04-11T02:19:11 | fix fd_filestat_get: adapter special-case StreamType::Unknown (#139)
giving an empty Filestat, instead of returning an error.
This implements the behavior expected by the fd_filestat_get test.
We might end up being able to rename StreamType's Unknown variant to
Stdio, since it looks like that is the only place ... | diff --git a/src/lib.rs b/src/lib.rs
index de39e3e14..9d9a67e8a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -558,20 +558,46 @@ pub unsafe extern "C" fn fd_fdstat_set_rights(
pub unsafe extern "C" fn fd_filestat_get(fd: Fd, buf: *mut Filestat) -> Errno {
State::with(|state| {
let ds = state.descriptors();... | 1 | 40 | 14 |
85f0c680081a5c025d8278b43ccf889e23ed1103 | Trevor Elliott | 2023-04-10T23:28:52 | Add `only_interfaces` and `with` to the `bindgen!` macro. (#6160)
* Add `only_interfaces` and `with` to the `bindgen!` macro.
* Add a version of the empty_error test for `only_interfaces` and `with`
* Review feedback
* Add docs | diff --git a/crates/component-macro/src/bindgen.rs b/crates/component-macro/src/bindgen.rs
index 76e06c80d..2a813ef5f 100644
--- a/crates/component-macro/src/bindgen.rs
+++ b/crates/component-macro/src/bindgen.rs
@@ -1,4 +1,5 @@
use proc_macro2::{Span, TokenStream};
+use std::collections::HashMap;
use std::path::{Pat... | 5 | 257 | 8 |
4be0eb2eabf4c1f6937d9cf3fc43212b082981f0 | Dan Gohman | 2023-04-10T22:25:49 | Simplify the sockets implementation. (#135)
Use the new cap-net-ext crate to simplify the sockets implementation.
Instead of the `TcpSockImpl` enum and tracking the state of
socket->bind->listen->accept explicitly, these are now separate host
calls, which gives us better fidelity to the WASI API, and we don't
need... | diff --git a/host/Cargo.toml b/host/Cargo.toml
index 0bde58183..8e5941754 100644
--- a/host/Cargo.toml
+++ b/host/Cargo.toml
@@ -9,6 +9,7 @@ thiserror = { workspace = true }
async-trait = { workspace = true }
cap-std = { workspace = true }
cap-rand = { workspace = true }
+cap-net-ext = { workspace = true }
tokio = ... | 9 | 72 | 140 |
2078d1314b3e6b07d8e59c4ec85d765bb43fce6d | Pat Hickey | 2023-04-07T00:08:49 | fd_seek: return the expected errno when trying to seek on a directory. | diff --git a/src/lib.rs b/src/lib.rs
index be2448e9c..480ed2461 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1061,6 +1061,12 @@ pub unsafe extern "C" fn fd_seek(
// Seeking only works on files.
if let StreamType::File(file) = &stream.type_ {
+ match file.descriptor_type {
+ ... | 1 | 6 | 0 |
42431679aa1ecdee7e64ca5c74164e2cda6ac6f5 | Pat Hickey | 2023-04-07T00:08:49 | fd_seek: return the expected errno when trying to seek on a directory. | diff --git a/host/tests/command.rs b/host/tests/command.rs
index 9788c0249..ba1a83941 100644
--- a/host/tests/command.rs
+++ b/host/tests/command.rs
@@ -353,7 +353,7 @@ async fn run_dangling_symlink(store: Store<WasiCtx>, wasi: Command) -> Result<()
}
async fn run_directory_seek(store: Store<WasiCtx>, wasi: Command... | 1 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.