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

Port backtrace-rs test-crates to rustc repo #122899

Open
2 of 5 tasks
workingjubilee opened this issue Mar 22, 2024 · 8 comments
Open
2 of 5 tasks

Port backtrace-rs test-crates to rustc repo #122899

workingjubilee opened this issue Mar 22, 2024 · 8 comments
Labels
A-backtrace Area: backtraces A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@workingjubilee
Copy link
Member

workingjubilee commented Mar 22, 2024

backtrace-rs has a number of subcrates which it uses to test more complicated logic that is harder to observe from inside a program, leading to this exciting yaml: https://github.com/rust-lang/backtrace-rs/blob/6fa4b85b9962c3e1be8c2e5cc605cd078134152b/.github/workflows/main.yml#L54-L69

while tests inside backtrace's library itself will be run as part of the stdlib's test suite, these are not. backtrace-rs failed to run nightly testing for Windows, which would have caught this. however, many of these tests are directly relevant to rustc's functionality as well, and changes should not be landed in rustc which break them without very good reason. failing to include these tests led to a severe regression in backtraces on Windows. these tests should be ported to run inside rustc's existing test infrastructure where they are relevant. I have excepted one which was already based on a rustc test and one which is only relevant for backtrace-rs.

if you would like to work on porting one of these tests, please link to this issue in your PR and leave a comment to claim the test. if you are stuck, please don't hesitate to open a thread on the rust zulip! and be aware, some may be complex enough to need the new recipes infrastructure, but hopefully not. I expect all may need, however, this compiletest annotation:

//@ needs-unwind
@workingjubilee workingjubilee added A-testsuite Area: The testsuite used to check the correctness of rustc E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-help-wanted Call for participation: Help is requested to fix this issue. C-bug Category: This is a bug. labels Mar 22, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 22, 2024
@workingjubilee workingjubilee removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 22, 2024
@jieyouxu
Copy link
Member

I'll take a stab at porting line-tables-only

@Noratrieb
Copy link
Member

The tests using C may be able to make use of tests/auxiliary/rust_test_helpers.c.

@izarma
Copy link

izarma commented Mar 24, 2024

Hi, I'll pick this up cpp_smoke_test

workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 25, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Mar 25, 2024

I don't think debuglink can be easily ported over to the rustc test suite without the test suite having access to docker? The problem is that the test wants to test debug directories under /usr/lib/debug, which seems like a massive no-no without docker. I don't think there is a very elegant solution for that? Even if it was possible to run docker inside docker (as in rustc's CI), that seems to be a bad idea in itself.

@workingjubilee
Copy link
Member Author

@jieyouxu I think I'll have to reimagine the test somewhat and port it myself, yeah! it can be run under the rustc test suite but it requires doing something mildly silly because what it is really doing is testing that you "don't lose track" of the debuginfo.

workingjubilee added a commit to workingjubilee/rustc that referenced this issue Mar 26, 2024
@workingjubilee
Copy link
Member Author

The without_debuginfo test has been unblocked by #123081 landing.

bors added a commit to rust-lang-ci/rust that referenced this issue Mar 27, 2024
@jieyouxu
Copy link
Member

The without_debuginfo test has been unblocked by #123081 landing.

That test is also unfortunately a bit awkward because it's checking if each frame with a non-null IP has resolved symbols even if -Cdebuginfo=0... which is awkward to check with std::backtrace::Backtrace because AFAICT the frame IP is not exposed.

@ChrisDenton
Copy link
Member

ChrisDenton commented Mar 28, 2024

We could add more methods to BacktraceFrame. Might require an ACP though.

bors added a commit to rust-lang-ci/rust that referenced this issue Apr 9, 2024
…only, r=workingjubilee

Port backtrace's `line-tables-only` test over to rustc

Part of rust-lang#122899.
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 10, 2024
…only, r=workingjubilee

Port backtrace's `line-tables-only` test over to rustc

Part of rust-lang#122899.
@jieyouxu jieyouxu added the A-backtrace Area: backtraces label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backtrace Area: backtraces A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

6 participants