Skip to content
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

Parsing failed on Windows 11 #1282

Closed
strowk opened this issue May 10, 2023 · 7 comments
Closed

Parsing failed on Windows 11 #1282

strowk opened this issue May 10, 2023 · 7 comments
Assignees

Comments

@strowk
Copy link

strowk commented May 10, 2023

Describe the bug
I run cargo tarpaulin and receive error Error: "Parsing failed".
I am using Windows 11 and run this from Git Bash.

Complete ouptut (skipping compilation):

    Finished test [unoptimized + debuginfo] target(s) in 51.35s
May 11 00:51:58.814  INFO cargo_tarpaulin::process_handling: running C:\work\probranchinator\target\debug\deps\probranchinator-5c461d614048b00c.exe
May 11 00:51:58.815  INFO cargo_tarpaulin::process_handling: Setting LLVM_PROFILE_FILE

running 5 tests
test tests::analysis_test::test_analysis_one_branch ...
 ███████████████████████████████████████████████████ 0/1 branches analysed in 0s                              
ok
test tests::analysis_test::test_analysis_unrelated_branches ... ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░2 branches analysed in 0s                              
ok
test tests::analysis_test::test_analysis_up_to_date_and_fast_forward ... ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░2 branches analysed in 0s                              
ok
test tests::repo_test::test_delete_remote_branch ... Pruning origin
URL: file:///C:/Users/strow/AppData/Local/Temp/.tmppCMm2h/my-repo.git/
 * [pruned] origin/test-branch
ok
test tests::repo_test::test_get_repo ... ok

test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.21s

May 11 00:52:00.254  INFO cargo_tarpaulin::statemachine::instrumented: For binary: target\debug\deps\probranchinator-5c461d614048b00c.exe
May 11 00:52:00.254  INFO cargo_tarpaulin::statemachine::instrumented: Generated: target\tarpaulin\profraws\probranchinator-5c461d614048b00c.exe_12256345248713744009_0-25344.profraw
May 11 00:52:00.254  INFO cargo_tarpaulin::statemachine::instrumented: Merging coverage reports
May 11 00:52:00.260 ERROR cargo_tarpaulin: Parsing failed

I did not pass "--engine", not sure if it is ptrace or llvm instrumentation.

To Reproduce
I am getting it on this repository - https://github.com/strowk/probranchinator

Attached from "target/tarpaulin/profraws":
probranchinator-5c461d614048b00c.exe_12256345248713744009_0-25344.zip

Expected behavior
No errors, result of coverage analysis.

@strowk strowk changed the title Parsing failed Parsing failed on Windows 11 May 10, 2023
@strowk
Copy link
Author

strowk commented May 10, 2023

Note, that the output is OK when I run same project via docker like this:

docker run --security-opt seccomp=unconfined -ti -v "$(pwd -W):/volume" xd009642/tarpaulin bash -c " git config --global user.name 'Test Fella' && git config --global user.email 'justfortest@domain.example' &&  cargo tarpaulin"

(pwd -W is specific for combination of Mingw and docker in Windows, git config is for tests as they use git CLI a little bit)

I get "10.40% coverage, 99/952 lines covered" and more output, so this seems a success (barring low coverage, but that's why I want to measure it in the first place).
This run via docker utilizing wsl 2, which is basically linux in VM, so basically same as real linux AFAIK.

This make me think that the issue I have is potentially Windows specific.

@xd009642
Copy link
Owner

xd009642 commented Jul 2, 2023

Sorry it's taken a while, I did just download the file you uploaded to test to see if there was anything i could glean from it. Running with the llvm tools I get:

error: probranchinator-5c461d614048b00c.exe_12256345248713744009_0-25344.profraw: malformed instrumentation profile data: function name is empty

There's a chance this may be OS specifc as these tools aren't designed to parse files generated on different architectures to the host and I'm running on Linux. I'll get access to a windows machine some point next week and test it there as the project works fine on linux for me in tarpaulin.

@jgardona
Copy link

jgardona commented Jan 4, 2024

It happens to me also.

image

windows 10 x86_64

@Sewer56
Copy link

Sewer56 commented Feb 29, 2024

I reproduced this on Linux. Started randomly getting this in CI.
It seems that this is broken on Nightly rust, on Stable, things work just fine.

@xd009642
Copy link
Owner

I think it's down to the llvm version being bumped and the format changing to add in mcdc coverage.

Unfortunately, I won't have time to work on this until after rustnation but one approach is to fall back to using the llvm profdata and cov tools if parsing fails

@xd009642
Copy link
Owner

So releasing a new version today that may solve this, let me know how it works - sorry for the delay

@Sewer56
Copy link

Sewer56 commented Apr 13, 2024

I re-ran a workflow that previously failed on one of my personal FOSS projects.
I can confirm this now runs.

Thank you a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants