Skip to content

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Jul 9, 2025

This PR fixes the tests/run-make/fmt-write-float/ run-make test to both (1) not vacuously pass on no symbols at all, and (2) compare panics symbols under optimizations versus no optimizations.

Context

Previously, the test only checks for the absence of certain panic symbols, but having no symbols was also a possible albeit vacuous way to satisfy this assertion.

Noticed in #142841 (comment).

r? @ChrisDenton

try-job: aarch64-apple
try-job: aarch64-msvc-1
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs 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 Jul 9, 2025
@ChrisDenton

This comment has been minimized.

@rust-bors

This comment has been minimized.

@ChrisDenton

This comment was marked as outdated.

@rust-bors

This comment was marked as outdated.

rust-bors bot added a commit that referenced this pull request Jul 9, 2025
Make sure `fmt-write-bloat` doesn't vacuously pass on no symbols

Previously, the test only checks for the absence of certain panic symbols, but having no symbols was also a possible albeit vacuous way to satisfy this assertion.

Fix this by checking we at least observe the `main` symbol which is always expected to be present.

Noticed in #142841 (comment).

r? `@ChrisDenton`
try-job: x86_64-msvc-*
@rust-bors

This comment was marked as outdated.

@jieyouxu
Copy link
Member Author

jieyouxu commented Jul 9, 2025

Hm. Let me try this locally on windows.

@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 Jul 9, 2025
@ChrisDenton
Copy link
Member

The failure is not surprising to me. On Windows, symbols are not contained in the binary itself and are instead in a separate file (the .pdb). So the object crate would not be able to find them.

@jieyouxu
Copy link
Member Author

jieyouxu commented Jul 9, 2025

Oh of course... D'oh. Let me see if I can cook something up.

@rustbot

This comment was marked as outdated.

@jieyouxu jieyouxu changed the title Make sure fmt-write-bloat doesn't vacuously pass on no symbols [WIP] Make sure fmt-write-bloat doesn't vacuously pass on no symbols Jul 9, 2025
@jieyouxu

This comment was marked as outdated.

@rust-bors

This comment was marked as outdated.

rust-bors bot added a commit that referenced this pull request Jul 9, 2025
[WIP] Make sure `fmt-write-bloat` doesn't vacuously pass on no symbols

Previously, the test only checks for the absence of certain panic symbols, but having no symbols was also a possible albeit vacuous way to satisfy this assertion.

Fix this by checking we at least observe the `main` symbol which is always expected to be present.

Noticed in #142841 (comment).

r? `@ChrisDenton`

try-job: aarch64-apple
try-job: x86_64-apple-1
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
@jieyouxu
Copy link
Member Author

jieyouxu commented Jul 9, 2025

llvm-pdbutil is an fallback approach, trying pdb crate to see if that works under CI conditions.

@jieyouxu

This comment was marked as outdated.

@jieyouxu

This comment was marked as outdated.

@rust-bors

This comment was marked as outdated.

@jieyouxu

This comment was marked as resolved.

@rust-bors

This comment was marked as outdated.

rust-bors bot added a commit that referenced this pull request Jul 9, 2025
[WIP] Make sure `fmt-write-bloat` doesn't vacuously pass on no symbols

Previously, the test only checks for the absence of certain panic symbols, but having no symbols was also a possible albeit vacuous way to satisfy this assertion.

Fix this by checking we at least observe the `main` symbol which is always expected to be present.

Noticed in #142841 (comment).

r? `@ChrisDenton`

try-job: aarch64-apple
try-job: x86_64-apple-1
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 7, 2025
Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. I think using llvm-pdbutil is fine for now. I don't love the messinesses but I don't think it's too bad either.

View changes since this review

@ChrisDenton
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 17, 2025

📌 Commit 82d9758 has been approved by ChrisDenton

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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 17, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Oct 17, 2025
…enton

Make sure `fmt-write-bloat` doesn't vacuously pass on no symbols

This PR fixes the `tests/run-make/fmt-write-float/` run-make test to both (1) not vacuously pass on no symbols at all, and (2) compare panics symbols under optimizations versus no optimizations.

### Context

Previously, the test only checks for the absence of certain panic symbols, but having no symbols was also a possible albeit vacuous way to satisfy this assertion.

Noticed in rust-lang#142841 (comment).

r? `@ChrisDenton`

try-job: aarch64-apple
try-job: aarch64-msvc-1
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
@GuillaumeGomez
Copy link
Member

Failed in #147819.

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 17, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 18, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Comment on lines +22 to +24
// NOTE: against the GCC codegen backend, the assertion
// `object_contains_any_symbol_substring(&expect_panic_symbols, &panic_syms)` fails.
//@ ignore-backends: gcc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: ignoring this test for GCC cg backend, I do not feel like investigating why #147819 (comment) when the GCC cg backend is used, we observe some of these panic symbols.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, ok that's fair. It feels like this should ideally work with gcc but that needn't be done now. I just hope this isn't a canary warning us the test is going to be flaky 😛.

Copy link
Member Author

@jieyouxu jieyouxu Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if the test ends up becoming flaky, I honestly rather disable or even remove this entire test. Because this test is exercising panic-machinery related optimizations through indirect implementation details, and checking for what is there and isn't there are IMO equally prone to "no longer testing what it's supposed to test". This is still the case even if we use DIA wrappers :(

@jieyouxu
Copy link
Member Author

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 18, 2025
@ChrisDenton
Copy link
Member

@bors r+ rollup=iffy (should be fine to rollup if need be though)

@bors
Copy link
Collaborator

bors commented Oct 18, 2025

📌 Commit a51fb59 has been approved by ChrisDenton

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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 18, 2025
@bors
Copy link
Collaborator

bors commented Oct 18, 2025

⌛ Testing commit a51fb59 with merge 37ce8a6...

bors added a commit that referenced this pull request Oct 18, 2025
Make sure `fmt-write-bloat` doesn't vacuously pass on no symbols

This PR fixes the `tests/run-make/fmt-write-float/` run-make test to both (1) not vacuously pass on no symbols at all, and (2) compare panics symbols under optimizations versus no optimizations.

### Context

Previously, the test only checks for the absence of certain panic symbols, but having no symbols was also a possible albeit vacuous way to satisfy this assertion.

Noticed in #142841 (comment).

r? `@ChrisDenton`

try-job: aarch64-apple
try-job: aarch64-msvc-1
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-distcheck failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/fmt-write-bloat stdout ----

error: rmake recipe failed to complete
status: exit status: 101
command: cd "/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/test/run-make/fmt-write-bloat/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED AR="ar" BUILD_ROOT="/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RUSTC_DYLIB_PATH="/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" PYTHON="/usr/bin/python3" RUSTC="/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/tmp/distcheck/distcheck-rustc-src" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/tmp/distcheck/distcheck-rustc-src/build/x86_64-unknown-linux-gnu/test/run-make/fmt-write-bloat/rmake"
stdout: none
--- stderr -------------------------------

thread 'main' (453273) panicked at /tmp/distcheck/distcheck-rustc-src/tests/run-make/fmt-write-bloat/rmake.rs:99:9:
assertion failed: object_contains_any_symbol_substring(&expect_panic_symbols, &panic_syms)
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/bb624dcb4c8ab987e10c0808d92d76f3b84dd117/library/std/src/panicking.rs:698:5
   1: core::panicking::panic_fmt
             at /rustc/bb624dcb4c8ab987e10c0808d92d76f3b84dd117/library/core/src/panicking.rs:75:14
---
Some tests failed in compiletest suite=run-make mode=run-make host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 1:13:13
make: *** [Makefile:49: check] Error 1
Bootstrap failed while executing `test distcheck`
Command `make check [workdir=/tmp/distcheck/distcheck-rustc-src]` failed with exit code 2
Created at: src/bootstrap/src/core/build_steps/test.rs:3283:5
Executed at: src/bootstrap/src/core/build_steps/test.rs:3289:10

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 1:22:23
  local time: Sat Oct 18 20:44:17 UTC 2025
  network time: Sat, 18 Oct 2025 20:44:17 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

@bors
Copy link
Collaborator

bors commented Oct 18, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 18, 2025
@jieyouxu
Copy link
Member Author

Ah, debug assertions, right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants