Skip to content

Commit

Permalink
Update several dependencies. (#6171)
Browse files Browse the repository at this point in the history
This updates to rustix 0.37.13, which contains some features we can use to
implement more features in wasi-common for the wasi-sockets API. This also
pulls in several other updates to avoid having multiple versions of rustix.

This does introduce multiple versions of windows-sys, as the errno and tokio
crates are currently using 0.45 while rustix and other dependencies have
updated to 0.48; PRs updating these are already in flight so this will
hopefully be resolved soon.

It also includes cap-std 1.0.14, which disables the use of `openat2` and
`statx` on Android, fixing a bug where some Android devices crash the
process when those syscalls are executed.
  • Loading branch information
sunfishcode authored Apr 20, 2023
1 parent f89ac63 commit c59bb8d
Show file tree
Hide file tree
Showing 10 changed files with 366 additions and 100 deletions.
236 changes: 151 additions & 85 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ wasm-encoder = "0.25.0"
wasm-smith = "0.12.6"
wasm-mutate = "0.2.23"
wit-parser = "0.7.0"
windows-sys = "0.45.0"
env_logger = "0.9"
rustix = "0.36.7"
windows-sys = "0.48.0"
env_logger = "0.10"
rustix = "0.37.13"
log = { version = "0.4.8", default-features = false }
object = { version = "0.30.3", default-features = false, features = ['read_core', 'elf', 'std'] }
gimli = { version = "0.27.0", default-features = false, features = ['read', 'std'] }
Expand Down
4 changes: 2 additions & 2 deletions cranelift/jit/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ fn lookup_with_dlsym(name: &str) -> Option<*const u8> {
#[cfg(windows)]
fn lookup_with_dlsym(name: &str) -> Option<*const u8> {
use std::os::windows::io::RawHandle;
use windows_sys::Win32::Foundation::HINSTANCE;
use windows_sys::Win32::Foundation::HMODULE;
use windows_sys::Win32::System::LibraryLoader;

const UCRTBASE: &[u8] = b"ucrtbase.dll\0";
Expand All @@ -948,7 +948,7 @@ fn lookup_with_dlsym(name: &str) -> Option<*const u8> {
];

for handle in &handles {
let addr = LibraryLoader::GetProcAddress(*handle as HINSTANCE, c_str_ptr.cast());
let addr = LibraryLoader::GetProcAddress(*handle as HMODULE, c_str_ptr.cast());
match addr {
None => continue,
Some(addr) => return Some(addr as *const u8),
Expand Down
4 changes: 2 additions & 2 deletions crates/runtime/src/mmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl Mmap {
0,
0,
len,
);
) as *mut std::ffi::c_void;
let err = io::Error::last_os_error();
CloseHandle(mapping);
if ptr.is_null() {
Expand Down Expand Up @@ -492,7 +492,7 @@ impl Drop for Mmap {
let r = unsafe { VirtualFree(self.ptr as *mut c_void, 0, MEM_RELEASE) };
assert_ne!(r, 0);
} else {
let r = unsafe { UnmapViewOfFile(self.ptr as *mut c_void) };
let r = unsafe { UnmapViewOfFile(self.ptr as MEMORYMAPPEDVIEW_HANDLE) };
assert_ne!(r, 0);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ unsafe fn test_unlink_file_trailing_slashes(dir_fd: wasi::Fd) {
assert_errno!(
wasi::path_unlink_file(dir_fd, "file/")
.expect_err("unlink_file with a trailing slash should fail"),
unix => wasi::ERRNO_NOTDIR,
windows => wasi::ERRNO_NOENT
wasi::ERRNO_NOTDIR
);

// Test that unlinking it with no trailing flash succeeds.
Expand Down
2 changes: 1 addition & 1 deletion crates/wasi-common/cap-std-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cap-std = { workspace = true }
cap-fs-ext = "1.0.0"
cap-time-ext = "1.0.0"
cap-rand = { workspace = true }
fs-set-times = "0.18.0"
fs-set-times = "0.19.0"
system-interface = { version = "0.25.0", features = ["cap_std_impls"] }
tracing = { workspace = true }
io-lifetimes = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ skip-tree = [
# The native-tls crate hasn't kept up with updates to the underlying
# windows-sys, while the rest of the ecosystem has. This duplicated
# dependency appears to be benign.
{ name = "windows-sys", depth = 2 },
{ name = "windows-sys", depth = 3 },
]
Loading

0 comments on commit c59bb8d

Please sign in to comment.