-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Proc macro errors can lead to rustc panics at stage1 or on non-Linux #59998
Comments
This seems to also happen on macOS. Just not on Linux. @eddyb speculated that this is about whether libstd is shared between the proc macro client and server. I do not know what that means. |
Statically linked Rust libraries (such as libcore or libstd) That is, you can end up with several copies of libstd's functions and globals in one process, if you dynamically load a Rust We account for this in terms of catching panics and transporting them over RPC, but we've forgotten to do the "stderr printing bypass" for panics happening on the server-side (i.e. caused by rustc handling a request from a proc macro client), we're only bypassing the printing for panics that happened client-side. Also, to be clear, sharing libstd's is not the solution, but rather Linux is hiding an issue because it happens to do so (and this is not the case at e.g. stage1, because the server and client libstd's are incompatible). |
triage: P-medium. Leaving nomination tag in hopes we can discuss at meeting. |
discussed at T-compiler meeting. self-assigning. unnominating. |
Unbreak stage1 tests via ignore-stage1 in `proc-macro/invalid-punct-ident-1.rs`. rust-lang#98188 broke `./x.py test --stage 1` (which I thought we ran in PR CI, cc `@rust-lang/infra)` i.e. the default `./x.py test` in dev checkouts, as the panic in `src/test/ui/proc-macro/invalid-punct-ident-1.rs` moved from the server (`rustc`) to the client (proc macro), and that means it's now affected by rust-lang#59998. I made the test look like `src/test/ui-fulldeps/issue-76270-panic-in-libproc-macro.rs` tho I'm a bit confused why that one is in `src/test/ui-fulldeps`, it should still work in `src/test/ui`, no? (cc `@Aaron1011)`
Not sure yet if relevant, but: turns out my expectation of proc macros being "most rust/compiler/rustc_codegen_ssa/src/back/linker.rs Lines 651 to 661 in 9067d52
AFAICT that's what's causing proc macro dylibs to have so many dynamic exports (instead of exactly one, the |
For some reason, the proc_macro of swiftnav-sys is failing on MacOS and Windows but succeeding on Linux. I'm no sure why but it appears there is some precedent for this: rust-lang/rust#59998 When I update the version to the latest version `v0.10.0` it succeeds. I would recommend getting dependabot to bump these versions in the future and also updating the CI/CD to run on a build matrix with `cargo c --all-features` # Description @swift-nav/algint-team # API compatibility Does this change introduce a API compatibility risk? No ## API compatibility plan If the above is "Yes", please detail the compatibility (or migration) plan: # JIRA Reference https://swift-nav.atlassian.net/browse/BOARD-XXXX
Update (by @eddyb): this also occurs with
x.py test --stage 1 src/test/ui
on Linux (and is responsible for several// ignore-stage1
insrc/test/ui
), so I'm updating the title to reflect it.See also #59998 (comment) for more details.
Discovered at #59769 (comment): running the
ui\proc-macro\invalid-punct-ident-*.rs
tests on some platforms (observed on Windows and macOS but not on Linux) leads to things likebeing printed on stderr.
Cc @eddyb
The text was updated successfully, but these errors were encountered: