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

Difference between "cargo bench" and "cargo pgo bench" #44

Closed
zamazan4ik opened this issue Jan 10, 2024 · 4 comments
Closed

Difference between "cargo bench" and "cargo pgo bench" #44

zamazan4ik opened this issue Jan 10, 2024 · 4 comments

Comments

@zamazan4ik
Copy link
Contributor

Not sure if is it an issue with cargo-pgo or not - I'll just put it here to share with other people.

During the PGO optimization for https://github.com/gorules/zen/ project, I found that cargo bench --workspace works fine (builds all required targets successfully and performs the required benchmarks) but during the cargo pgo bench -- --workspace I get the following linking errors: https://gist.github.com/zamazan4ik/176517dd1d5bb7dc07c92e13016dfd8d

I'm not sure what is the reason for the difference in behavior between these two almost the same commands. Maybe some custom build.rs rules are the root cause of the problem.

@Kobzol
Copy link
Owner

Kobzol commented Jan 10, 2024

I tried it locally and it fails because of -Cprofile-generate. If you add it to cargo bench --workspace on that project, it fails with the same linker errors. I'm not sure how to easily display linking commands used by Cargo when the compilation succeeds, to diff what is different vs -Cprofile-generate.

@zamazan4ik
Copy link
Contributor Author

zamazan4ik commented Jan 11, 2024

I tried it locally and it fails because of -Cprofile-generate

Hmm, sounds interesting why it fails due to this. Since cargo-pgo is not the reason here (honestly, I expected it), what will be the right place to report the issue? Rustc upstream repo? As far as I understand, it isn't normal behavior.

@Kobzol
Copy link
Owner

Kobzol commented Jan 11, 2024

Yes, this looks like a rustc issue.

@zamazan4ik
Copy link
Contributor Author

Okay, in this case, I'll create the issue in the upstream.

If you think there is nothing to do with this issue from the cargo-pgo side, I think you can close the issue. Thank you!

@Kobzol Kobzol closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2024
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

2 participants