cargo-machete icon indicating copy to clipboard operation
cargo-machete copied to clipboard

Error about non-existing file that exists

Open lqd opened this issue 2 years ago • 2 comments

I was trying out machete on https://github.com/apollographql/apollo-rs and came upon a weird error: it tries to read fuzz/Cargo.toml and prints an OS error about that file not existing, but it does exist.

I've managed to reduce the issue to the cargo_toml manifest creation:

let path = std::path::Path::new("../apollo-rs/fuzz/Cargo.toml");
println!("path: {:?}, exists: {}", path, path.exists());
let manifest = cargo_toml::Manifest::from_path(path);
println!("file manifest: {:?}", manifest);

prints on this windows machine:

path: "../apollo-rs/fuzz/Cargo.toml", exists: true
file manifest: Err(Io(Os { code: 3, kind: NotFound, message: "Le chemin d’accès spécifié est introuvable." }))

So I guess parsing this specific manifest is trying to read other files, and opening them fails, but at this point the error lacks the context of which file it is ?

lqd avatar Nov 18 '21 19:11 lqd

Thanks for the report! Couldn't reproduce with a fresh build of cargo-machete on Linux. Did you install cargo-machete with cargo? If so, I might need to release a new version. Which OS are you using, out of curiosity?

bnjbvr avatar Nov 20 '21 13:11 bnjbvr

I just cloned machete as of 3 days ago, it was not cargo installed. The error occurred on windows and ubuntu under WSL, so I suspect it's some windows-related weirdness.

lqd avatar Nov 21 '21 18:11 lqd

Hey @lqd, does it still happen with the latest version?

bnjbvr avatar Nov 03 '22 16:11 bnjbvr

I'll check and report back.

lqd avatar Nov 03 '22 16:11 lqd

It does not. Let's close

lqd avatar Nov 03 '22 16:11 lqd

Thanks for checking :heart:

bnjbvr avatar Nov 03 '22 17:11 bnjbvr