-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows w64devkit: no version found for gcov #919
Comments
I run Line 76 in ebde263
The code in src/gcov.rs is pretty self-contained, so you can also extract it into a new Rust project and compile and run that if it's easier for you. |
I made the following change as requested to log the output. diff --git a/src/gcov.rs b/src/gcov.rs
index 9be3528..040f9fa 100644
--- a/src/gcov.rs
+++ b/src/gcov.rs
@@ -74,6 +74,7 @@ pub fn get_gcov_version() -> &'static Version {
.expect("Failed to execute `gcov`. `gcov` is required (it is part of GCC).");
assert!(output.status.success(), "`gcov` failed to execute.");
let output = String::from_utf8(output.stdout).unwrap();
+ println!("OUTPUT: {}", output);
parse_version(&output)
};
} I get the following output:
Making an additional change to run parse_version("gcov (GCC) 12.2.0"), diff --git a/src/gcov.rs b/src/gcov.rs
index 9be3528..4b344a1 100644
--- a/src/gcov.rs
+++ b/src/gcov.rs
@@ -74,7 +74,8 @@ pub fn get_gcov_version() -> &'static Version {
.expect("Failed to execute `gcov`. `gcov` is required (it is part of GCC).");
assert!(output.status.success(), "`gcov` failed to execute.");
let output = String::from_utf8(output.stdout).unwrap();
- parse_version(&output)
+ println!("OUTPUT: {}", output);
+ parse_version("gcov (GCC) 12.2.0")
};
}
&V produces the following error:
|
Could you try running the following on your machine? use semver::Version;
fn parse_version(gcov_output: &str) -> Version {
let mut versions: Vec<_> = gcov_output
.split(|c| c == ' ' || c == '\n')
.filter_map(|value| Version::parse(value).ok())
.collect();
assert!(!versions.is_empty(), "no version found for `gcov`.");
versions.pop().unwrap()
}
fn main() {
let gcov_output = "gcov (GCC) 12.2.0";
let mut versions: Vec<_> = gcov_output.split(|c| c == ' ' || c == '\n').collect();
let mut versions2: Vec<_> = gcov_output.split(|c| c == ' ' || c == '\n').map(|value| Version::parse(value)).collect();
println!("{:?}", versions);
println!("{:?}", versions2);
println!("{}", parse_version(gcov_output));
} The output should be:
|
I get the expected output.
|
That's weird, in your earlier test |
In my earlier test where I had
|
The weird thing is that you are not getting an error in the code I asked you to run, not even in the |
I just stumbled across this as well - it seems to be caused by Windows I implemented this fix and added a simple unit test for it in #1179. |
Hello. I am trying to use grcov within a w64devkit environment on Windows 10. w64devkit uses Mingw-w64 GCC, and includes gcov.
After compiling my project with
cc -g3 -O2 -std=c99 -Wall -Wextra --coverage -opeanut-mini peanut-mini.c
and running the project, I have the gcda and gcno files. I executegrcov . -s . -t html --branch -o .
but I get the following error message:When running
gcov --version
, I get:I'm not sure what the problem is or if I'm missing something.
Please find attached my project files. These files are MIT licensed.
project-grcov.zip
Thanks.
The text was updated successfully, but these errors were encountered: