Skip to content

Commit

Permalink
Update to cap-std 0.22.0. (#3611)
Browse files Browse the repository at this point in the history
* Update to cap-std 0.22.0.

The main change relevant to Wasmtime here is that this includes the
rustix fix for compilation errors on Rust nightly with the `asm!` macro.

* Add itoa to deny.toml.

* Update the doc and fuzz builds to the latest Rust nightly.

* Update to libc 0.2.112 to pick up the `POLLRDHUP` fix.

* Update to cargo-fuzz 0.11, for compatibility with Rust nightly.

This appears to be the fix for rust-fuzz/cargo-fuzz#277.
  • Loading branch information
sunfishcode authored Dec 17, 2021
1 parent e94ebc2 commit 7b346b1
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 69 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
submodules: true
- uses: ./.github/actions/install-rust
with:
toolchain: nightly-2021-07-18
toolchain: nightly-2021-12-15

# Build C API documentation
- run: sudo apt-get update -y && sudo apt-get install -y libclang1-9 libclang-cpp9
Expand Down Expand Up @@ -180,8 +180,8 @@ jobs:
# flags to rustc.
- uses: ./.github/actions/install-rust
with:
toolchain: nightly-2021-07-18
- run: cargo install cargo-fuzz --vers "^0.8"
toolchain: nightly-2021-12-15
- run: cargo install cargo-fuzz --vers "^0.11"
# Install OCaml packages necessary for 'differential_spec' fuzz target.
- run: sudo apt install -y ocaml-nox ocamlbuild
- run: cargo fetch
Expand Down
70 changes: 35 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ wasmparser = "0.81.0"
lazy_static = "1.4.0"

[target.'cfg(unix)'.dependencies]
rustix = "0.26.2"
rustix = "0.31.0"

[dev-dependencies]
env_logger = "0.8.1"
Expand Down
2 changes: 1 addition & 1 deletion crates/bench-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ wasmtime-wasi = { path = "../wasi" }
wasmtime-wasi-crypto = { path = "../wasi-crypto", optional = true }
wasmtime-wasi-nn = { path = "../wasi-nn", optional = true }
wasi-cap-std-sync = { path = "../wasi-common/cap-std-sync" }
cap-std = "0.21.1"
cap-std = "0.22.0"

[dev-dependencies]
wat = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions crates/bench-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,20 +272,20 @@ pub extern "C" fn wasm_bench_create(

let stdout = std::fs::File::create(&stdout_path)
.with_context(|| format!("failed to create {}", stdout_path.display()))?;
let stdout = cap_std::fs::File::from_std(stdout, cap_std::ambient_authority());
let stdout = cap_std::fs::File::from_std(stdout);
let stdout = wasi_cap_std_sync::file::File::from_cap_std(stdout);
cx = cx.stdout(Box::new(stdout));

let stderr = std::fs::File::create(&stderr_path)
.with_context(|| format!("failed to create {}", stderr_path.display()))?;
let stderr = cap_std::fs::File::from_std(stderr, cap_std::ambient_authority());
let stderr = cap_std::fs::File::from_std(stderr);
let stderr = wasi_cap_std_sync::file::File::from_cap_std(stderr);
cx = cx.stderr(Box::new(stderr));

if let Some(stdin_path) = &stdin_path {
let stdin = std::fs::File::open(stdin_path)
.with_context(|| format!("failed to open {}", stdin_path.display()))?;
let stdin = cap_std::fs::File::from_std(stdin, cap_std::ambient_authority());
let stdin = cap_std::fs::File::from_std(stdin);
let stdin = wasi_cap_std_sync::file::File::from_cap_std(stdin);
cx = cx.stdin(Box::new(stdin));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/c-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ wat = { version = "1.0.36", optional = true }
# Optional dependencies for the `wasi` feature
wasi-cap-std-sync = { path = "../wasi-common/cap-std-sync", optional = true }
wasmtime-wasi = { path = "../wasi", optional = true }
cap-std = { version = "0.21.1", optional = true }
cap-std = { version = "0.22.0", optional = true }

[features]
default = ['jitdump', 'wat', 'wasi', 'cache']
Expand Down
6 changes: 3 additions & 3 deletions crates/c-api/src/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ impl wasi_config_t {
if self.inherit_stdin {
builder = builder.inherit_stdin();
} else if let Some(file) = self.stdin {
let file = cap_std::fs::File::from_std(file, ambient_authority());
let file = cap_std::fs::File::from_std(file);
let file = wasi_cap_std_sync::file::File::from_cap_std(file);
builder = builder.stdin(Box::new(file));
}
if self.inherit_stdout {
builder = builder.inherit_stdout();
} else if let Some(file) = self.stdout {
let file = cap_std::fs::File::from_std(file, ambient_authority());
let file = cap_std::fs::File::from_std(file);
let file = wasi_cap_std_sync::file::File::from_cap_std(file);
builder = builder.stdout(Box::new(file));
}
if self.inherit_stderr {
builder = builder.inherit_stderr();
} else if let Some(file) = self.stderr {
let file = cap_std::fs::File::from_std(file, ambient_authority());
let file = cap_std::fs::File::from_std(file);
let file = wasi_cap_std_sync::file::File::from_cap_std(file);
builder = builder.stderr(Box::new(file));
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ zstd = { version = "0.9", default-features = false }
winapi = "0.3.7"

[target.'cfg(not(target_os = "windows"))'.dependencies]
rustix = "0.26.2"
rustix = "0.31.0"

[dev-dependencies]
filetime = "0.2.7"
Expand Down
2 changes: 1 addition & 1 deletion crates/fiber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ edition = "2018"
links = "wasmtime-fiber-shims"

[target.'cfg(unix)'.dependencies]
rustix = "0.26.2"
rustix = "0.31.0"

[target.'cfg(windows)'.dependencies.winapi]
version = "0.3.9"
Expand Down
2 changes: 1 addition & 1 deletion crates/jit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bincode = "1.2.1"
winapi = { version = "0.3.8", features = ["winnt", "impl-default"] }

[target.'cfg(target_os = "linux")'.dependencies]
rustix = { version = "0.26.2", optional = true }
rustix = { version = "0.31.0", optional = true }

[features]
jitdump = ['rustix']
Expand Down
4 changes: 2 additions & 2 deletions crates/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ edition = "2018"
wasmtime-environ = { path = "../environ", version = "=0.32.0" }
wasmtime-fiber = { path = "../fiber", version = "=0.32.0", optional = true }
region = "2.1.0"
libc = { version = "0.2.82", default-features = false }
libc = { version = "0.2.112", default-features = false }
log = "0.4.8"
memoffset = "0.6.0"
indexmap = "1.0.2"
Expand All @@ -30,7 +30,7 @@ anyhow = "1.0.38"
mach = "0.3.2"

[target.'cfg(unix)'.dependencies]
rustix = "0.26.2"
rustix = "0.31.0"

[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0.3.7", features = ["winbase", "memoryapi", "errhandlingapi", "handleapi"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/test-programs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tempfile = "3.1.0"
os_pipe = "0.9"
anyhow = "1.0.19"
wat = "1.0.37"
cap-std = "0.21.1"
cap-std = "0.22.0"
tokio = { version = "1.8.0", features = ["rt-multi-thread"] }

[features]
Expand Down
6 changes: 3 additions & 3 deletions crates/wasi-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ anyhow = "1.0"
thiserror = "1.0"
wiggle = { path = "../wiggle", default-features = false, version = "=0.32.0" }
tracing = "0.1.19"
cap-std = "0.21.1"
cap-rand = "0.21.1"
cap-std = "0.22.0"
cap-rand = "0.22.0"
bitflags = "1.2"

[target.'cfg(unix)'.dependencies]
rustix = "0.26.2"
rustix = "0.31.0"

[target.'cfg(windows)'.dependencies]
winapi = "0.3"
Expand Down
Loading

0 comments on commit 7b346b1

Please sign in to comment.