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

Failed to create a symlink of profraw on nightly-msvc #561

Closed
tcztzy opened this issue Jan 12, 2021 · 8 comments
Closed

Failed to create a symlink of profraw on nightly-msvc #561

tcztzy opened this issue Jan 12, 2021 · 8 comments

Comments

@tcztzy
Copy link

tcztzy commented Jan 12, 2021

I followed the manual from README, both .profraw and .gcda. And then I try to run following command to generate coverage report have the same panic

grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/
07:44:41 [ERROR] A panic occurred grcov-0.6.1\src\producer.rs:296: Failed to create a symlink "${workspace}\\default.profraw" -> "${tmpdir}\\default_1.profraw"

I also read this issure, but I need some Windows specified dependecies so I do pin nightly-msvc.

Is there any walkaround for this problem?

@marco-c marco-c added the bug label Jan 21, 2021
@marco-c
Copy link
Collaborator

marco-c commented Jan 21, 2021

Are both source-based coverage and gcov-based coverage failing?

Before running cargo test, can you make sure you remove all *.profraw and *.gcda files that are in your source tree?

  1. Remove all profraw and gcda files
  2. cargo build
  3. cargo test
  4. Run grcov

If it still fails, can you try running grcov PATHTOPROFRAW1 PATHTOPROFRAW2 ... -s . instead of grcov . -s .?

@lolo32
Copy link

lolo32 commented Mar 21, 2021

I got the same problem, and I just tried what you asked: remove, guild, test, grcov

I found a temporary solution:

Open the CMD with Administrator right

@corebreaker
Copy link

Yes, me too, it's urgent to fixt it, right ?

@marco-c
Copy link
Collaborator

marco-c commented Oct 28, 2021

@corebreaker does the workaround @lolo32 suggested work for you?

@corebreaker
Copy link

corebreaker commented Oct 28, 2021

i found a better one, i used tarpaulin instead, plus too many problem with grcov, some line should be covered (like empty lines with no code around), tarpaulin didn't make these error. Lcov works better but tarpaulin is easier.

@marco-c
Copy link
Collaborator

marco-c commented Oct 28, 2021

Strange, there shouldn't be any difference in coverage results between lcov and grcov when using gcov-based coverage. The coverage instrumentation is in Rust itself. If you have a reproducible example, please file a new issue.

Tarpaulin is very different as it uses a custom instrumentation, not the standard one in the Rust compiler, and as far as I can tell it doesn't support Windows.

All in all, you should get the best results with source-based coverage and grcov (lcov doesn't support source-based coverage).

@marco-c
Copy link
Collaborator

marco-c commented Nov 25, 2021

Duplicate of #462.

@marco-c
Copy link
Collaborator

marco-c commented Nov 25, 2021

#720 should fix this.

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

No branches or pull requests

4 participants