Skip to content

Commit 5624f5b

Browse files
authored
Update to io-lifetimes 0.7.0.
io-lifetimes needed a semver bump due to `BorrowedFd::borrow_raw_fd` being renamed to `BorrowedFd::borrow_raw`, to match the corresponding change in std. cap-std doesn't use this function itself, but since it's a semver bump, we need to bump it in cap-std so that it uses the new trait versions. This also updates to [rustix 0.35]: [rustix 0.35]: https://github.com/bytecodealliance/rustix/releases/tag/v0.35.6
1 parent 9ea3b3a commit 5624f5b

30 files changed

+117
-112
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ rand = "0.8.1"
2626
tempfile = "3.1.0"
2727
camino = "1.0.5"
2828
libc = "0.2.100"
29-
io-lifetimes = "0.5.1"
29+
io-lifetimes = "0.7.0"
3030

3131
[target.'cfg(not(windows))'.dev-dependencies]
32-
rustix = "0.33.0"
32+
rustix = { version = "0.35.6", features = ["fs"] }
3333

3434
[target.'cfg(windows)'.dev-dependencies]
3535
# nt_version uses internal Windows APIs, however we're only using it
3636
# for testing here.
3737
nt_version = "0.1.3"
38-
winapi = "0.3.9"
38+
winapi = { version = "0.3.9", features = ["winioctl"] }
3939

4040
[features]
4141
default = []

cap-async-std/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ repository = "https://github.com/bytecodealliance/cap-std"
1313
edition = "2018"
1414

1515
[dependencies]
16-
arf-strings = { version = "0.6.3", optional = true }
16+
arf-strings = { version = "0.6.7", optional = true }
1717
# Enable "unstable" for `spawn_blocking`.
1818
async-std = { version = "1.10.0", features = ["attributes", "unstable"] }
1919
cap-primitives = { path = "../cap-primitives", version = "^0.24.1-alpha.0"}
20-
io-lifetimes = { version = "0.5.1", default-features = false, features = ["async-std"] }
20+
io-lifetimes = { version = "0.7.0", default-features = false, features = ["async-std"] }
2121
ipnet = "2.3.0"
22-
io-extras = { version = "0.13.0", features = ["use_async_std"] }
22+
io-extras = { version = "0.15.0", features = ["use_async_std"] }
2323
camino = { version = "1.0.5", optional = true }
2424

2525
[target.'cfg(not(windows))'.dependencies]
26-
rustix = "0.33.0"
26+
rustix = { version = "0.35.6", features = ["fs"] }
2727

2828
[features]
2929
default = []

cap-async-std/src/fs_utf8/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn to_utf8<P: AsRef<async_std::path::Path>>(path: P) -> std::io::Result<Utf8Path
5555
#[cfg(not(windows))]
5656
{
5757
Ok(Utf8Path::from_path(path.as_ref().into())
58-
.ok_or_else(|| ::rustix::io::Error::ILSEQ)?
58+
.ok_or_else(|| ::rustix::io::Errno::ILSEQ)?
5959
.to_path_buf())
6060
}
6161

cap-directories/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cap-std = { path = "../cap-std", version = "^0.24.1-alpha.0"}
1717
directories-next = "2.0.0"
1818

1919
[target.'cfg(not(windows))'.dependencies]
20-
rustix = "0.33.0"
20+
rustix = { version = "0.35.6" }
2121

2222
[target.'cfg(windows)'.dependencies]
2323
winapi = "0.3.9"

cap-directories/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub use user_dirs::UserDirs;
2222

2323
#[cfg(not(windows))]
2424
pub(crate) fn not_found() -> io::Error {
25-
rustix::io::Error::NOENT.into()
25+
rustix::io::Errno::NOENT.into()
2626
}
2727

2828
#[cfg(windows)]

cap-fs-ext/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ repository = "https://github.com/bytecodealliance/cap-std"
1313
edition = "2018"
1414

1515
[dependencies]
16-
arf-strings = { version = "0.6.3", optional = true }
16+
arf-strings = { version = "0.6.7", optional = true }
1717
cap-async-std = { path = "../cap-async-std", optional = true, version = "^0.24.1-alpha.0"}
1818
cap-std = { path = "../cap-std", optional = true, version = "^0.24.1-alpha.0"}
1919
cap-primitives = { path = "../cap-primitives", version = "^0.24.1-alpha.0"}
20-
io-lifetimes = { version = "0.5.1", default-features = false }
20+
io-lifetimes = { version = "0.7.0", default-features = false }
2121
# Enable "unstable" for `spawn_blocking`.
2222
async-std = { version = "1.10.0", features = ["attributes", "unstable"], optional = true }
2323
async-trait = { version = "0.1.42", optional = true }

cap-primitives/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ ambient-authority = "0.0.1"
1717
arbitrary = { version = "1.0.0", optional = true, features = ["derive"] }
1818
ipnet = "2.3.0"
1919
maybe-owned = "0.3.4"
20-
fs-set-times = "0.15.0"
21-
io-extras = "0.13.0"
22-
io-lifetimes = { version = "0.5.1", default-features = false }
20+
fs-set-times = "0.17.0"
21+
io-extras = "0.15.0"
22+
io-lifetimes = { version = "0.7.0", default-features = false }
2323

2424
[target.'cfg(not(windows))'.dependencies]
25-
rustix = { version = "0.33.0", features = ["procfs"] }
25+
rustix = { version = "0.35.6", features = ["fs", "process", "procfs", "termios", "time"] }
2626

2727
[target.'cfg(target_os = "macos")'.dependencies]
2828
errno = { version = "0.2.8", default-features = false }
@@ -31,6 +31,6 @@ errno = { version = "0.2.8", default-features = false }
3131
errno = { version = "0.2.8", default-features = false }
3232

3333
[target.'cfg(windows)'.dependencies]
34-
winx = "0.31.0"
34+
winx = "0.33.0"
3535
winapi = "0.3.9"
3636
winapi-util = "0.1.5"

cap-primitives/src/rustix/fs/copy_impl.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,24 @@ pub(crate) fn copy_impl(
120120
let copy_result = copy_file_range(&reader, None, &writer, None, bytes_to_copy);
121121
if let Err(copy_err) = copy_result {
122122
match copy_err {
123-
rustix::io::Error::NOSYS | rustix::io::Error::PERM => {
123+
rustix::io::Errno::NOSYS | rustix::io::Errno::PERM => {
124124
HAS_COPY_FILE_RANGE.store(false, Ordering::Relaxed);
125125
}
126126
_ => {}
127127
}
128128
}
129129
copy_result
130130
} else {
131-
Err(rustix::io::Error::NOSYS.into())
131+
Err(rustix::io::Errno::NOSYS.into())
132132
};
133133
match copy_result {
134134
Ok(ret) => written += ret as u64,
135135
Err(err) => {
136136
match err {
137-
rustix::io::Error::NOSYS
138-
| rustix::io::Error::XDEV
139-
| rustix::io::Error::INVAL
140-
| rustix::io::Error::PERM => {
137+
rustix::io::Errno::NOSYS
138+
| rustix::io::Errno::XDEV
139+
| rustix::io::Errno::INVAL
140+
| rustix::io::Errno::PERM => {
141141
// Try fallback io::copy if either:
142142
// - Kernel version is < 4.5 (ENOSYS)
143143
// - Files are mounted on different fs (EXDEV)
@@ -193,10 +193,10 @@ pub(crate) fn copy_impl(
193193
// destination already exists, or if the source and destination
194194
// are on different devices. In all these cases `fcopyfile`
195195
// should succeed.
196-
rustix::io::Error::NOTSUP | rustix::io::Error::EXIST | rustix::io::Error::XDEV => {
196+
rustix::io::Errno::NOTSUP | rustix::io::Errno::EXIST | rustix::io::Errno::XDEV => {
197197
()
198198
}
199-
rustix::io::Error::NOSYS => HAS_FCLONEFILEAT.store(false, Ordering::Relaxed),
199+
rustix::io::Errno::NOSYS => HAS_FCLONEFILEAT.store(false, Ordering::Relaxed),
200200
_ => return Err(err.into()),
201201
},
202202
}

cap-primitives/src/rustix/fs/errors.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ use std::io;
22

33
#[cold]
44
pub(crate) fn invalid_flags() -> io::Error {
5-
rustix::io::Error::INVAL.into()
5+
rustix::io::Errno::INVAL.into()
66
}
77

88
#[cold]
99
pub(crate) fn no_such_file_or_directory() -> io::Error {
10-
rustix::io::Error::NOENT.into()
10+
rustix::io::Errno::NOENT.into()
1111
}
1212

1313
#[cold]
1414
pub(crate) fn is_directory() -> io::Error {
15-
rustix::io::Error::ISDIR.into()
15+
rustix::io::Errno::ISDIR.into()
1616
}
1717

1818
#[cold]
1919
pub(crate) fn is_not_directory() -> io::Error {
20-
rustix::io::Error::NOTDIR.into()
20+
rustix::io::Errno::NOTDIR.into()
2121
}
2222

2323
#[cold]
2424
pub(crate) fn too_many_symlinks() -> io::Error {
25-
rustix::io::Error::LOOP.into()
25+
rustix::io::Errno::LOOP.into()
2626
}

cap-primitives/src/rustix/fs/file_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::fs::file_path_by_searching;
22
#[cfg(not(any(target_os = "wasi", target_os = "fuchsia")))]
3-
use rustix::io::ttyname;
3+
use rustix::termios::ttyname;
44
#[cfg(not(any(target_os = "wasi", target_os = "fuchsia")))]
55
use std::ffi::OsString;
66
use std::fs;

0 commit comments

Comments
 (0)