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

Test crate-type-flag.rs#proc_dash_macro is failing #135223

Open
aidanwolter3 opened this issue Jan 7, 2025 · 2 comments · May be fixed by #135225
Open

Test crate-type-flag.rs#proc_dash_macro is failing #135223

aidanwolter3 opened this issue Jan 7, 2025 · 2 comments · May be fixed by #135225
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc O-fuchsia Operating system: Fuchsia T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@aidanwolter3
Copy link

tests/ui/invalid-compile-flags/crate-type-flag.rs#proc_dash_macro is failing as of this commit, and seems to have been disabled with this commit.

The Fuchsia team (fuchsia.dev) runs this test suite before rolling the latest rust compiler into our codebase, but the above method of disabling the test does not seems to disable the test for Fuchsia. Can we disable this test in a way that would disable it for Fuchsia as well?

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 7, 2025
@fmease fmease added O-fuchsia Operating system: Fuchsia A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 7, 2025
@erickt
Copy link
Contributor

erickt commented Jan 7, 2025

The error we are getting is:

---- [ui] tests/ui/invalid-compile-flags/crate-type-flag.rs#proc_dash_macro stdout ----


executing env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/b/s/w/ir/x/w/staging/build/fuchsia-build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/b/s/w/ir/x/w/fuchsia-third_party-rust/tests/ui/invalid-compile-flags/crate-type-flag.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/b/s/w/ir/x/t/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/b/s/w/ir/x/w/fuchsia-third_party-rust/vendor" "--sysroot" "/b/s/w/ir/x/w/staging/build/fuchsia-build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-fuchsia" "--cfg" "proc_dash_macro" "--check-cfg" "cfg(test,FALSE,lib,rlib,staticlib,dylib,cdylib,bin,proc_dash_macro,multivalue,multivalue_combined,proc_underscore_macro,empty_crate_type,unknown)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/b/s/w/ir/x/w/staging/build/fuchsia-build/x86_64-unknown-linux-gnu/test/ui/invalid-compile-flags/crate-type-flag.proc_dash_macro" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/b/s/w/ir/x/w/staging/build/fuchsia-build/x86_64-unknown-fuchsia/native/rust-test-helpers" "-Zpanic-abort-tests" "-Clink-arg=--sysroot=/b/s/w/ir/x/w/sdk/arch/x64/sysroot" "-L" "/b/s/w/ir/x/w/sdk/arch/x64/sysroot/lib" "-L" "/b/s/w/ir/x/w/sdk/arch/x64/lib" "-Cpanic=abort" "-Cforce-unwind-tables=yes" "-Clinker=/b/s/w/ir/x/w/cipd/bin/ld.lld" "--crate-type=proc-macro"
------rustc stdout------------------------------

------rustc stderr------------------------------
{"$message_type":"diagnostic","message":"building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic\n\n"}
{"$message_type":"diagnostic","message":"1 warning emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: 1 warning emitted\n\n"}

------------------------------------------

We might be able to get this to work if we changed https://github.com/rust-lang/rust/blob/master/tests/ui/invalid-compile-flags/crate-type-flag.rs#L33 to explicitly add -C panic=unwind when building proc macros to avoid this warning being emitted.

@erickt erickt linked a pull request Jan 7, 2025 that will close this issue
@lqd
Copy link
Member

lqd commented Jan 8, 2025

and seems to have been disabled with this commit

This commit is in a codegen backend submodule, so the test is not disabled in rust tests, only in cg_clif’s. This is why it’s not disabled for fuchsia or any other target.

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 8, 2025
erickt added a commit to erickt/rust that referenced this issue Jan 8, 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 rust-lang#135223
erickt added a commit to erickt/rust that referenced this issue Jan 8, 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 rust-lang#135223
erickt added a commit to erickt/rust that referenced this issue Jan 8, 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 rust-lang#135223
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue 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 issue 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
A-testsuite Area: The testsuite used to check the correctness of rustc O-fuchsia Operating system: Fuchsia T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants