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

Explicitly build proc macro test with panic=unwind #135225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

erickt
Copy link
Contributor

@erickt erickt commented Jan 7, 2025

Fuchsia explicitly builds rust and all rust targets with -C panic=abort to minimize code generation size. However, when compiling a proc-macro with this setting it can cause a warning to be emitted, which breaks tests/ui/invalid-compile-flags/crate-type-flag.rs. This hasn't been a problem in the past for us since we compile our proc macros on host, rather than inside Fuchsia.

This attempts to fix the issue by explicitly requiring that we're using the unwinder when compiling this test to avoid the warning being emitted.

Fixes #135223

@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 7, 2025
@jieyouxu jieyouxu self-assigned this Jan 8, 2025
@jieyouxu jieyouxu added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 8, 2025
@erickt erickt force-pushed the fix-test branch 2 times, most recently from 3dc1c38 to 22ec81a Compare January 8, 2025 17:25
@rustbot
Copy link
Collaborator

rustbot commented Jan 8, 2025

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@erickt
Copy link
Contributor Author

erickt commented Jan 8, 2025

Thanks for the suggestions! That's much better than manually specifying -C panic=unwind. I updated it, and also removed the line from cg_clif.

@rust-log-analyzer

This comment has been minimized.

Fuchsia explicitly builds rust and all rust targets with `-C
panic=abort` to minimize code generation size. However, when compiling a
proc-macro with this setting it can cause a warning to be emitted, which
breaks `tests/ui/invalid-compile-flags/crate-type-flag.rs`. This hasn't
been a problem in the past for us since we compile our proc macros on
host, rather than inside Fuchsia.

This attempts to fix the issue by explicitly requiring that we're using
the unwinder when compiling this test to avoid the warning being
emitted.

Fixes rust-lang#135223
@jieyouxu
Copy link
Member

jieyouxu commented Jan 8, 2025

Thanks!
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 8, 2025

📌 Commit 4994296 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 8, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Jan 8, 2025

FTR, this test actually wants a proper supports-crate-type directive i.e. #132309, I had a bunch of these needs-* directive as a poor man's emulation to that effect.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 9, 2025
Explicitly build proc macro test with panic=unwind

Fuchsia explicitly builds rust and all rust targets with `-C panic=abort` to minimize code generation size. However, when compiling a proc-macro with this setting it can cause a warning to be emitted, which breaks `tests/ui/invalid-compile-flags/crate-type-flag.rs`. This hasn't been a problem in the past for us since we compile our proc macros on host, rather than inside Fuchsia.

This attempts to fix the issue by explicitly requiring that we're using the unwinder when compiling this test to avoid the warning being emitted.

Fixes rust-lang#135223
jhpratt added a commit to jhpratt/rust that referenced this pull request Jan 9, 2025
Explicitly build proc macro test with panic=unwind

Fuchsia explicitly builds rust and all rust targets with `-C panic=abort` to minimize code generation size. However, when compiling a proc-macro with this setting it can cause a warning to be emitted, which breaks `tests/ui/invalid-compile-flags/crate-type-flag.rs`. This hasn't been a problem in the past for us since we compile our proc macros on host, rather than inside Fuchsia.

This attempts to fix the issue by explicitly requiring that we're using the unwinder when compiling this test to avoid the warning being emitted.

Fixes rust-lang#135223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test crate-type-flag.rs#proc_dash_macro is failing
7 participants