From ba89842a234ea2f474d3ff2eba5bea464f18e2a2 Mon Sep 17 00:00:00 2001 From: Schneems Date: Mon, 17 Nov 2025 21:26:47 -0600 Subject: [PATCH] Enable path debug in filesystem error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before: ``` failed to open file `file.txt`: The system cannot find the file specified. (os error 2) ``` After (with `debug` feature): ``` failed to open file `file.txt`: The system cannot find the file specified. (os error 2) Path does not exist `file.txt` - Absolute path `/path/to/dir/file.txt` - Missing `file.txt` from parent directory: `/path/to/dir` └── `file.md` └── `different.txt` ``` --- Cargo.lock | 45 ++++++++++++++++++++++++++++++++++++--------- Cargo.toml | 2 +- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7a0964..201aa4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,6 +139,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.9.0" @@ -383,6 +389,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "faccess" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ae66425802d6a903e268ae1a08b8c38ba143520f227a205edf4e9c7e3e26d5" +dependencies = [ + "bitflags 1.3.2", + "libc", + "winapi", +] + [[package]] name = "fancy-regex" version = "0.13.0" @@ -454,11 +471,12 @@ dependencies = [ [[package]] name = "fs-err" -version = "3.1.3" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad492b2cf1d89d568a43508ab24f98501fe03f2f31c01e1d0fe7366a71745d2" +checksum = "62d91fd049c123429b018c47887d3f75a265540dd3c30ba9cb7bae9197edb03a" dependencies = [ "autocfg", + "path_facts", ] [[package]] @@ -1018,7 +1036,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags", + "bitflags 2.9.0", "libc", "redox_syscall", ] @@ -1137,7 +1155,7 @@ version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ - "bitflags", + "bitflags 2.9.0", "cfg-if", "foreign-types", "libc", @@ -1175,6 +1193,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "path_facts" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9b66f6b972fe319c6911bb86fb9d9fc76558051d0fdcf5b8755c2cfbc79910a" +dependencies = [ + "faccess", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1253,7 +1280,7 @@ version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags", + "bitflags 2.9.0", ] [[package]] @@ -1380,7 +1407,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f8dcd64f141950290e45c99f7710ede1b600297c91818bb30b3667c0f45dc0" dependencies = [ - "bitflags", + "bitflags 2.9.0", "errno", "libc", "linux-raw-sys", @@ -1453,7 +1480,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags", + "bitflags 2.9.0", "core-foundation", "core-foundation-sys", "libc", @@ -1674,7 +1701,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags", + "bitflags 2.9.0", "core-foundation", "system-configuration-sys", ] @@ -2352,7 +2379,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags", + "bitflags 2.9.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d7dfa31..401f3b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ bullet_stream = "0.11" chrono = {version = "0.4", features = ["serde"] } clap = { version = "4.5", features = ["derive"] } flate2 = "1" -fs-err = "3" +fs-err = { version = "3", features = ["debug"] } fs2 = "0.4" fun_run = "0.6" gem_version = "0.3"