Update Rust crate fs-err to v3 (#8625)

This commit is contained in:
renovate[bot] 2024-11-19 15:09:00 +00:00 committed by GitHub
parent 07806c404a
commit dae630ae50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 66 additions and 46 deletions

71
Cargo.lock generated
View File

@ -1155,6 +1155,15 @@ name = "fs-err"
version = "2.11.0" version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41"
dependencies = [
"autocfg",
]
[[package]]
name = "fs-err"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bb60e7409f34ef959985bc9d9c5ee8f5db24ee46ed9775850548021710f807f"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"tokio", "tokio",
@ -4108,7 +4117,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "382e025ef8e0db646343dd2cf56af9d7fe6f5eabce5f388f8e5ec7234f555a0f" checksum = "382e025ef8e0db646343dd2cf56af9d7fe6f5eabce5f388f8e5ec7234f555a0f"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"fs-err", "fs-err 2.11.0",
"itertools 0.13.0", "itertools 0.13.0",
"once_cell", "once_cell",
"rustc-hash", "rustc-hash",
@ -4401,7 +4410,7 @@ dependencies = [
"etcetera", "etcetera",
"filetime", "filetime",
"flate2", "flate2",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"http", "http",
"ignore", "ignore",
@ -4539,7 +4548,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"csv", "csv",
"flate2", "flate2",
"fs-err", "fs-err 3.0.0",
"globset", "globset",
"indoc", "indoc",
"insta", "insta",
@ -4571,7 +4580,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"anstream", "anstream",
"anyhow", "anyhow",
"fs-err", "fs-err 3.0.0",
"indoc", "indoc",
"insta", "insta",
"itertools 0.13.0", "itertools 0.13.0",
@ -4603,7 +4612,7 @@ name = "uv-cache"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"clap", "clap",
"fs-err", "fs-err 3.0.0",
"nanoid", "nanoid",
"rmp-serde", "rmp-serde",
"rustc-hash", "rustc-hash",
@ -4626,7 +4635,7 @@ dependencies = [
name = "uv-cache-info" name = "uv-cache-info"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"fs-err", "fs-err 3.0.0",
"globwalk", "globwalk",
"schemars", "schemars",
"serde", "serde",
@ -4652,7 +4661,7 @@ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
"clap_complete_command", "clap_complete_command",
"fs-err", "fs-err 3.0.0",
"insta", "insta",
"serde", "serde",
"url", "url",
@ -4680,7 +4689,7 @@ dependencies = [
"async_http_range_reader", "async_http_range_reader",
"async_zip", "async_zip",
"bytecheck", "bytecheck",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"html-escape", "html-escape",
"http", "http",
@ -4730,7 +4739,7 @@ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
"either", "either",
"fs-err", "fs-err 3.0.0",
"rustc-hash", "rustc-hash",
"schemars", "schemars",
"serde", "serde",
@ -4766,7 +4775,7 @@ dependencies = [
"anstream", "anstream",
"anyhow", "anyhow",
"clap", "clap",
"fs-err", "fs-err 3.0.0",
"itertools 0.13.0", "itertools 0.13.0",
"markdown", "markdown",
"owo-colors", "owo-colors",
@ -4838,7 +4847,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"either", "either",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"indoc", "indoc",
"insta", "insta",
@ -4898,7 +4907,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bitflags 2.6.0", "bitflags 2.6.0",
"fs-err", "fs-err 3.0.0",
"itertools 0.13.0", "itertools 0.13.0",
"jiff", "jiff",
"petgraph", "petgraph",
@ -4931,7 +4940,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"async-compression", "async-compression",
"async_zip", "async_zip",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"krata-tokio-tar", "krata-tokio-tar",
"md-5", "md-5",
@ -4958,7 +4967,7 @@ dependencies = [
"dunce", "dunce",
"either", "either",
"encoding_rs_io", "encoding_rs_io",
"fs-err", "fs-err 3.0.0",
"fs2", "fs2",
"junction", "junction",
"path-slash", "path-slash",
@ -4979,7 +4988,7 @@ dependencies = [
"anyhow", "anyhow",
"cargo-util", "cargo-util",
"dashmap", "dashmap",
"fs-err", "fs-err 3.0.0",
"reqwest", "reqwest",
"reqwest-middleware", "reqwest-middleware",
"serde", "serde",
@ -4998,7 +5007,7 @@ dependencies = [
name = "uv-globfilter" name = "uv-globfilter"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"fs-err", "fs-err 2.11.0",
"globset", "globset",
"insta", "insta",
"regex", "regex",
@ -5019,7 +5028,7 @@ dependencies = [
"configparser", "configparser",
"csv", "csv",
"data-encoding", "data-encoding",
"fs-err", "fs-err 3.0.0",
"indoc", "indoc",
"mailparse", "mailparse",
"pathdiff", "pathdiff",
@ -5056,7 +5065,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-channel", "async-channel",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"rayon", "rayon",
"rustc-hash", "rustc-hash",
@ -5101,7 +5110,7 @@ name = "uv-metadata"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"async_zip", "async_zip",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"thiserror 2.0.3", "thiserror 2.0.3",
"tokio", "tokio",
@ -5206,7 +5215,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"async-compression", "async-compression",
"base64 0.22.1", "base64 0.22.1",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"glob", "glob",
"insta", "insta",
@ -5272,7 +5281,7 @@ dependencies = [
"assert_fs", "assert_fs",
"clap", "clap",
"configparser", "configparser",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"goblin", "goblin",
"indoc", "indoc",
@ -5326,7 +5335,7 @@ dependencies = [
"anyhow", "anyhow",
"configparser", "configparser",
"console", "console",
"fs-err", "fs-err 3.0.0",
"futures", "futures",
"rustc-hash", "rustc-hash",
"serde", "serde",
@ -5359,7 +5368,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"assert_fs", "assert_fs",
"fs-err", "fs-err 3.0.0",
"indoc", "indoc",
"insta", "insta",
"itertools 0.13.0", "itertools 0.13.0",
@ -5440,7 +5449,7 @@ dependencies = [
name = "uv-scripts" name = "uv-scripts"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"fs-err", "fs-err 3.0.0",
"indoc", "indoc",
"memchr", "memchr",
"serde", "serde",
@ -5461,7 +5470,7 @@ dependencies = [
"assert_fs", "assert_fs",
"clap", "clap",
"etcetera", "etcetera",
"fs-err", "fs-err 3.0.0",
"indoc", "indoc",
"schemars", "schemars",
"serde", "serde",
@ -5503,7 +5512,7 @@ dependencies = [
name = "uv-state" name = "uv-state"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"fs-err", "fs-err 3.0.0",
"tempfile", "tempfile",
"uv-dirs", "uv-dirs",
] ]
@ -5519,7 +5528,7 @@ dependencies = [
name = "uv-tool" name = "uv-tool"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"fs-err", "fs-err 3.0.0",
"pathdiff", "pathdiff",
"serde", "serde",
"thiserror 2.0.3", "thiserror 2.0.3",
@ -5548,7 +5557,7 @@ dependencies = [
"anyhow", "anyhow",
"assert_cmd", "assert_cmd",
"assert_fs", "assert_fs",
"fs-err", "fs-err 3.0.0",
"thiserror 2.0.3", "thiserror 2.0.3",
"uv-fs", "uv-fs",
"which", "which",
@ -5583,7 +5592,7 @@ version = "0.5.2"
name = "uv-virtualenv" name = "uv-virtualenv"
version = "0.0.4" version = "0.0.4"
dependencies = [ dependencies = [
"fs-err", "fs-err 3.0.0",
"itertools 0.13.0", "itertools 0.13.0",
"pathdiff", "pathdiff",
"thiserror 2.0.3", "thiserror 2.0.3",
@ -5611,7 +5620,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"assert_fs", "assert_fs",
"fs-err", "fs-err 3.0.0",
"glob", "glob",
"insta", "insta",
"itertools 0.13.0", "itertools 0.13.0",
@ -5867,7 +5876,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [ dependencies = [
"windows-sys 0.48.0", "windows-sys 0.59.0",
] ]
[[package]] [[package]]

View File

@ -98,7 +98,7 @@ either = { version = "1.13.0" }
encoding_rs_io = { version = "0.1.7" } encoding_rs_io = { version = "0.1.7" }
etcetera = { version = "0.8.0" } etcetera = { version = "0.8.0" }
flate2 = { version = "1.0.33", default-features = false } flate2 = { version = "1.0.33", default-features = false }
fs-err = { version = "2.11.0" } fs-err = { version = "3.0.0" }
fs2 = { version = "0.4.3" } fs2 = { version = "0.4.3" }
futures = { version = "0.3.30" } futures = { version = "0.3.30" }
glob = { version = "0.3.1" } glob = { version = "0.3.1" }

View File

@ -43,5 +43,5 @@ workspace = true
[dev-dependencies] [dev-dependencies]
indoc = { version = "2.0.5" } indoc = { version = "2.0.5" }
insta = { version = "1.40.0" } insta = { version = "1.40.0", features = ["filters"] }
tempfile = { version = "3.12.0" } tempfile = { version = "3.12.0" }

View File

@ -1022,8 +1022,15 @@ mod tests {
.unwrap() .unwrap()
.to_metadata(Path::new("/do/not/read")) .to_metadata(Path::new("/do/not/read"))
.unwrap_err(); .unwrap_err();
// Simplified for windows compatibility. // Strip away OS specific part.
assert_snapshot!(err.to_string().replace('\\', "/"), @"failed to open file `/do/not/read/Readme.md`"); let err = err
.to_string()
.replace('\\', "/")
.split_once(':')
.unwrap()
.0
.to_string();
assert_snapshot!(err, @"failed to open file `/do/not/read/Readme.md`");
} }
#[test] #[test]

View File

@ -1406,13 +1406,19 @@ mod test {
let filters = vec![ let filters = vec![
(requirement_txt.as_str(), "<REQUIREMENTS_TXT>"), (requirement_txt.as_str(), "<REQUIREMENTS_TXT>"),
(missing_txt.as_str(), "<MISSING_TXT>"), (missing_txt.as_str(), "<MISSING_TXT>"),
// Windows translates error messages, for example i get:
// "Das System kann den angegebenen Pfad nicht finden. (os error 3)"
(
r": .* \(os error 2\)",
": The system cannot find the path specified. (os error 2)",
),
]; ];
insta::with_settings!({ insta::with_settings!({
filters => filters, filters => filters,
}, { }, {
insta::assert_snapshot!(errors, @r###" insta::assert_snapshot!(errors, @r###"
Error parsing included file in `<REQUIREMENTS_TXT>` at position 0 Error parsing included file in `<REQUIREMENTS_TXT>` at position 0
failed to read from file `<MISSING_TXT>` failed to read from file `<MISSING_TXT>`: The system cannot find the path specified. (os error 2)
"###); "###);
}); });

View File

@ -187,9 +187,9 @@ dependencies = [
[[package]] [[package]]
name = "fs-err" name = "fs-err"
version = "2.11.0" version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" checksum = "8bb60e7409f34ef959985bc9d9c5ee8f5db24ee46ed9775850548021710f807f"
dependencies = [ dependencies = [
"autocfg", "autocfg",
] ]

View File

@ -56,7 +56,7 @@ embed-manifest = "1.4.0"
anyhow = { version = "1.0.80" } anyhow = { version = "1.0.80" }
assert_cmd = { version = "2.0.14" } assert_cmd = { version = "2.0.14" }
assert_fs = { version = "1.1.1" } assert_fs = { version = "1.1.1" }
fs-err = { version = "2.11.0" } fs-err = { version = "3.0.0" }
thiserror = { version = "2.0.0" } thiserror = { version = "2.0.0" }
which = { version = "7.0.0" } which = { version = "7.0.0" }
zip = { version = "0.6.6", default-features = false, features = ["deflate"] } zip = { version = "0.6.6", default-features = false, features = ["deflate"] }

View File

@ -2850,8 +2850,7 @@ fn run_script_explicit_directory() -> Result<()> {
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
error: failed to read from file `script` error: failed to read from file `script`: Is a directory (os error 21)
Caused by: Is a directory (os error 21)
"###); "###);
Ok(()) Ok(())

View File

@ -1067,10 +1067,10 @@ fn path_with_trailing_space_gives_proper_error() {
let path_with_trailing_slash = format!("{} ", context.cache_dir.path().display()); let path_with_trailing_slash = format!("{} ", context.cache_dir.path().display());
let mut filters = context.filters(); let mut filters = context.filters();
// Windows translates error messages, for example i get: // Windows translates error messages, for example i get:
// "Caused by: Das System kann den angegebenen Pfad nicht finden. (os error 3)" // ": Das System kann den angegebenen Pfad nicht finden. (os error 3)"
filters.push(( filters.push((
r"Caused by: .* \(os error 3\)", r"CACHEDIR.TAG`: .* \(os error 3\)",
"Caused by: The system cannot find the path specified. (os error 3)", "CACHEDIR.TAG`: The system cannot find the path specified. (os error 3)",
)); ));
uv_snapshot!(filters, std::process::Command::new(crate::common::get_bin()) uv_snapshot!(filters, std::process::Command::new(crate::common::get_bin())
.arg("venv") .arg("venv")
@ -1080,8 +1080,7 @@ fn path_with_trailing_space_gives_proper_error() {
----- stdout ----- ----- stdout -----
----- stderr ----- ----- stderr -----
error: failed to open file `[CACHE_DIR]/ /CACHEDIR.TAG` error: failed to open file `[CACHE_DIR]/ /CACHEDIR.TAG`: The system cannot find the path specified. (os error 3)
Caused by: The system cannot find the path specified. (os error 3)
"### "###
); );
// Note the extra trailing `/` in the snapshot is due to the filters, not the actual output. // Note the extra trailing `/` in the snapshot is due to the filters, not the actual output.