Skip to content

Documentation for Rustflag -Zprofile outdated. #72546

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

Closed
jschwe opened this issue May 24, 2020 · 1 comment · Fixed by #72615
Closed

Documentation for Rustflag -Zprofile outdated. #72546

jschwe opened this issue May 24, 2020 · 1 comment · Fixed by #72615
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jschwe
Copy link
Contributor

jschwe commented May 24, 2020

I tried building this hello world example with profiling enabled documented here.

$ cargo new testgcov --bin
Created binary (application) `testgcov` package
$ cd testgcov/
$ export RUSTFLAGS="-Zprofile"
$ cargo build
   Compiling testgcov v0.1.0 (/home/jonathan/Dev/testgcov)
error: can't instrument with gcov profiling when compiling incrementally

error: could not compile `testgcov`.

To learn more, run the command again with --verbose.

I expected to see this happen: The Hello world demo should get built with gcov profiling.

Instead, this happened: Building failed since incremental compiling is enabled by default and I don't know how to turn it off. I deleted the target directory that was created, ran cargo clean and repeated and got the same error again.

I believe the documentation should be updated with a working example.

Meta

rustc --version --verbose:

rustc 1.45.0-nightly (a74d1862d 2020-05-14)
binary: rustc
commit-hash: a74d1862d4d87a56244958416fd05976c58ca1a8
commit-date: 2020-05-14
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0
@jschwe jschwe added the C-bug Category: This is a bug. label May 24, 2020
@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 24, 2020
@Speedy37
Copy link

Take a look at the grcov doc: https://github.com/mozilla/grcov

Tu use -Zprofile, incremental compiling should be disabled, which can be done with:

export CARGO_INCREMENTAL=0

@bors bors closed this as completed in e8bb4c7 Jun 8, 2020
@workingjubilee workingjubilee added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants