Closed eminence closed 1 year ago
Huh interesting, just for completeness this runs fine on windows with just cargo test
right?
Yup. That is, running cargo test
from within the foo
project is successful on Windows
(and cargo test --manifest-path d:\temp\lxd\37\foo\Cargo.toml
is successful too, as expected)
Running into the same problem with a workspace that contains multiple sub projects
cargo tarpaulin --command test --workspace --locked --out xml
Nov 07 22:26:19.942 INFO cargo_tarpaulin::config: Creating config
Nov 07 22:26:20.051 WARN cargo_tarpaulin::config: Couldn't get project metadata `cargo metadata` exited with an error: error: failed to load manifest for workspace member `\\?\C:\<workspace root>\lib\*`
Caused by:
failed to read `\\?\C:\<workspace root>\lib\*\Cargo.toml`
Caused by:
The filename, directory name, or volume label syntax is incorrect. (os error 123)
Nov 07 22:26:20.083 WARN cargo_tarpaulin::config: Couldn't get project metadata `cargo metadata` exited with an error: error: failed to load manifest for workspace member `\\?\C:\<workspace root>\lib\*`
Caused by:
failed to read `\\?\C:\<workspace root>\lib\*\Cargo.toml`
Caused by:
The filename, directory name, or volume label syntax is incorrect. (os error 123)
Nov 07 22:26:20.083 INFO cargo_tarpaulin: Running Tarpaulin
Nov 07 22:26:20.083 INFO cargo_tarpaulin: Building project
Nov 07 22:26:20.117 WARN cargo_tarpaulin::config: Couldn't get project metadata `cargo metadata` exited with an error: error: failed to load manifest for workspace member `\\?\C:\<workspace root>\lib\*`
Caused by:
failed to read `\\?\C:\<workspace root>\lib\*\Cargo.toml`
Caused by:
The filename, directory name, or volume label syntax is incorrect. (os error 123)
Nov 07 22:26:20.118 INFO cargo_tarpaulin::cargo: Cleaning project
Nov 07 22:26:20.144 ERROR cargo_tarpaulin: Cargo failed to run! Error: `cargo metadata` exited with an error: error: failed to load manifest for workspace member `\\?\C:\<workspace root>\lib\*`
Caused by:
failed to read `\\?\C:\Proj\P2000\2way-paging-core\lib\*\Cargo.toml`
Caused by:
The filename, directory name, or volume label syntax is incorrect. (os error 123)
Error: "Cargo failed to run! Error: `cargo metadata` exited with an error: error: failed to load manifest for workspace member `\\\\?\\C:\\<workspace root>\\lib\\*`\n\nCaused by:\n failed to read `\\\\?\\C:\\<workspace root>\\lib\\*\\Cargo.toml`\n\nCaused by:\n The filename, directory name, or volume label syntax is incorrect. (os error 123)\n"
cargo test
Works fine and all test are successfulCargo.toml
Ugh I don't really use windows so this might take a bit of work, but it seems that issue might be because https://github.com/xd009642/tarpaulin/blob/develop/src/path_utils.rs#L9-L20 needs to be applied more liberally to paths in tarpaulin. Why I need to do fix paths in this way I have no idea - maybe someone who uses windows could chip in?
I guess applying some debug printouts here https://github.com/xd009642/tarpaulin/blob/develop/src/cargo.rs#L227 and seeing if unc paths need fixing and then going from there. Kinda curious how it doesn't flag as an issue in tarpaulin's tests :thinking:
@eminence if you try the latest release this should hopefully now work - a lot of windows issues tackled in this one :smile:
@xd009642 thank you! I tested the above scenario with the latest develop branch (8822e5d36300f24265eb51a46bfa0b38f62aeb34) and things are now working as expected 🎉
Awesome, latest develop is also same as 0.24.0 release so can install from crates.io or use binstall etc as well if you prefer :smile:
Describe the bug When testing (with tarpaulin) a project that has a dependency on
rustc_version_runtime
, a build error prevents tests from running. This happens only on Windows.To Reproduce First, create a new empty library, and add the problematic dependency:
Then try to run tarpaulin. I've reproduced with the latest 0.22.0 release, and the latest
develop
branch (78bdb600377e3d47ba9ecce60ada884914626b97). In the transcript below, I am running from the latestdevelop
branch:Note that the file in question (
\\?\D:\temp\lxd\37\foo\target\debug\build\rustc_version_runtime-b7fa740ad9722d3b\out/version.rs
) does in fact exist,Expected behavior I expected the tests in the
foo
lib to be run, hopefully with coverage data generated : )Rust version