Skip to content

Conversation

@ilammy
Copy link
Contributor

@ilammy ilammy commented Nov 29, 2025

write_message() expects messages to contain no newlines.

Fixes #149436

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 29, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

@chenyukang
Copy link
Member

chenyukang commented Nov 29, 2025

emm, seems there is no unit tests for all the formatters (not the issue for this PR).

@Mark-Simulacrum
Copy link
Member

There are some tests in tests/run-make/libtest-junit, can you update that to make sure this stays fixed?

@Mark-Simulacrum Mark-Simulacrum 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 Dec 4, 2025
Expect the entire input to be a single XML document, instead of
reading it line by line. This detects trailing junk better.
Copied validate_junit.py from libtest-junit.

JUnit format works well in edition 2021, but is currently broken
in edition 2024 by the mergeable doctest report.
Fix the panic in write_message() which expects messages to contain
no embedded newlines. We still want a trailing newline at the end
of the file though, so write it in different manner.

Doctest runner no longer panics, but the output is kinda broken
when `compile_fail` doctests are present. This is because they
are not mergeable.
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Dec 13, 2025
@ilammy
Copy link
Contributor Author

ilammy commented Dec 13, 2025

Added some tests to show how it works in edition 2021, fails in edition 2024, and how it's fixed by this PR.

However, while doing that I found a case that breaks JUnit output in edition 2024. Mergeable doctests will need a bit more work to fix that (should I file a separate issue for this?), but otherwise --format=junit is at least usable in some cases now.

@rustbot ready

@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 Dec 13, 2025
@ilammy ilammy changed the title Remove unnecessary newline in JUnit formatter Fix trailing newline in JUnit formatter Dec 13, 2025
@Mark-Simulacrum
Copy link
Member

Feel free to cut a separate issue. @bors r+

@bors
Copy link
Collaborator

bors commented Dec 13, 2025

📌 Commit 069cf9d has been approved by Mark-Simulacrum

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 Dec 13, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Dec 14, 2025
Fix trailing newline in JUnit formatter

`write_message()` expects messages to contain no newlines.

Fixes rust-lang#149436
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Dec 14, 2025
Fix trailing newline in JUnit formatter

`write_message()` expects messages to contain no newlines.

Fixes rust-lang#149436
bors added a commit that referenced this pull request Dec 14, 2025
Rollup of 8 pull requests

Successful merges:

 - #148755 (Constify `DropGuard::dismiss` and trait impls)
 - #148825 (Add SystemTime::{MIN, MAX})
 - #149272 (Fix vec iter zst alignment)
 - #149417 (tidy: Detect outdated workspaces in workspace list)
 - #149437 (Fix trailing newline in JUnit formatter)
 - #149773 (fix va_list test by adding a llvmir signext check)
 - #149894 (Update to mdbook 0.5)
 - #149955 (Fix typo in armv7a-vex-v5 documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
@ChrisDenton
Copy link
Member

Failed in #149975 (comment)

@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 Dec 14, 2025
@ilammy
Copy link
Contributor Author

ilammy commented Dec 16, 2025

Whoops. I should have caught onto that when my ./x test passed only with --stage 2. For some reason I thought the big pipeline handles it implicitly. Turns out, rustdoc is a bit special in that stage 1 builds (for some reason I don't fully understand) use stage 0's libtest, so any fix there are not propagated yet. Stage 2 is good though.

I'll go add ignore-stage1 on the new test. I dunno how many existing ones technically need it as well.

stage1's rustdoc is using stage0's libtest which does not have
a fix from 069cf9d, making the test run fail. Ensure that
this test is executed with everything recompiled in stage2.
@ilammy
Copy link
Contributor Author

ilammy commented Dec 16, 2025

@rustbot ready for another run

@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 Dec 16, 2025
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=iffy

@bors
Copy link
Collaborator

bors commented Dec 20, 2025

📌 Commit a8f4a67 has been approved by Mark-Simulacrum

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 Dec 20, 2025
Kivooeo added a commit to Kivooeo/rust that referenced this pull request Dec 20, 2025
Fix trailing newline in JUnit formatter

`write_message()` expects messages to contain no newlines.

Fixes rust-lang#149436
bors added a commit that referenced this pull request Dec 20, 2025
Rollup of 7 pull requests

Successful merges:

 - #147552 ([Debugger Visualizers] Optimize lookup behavior)
 - #149437 (Fix trailing newline in JUnit formatter)
 - #149812 (Add const default for OnceCell and OnceLock)
 - #150035 (fix docustring on fetch_or)
 - #150160 (Fix ICE (#149980) for invalid EII in statement position)
 - #150191 (change non-canonical clone impl to {*self}, fix some doc comments)
 - #150203 (Drop the From derive macro from the v1 prelude)

r? `@ghost`
`@rustbot` modify labels: rollup
Kivooeo added a commit to Kivooeo/rust that referenced this pull request Dec 20, 2025
Fix trailing newline in JUnit formatter

`write_message()` expects messages to contain no newlines.

Fixes rust-lang#149436
bors added a commit that referenced this pull request Dec 21, 2025
Rollup of 6 pull requests

Successful merges:

 - #149437 (Fix trailing newline in JUnit formatter)
 - #149812 (Add const default for OnceCell and OnceLock)
 - #150035 (fix docustring on fetch_or)
 - #150160 (Fix ICE (#149980) for invalid EII in statement position)
 - #150191 (change non-canonical clone impl to {*self}, fix some doc comments)
 - #150203 (Drop the From derive macro from the v1 prelude)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Dec 21, 2025
Fix trailing newline in JUnit formatter

`write_message()` expects messages to contain no newlines.

Fixes rust-lang#149436
bors added a commit that referenced this pull request Dec 21, 2025
Rollup of 13 pull requests

Successful merges:

 - #146377 (Don't strip shebang in expr-ctxt `include!(…)`)
 - #149437 (Fix trailing newline in JUnit formatter)
 - #149658 (tests/assembly-llvm/some-non-zero-from-atomic-optimization.rs: New test)
 - #149812 (Add const default for OnceCell and OnceLock)
 - #149882 (miri: add -Zbinary-dep-depinfo to dependency builds)
 - #150009 (Enable llvm-libunwind by default for Hexagon targets)
 - #150035 (fix docustring on fetch_or)
 - #150082 (tests/ui/traits/fmt-pointer-trait.rs: Add HRTB fn pointer case)
 - #150160 (Fix ICE (#149980) for invalid EII in statement position)
 - #150184 (mir_build: Use the same length type for `TestableCase::Slice` and `TestKind::Len`)
 - #150191 (change non-canonical clone impl to {*self}, fix some doc comments)
 - #150203 (Drop the From derive macro from the v1 prelude)
 - #150208 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Dec 21, 2025

⌛ Testing commit a8f4a67 with merge d3f16d2...

@bors
Copy link
Collaborator

bors commented Dec 21, 2025

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing d3f16d2 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 21, 2025
@bors bors merged commit d3f16d2 into rust-lang:main Dec 21, 2025
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 21, 2025
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing d0e6d77 (parent) -> d3f16d2 (this PR)

Test differences

Show 4 test diffs

Stage 1

  • [run-make] tests/run-make/doctests-junit: [missing] -> ignore (ignored when the bootstrapping stage is stage1 ((rustdoc depends on a fix in libtest))) (J3)

Stage 2

  • [run-make] tests/run-make/doctests-junit: [missing] -> ignore (ignored when cross-compiling ((running doctests))) (J0)
  • [run-make] tests/run-make/doctests-junit: [missing] -> pass (J1)
  • [run-make] tests/run-make/doctests-junit: [missing] -> ignore (ignored on targets without unwinding support ((test file contains should_panic test))) (J2)

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard d3f16d2f35d8d4b25bb15a85ae869eee70ffb4cd --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-apple-various: 3280.3s -> 4265.6s (+30.0%)
  2. dist-x86_64-apple: 8063.0s -> 6464.9s (-19.8%)
  3. x86_64-mingw-1: 9311.5s -> 10764.1s (+15.6%)
  4. dist-aarch64-llvm-mingw: 5423.3s -> 6265.2s (+15.5%)
  5. aarch64-gnu-debug: 4480.6s -> 3793.6s (-15.3%)
  6. x86_64-rust-for-linux: 3179.2s -> 2702.6s (-15.0%)
  7. x86_64-gnu: 8628.9s -> 7398.8s (-14.3%)
  8. x86_64-gnu-llvm-20: 5064.7s -> 4363.6s (-13.8%)
  9. x86_64-gnu-tools: 3614.5s -> 3195.4s (-11.6%)
  10. test-various: 7474.1s -> 6695.1s (-10.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d3f16d2): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary 0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.8% [0.8%, 0.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.1% [-2.3%, -2.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.1% [-2.3%, -2.0%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 481.858s -> 481.777s (-0.02%)
Artifact size: 390.61 MiB -> 390.59 MiB (-0.00%)

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 merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doctests: print_merged_doctests_times() crashes JUnit formatter

7 participants