-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Port backtrace's cpp_smoke_test to rustc repo #136182
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
Conversation
Could not assign reviewer from: |
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @fmease (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Maybe r? @workingjubilee (or @ChrisDenton) |
Could not assign reviewer from: |
Right. r? @ChrisDenton (or idk someone else who's more familiar with backtrace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is intentionally testing C++ so it will need to be a cpp file. Also the backtrace feature cpp_demangle
will need to be enabled for the test.
Though looking at this further, it seems like it's been "temporarily" ignored in backtrace-rs for eight years? https://github.com/rust-lang/backtrace-rs/blob/e33eaac8caf46d0d3cc57f8d152529e8b7ae1b78/crates/cpp_smoke_test/tests/smoke.rs#L11
Ah it seems that the reason it was ignored has long since been fixed: gimli-rs/cpp_demangle#73
Hey, and how can I use the feature |
Hey @ChrisDenton, If there is some work around to get the demangled name, please do let me know |
@Pyr0de I mean you can just use |
Oh, thanks for the suggestion |
85d43c7
to
282941b
Compare
This PR modifies cc @jieyouxu |
The test is mostly the same from cpp_smoke_test, just made some changes for it to successfully run and added the @rustbot review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can only comment on the rmake.rs
test file itself, not on the actual test logic.
282941b
to
6049916
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me if @jieyouxu is happy with the rmake test
I'll read this test again a bit later |
Oh this is slightly problematic because now the run-make test is calling out to Generally speaking, using The current formulation of the test is also exercising the crates.io version of some |
So I had an attempt over at #136695 to not depend on |
Port `rust-lang/backtrace`'s `cpp_smoke_test` to `rust-lang/rust` test suite Ports https://github.com/rust-lang/backtrace-rs/tree/e33eaac8caf46d0d3cc57f8d152529e8b7ae1b78/crates/cpp_smoke_test to the main repo. I can't say I'm 100% convinced by the value of this test living in the main repo for several reasons: 1. This test (or at least the actual `cpp_smoke_test.rs` is **extremely** fragile. It's sensitive to debuginfo levels AND optimizations. On `x86_64-unknown-linux-gnu`, the C++ file **must** be compiled with **exactly** `-O1`. No more, no less, or else the backtrace symbol names do not line up in symbol count or name. 2. I could not get this test to work on Windows MSVC, no matter which combination of debuginfo levels and optimization levels I tried. Note that I have not tried other targets, e.g. Apple friends, which may fail for yet other reasons. Possibly supersedes rust-lang#136182. r? `@ChrisDenton` (or `@workingjubilee)` try-job: x86_64-apple-1 try-job: aarch64-apple
Given its difficulties, I have struck the test from the list of tests we want to port. |
Will this test also fail like how @jieyouxu's test failed? |
Yes, provided how sensitive this test is to debuginfo-level + opt-level + platform/env for the combination of the C++ lib + Rust binary. It didn't work on msvc no matter what configuration I tried, nor does it work on apple targets where I ran a try-job. @Pyr0de I'm going to close this and the other attempt over at #136695 based on how fragile this test is + its difficulty to implement versus the value it may or may not provide. Thank you for taking a shot at this though, and while this didn't work out, I find discovering what doesn't work here to be equally valuable. |
Even though it didn't work, thanks for all the help with this PR |
Ported backtrace-rs test crates cpp_smoke_test to rust repo.
issue #122899