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

Compiletest path normalization fails in windows if path is inside a string #132752

Open
celinval opened this issue Nov 8, 2024 · 3 comments
Open
Assignees
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. O-windows Operating system: Windows S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@celinval
Copy link
Contributor

celinval commented Nov 8, 2024

In the initial version of #132161, a Windows CI job because the stdout contained a string containing the test path that wasn't normalized.

I'm pasting the error as described in #132161 (comment):

---- [ui] tests\ui\stable-mir-print\operands.rs stdout ----
$DIR\operands.rs
$DIR\operands.rs
\a\rust\rust\tests\ui\stable-mir-print\operands.rs
$DIR\operands.rs
Saved the actual stdout to "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\test\\ui\\stable-mir-print\\operands\\operands.stdout"


226     debug x => _1;
227     debug z => _2;
228     bb0: {
-         _0 = {closure@Span { id: 105, repr: "$DIR/operands.rs:44:5: 44:19" }}(_1, _2);
+         _0 = {closure@Span { id: 105, repr: "C:/a/rust/rust/tests/ui/stable-mir-print/operands.rs:44:5: 44:19" }}(_1, _2);
231     }
232 }
@celinval celinval added the A-compiletest Area: The compiletest test runner label Nov 8, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 8, 2024
@workingjubilee workingjubilee added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Nov 8, 2024
@jieyouxu jieyouxu added C-bug Category: This is a bug. E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 8, 2024
@jieyouxu jieyouxu marked this as a duplicate of #134066 Dec 10, 2024
@jieyouxu jieyouxu self-assigned this Dec 10, 2024
@jieyouxu jieyouxu added the O-windows Operating system: Windows label Dec 10, 2024
@jieyouxu

This comment has been minimized.

@jieyouxu
Copy link
Member

jieyouxu commented Jan 8, 2025

I can't immediately come up with a good reproducer for this one, please do let me know if someone has a good repro...

@jieyouxu jieyouxu added S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. and removed E-needs-investigation Call for partcipation: This issues needs some investigation to determine current status labels Jan 8, 2025
@celinval
Copy link
Contributor Author

I think you should be able to reproduce it by modifying the following line:

write!(writer, "{{closure@{}}}(", def.span().diagnostic())?;

to:

write!(writer, "{{closure@{:?}}}(", def.span())?; 

And run the ui tests inside tests\ui\stable-mir-print\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. O-windows Operating system: Windows S-needs-repro Status: This issue has no reproduction and needs a reproduction to make progress. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
Development

No branches or pull requests

4 participants