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

"the full type name has been written to disk" causes UI tests to fail #113424

Closed
cchiw opened this issue Jul 6, 2023 · 14 comments · Fixed by #114090
Closed

"the full type name has been written to disk" causes UI tests to fail #113424

cchiw opened this issue Jul 6, 2023 · 14 comments · Fixed by #114090
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@cchiw
Copy link

cchiw commented Jul 6, 2023

I tried this code:

./x test --doc and ./x test --no-doc

I expected to see this happen: All tests passing. No doc tests running when using --no-doc

Instead, this happened:

failures:
    [ui] tests/ui/mismatched_types/issue-36053-2.rs
    [ui] tests/ui/typeck/issue-31173.rs
    [ui] tests/ui/recursion/issue-83150.rs

test result: FAILED. 4 passed; 3 failed; 15247 ignored; 0 measured; 0 filtered out; finished in 630.84ms

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 0:00:0

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (f0411ffce 2023-05-30)
binary: rustc
commit-hash: f0411ffcebcd7f75ac02ed45feb53ffd07b75398
commit-date: 2023-05-30
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.4```


<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"mdibaiee"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
@cchiw cchiw added the C-bug Category: This is a bug. label Jul 6, 2023
@cchiw cchiw changed the title Issue when running rustdoc tests Multiple tests failing on upstream pull Jul 7, 2023
@saethlin
Copy link
Member

saethlin commented Jul 7, 2023

The tests pass for me and they're passing in CI. So I suspect there is something about your system that differs from mine and CI.

Can you post the contents of your config.toml?

@compiler-errors
Copy link
Member

compiler-errors commented Jul 7, 2023

Also, could you share how these tests are failing? Failing tests usually explain why their stderr differs from expected, or otherwise explain why the test happened to fail.

@cchiw
Copy link
Author

cchiw commented Jul 7, 2023

Hi there, I just did a fresh clone and got the same failures (target x86_64-unknown-linux-gnu). The Cargo.toml file has not been changed. The test pass when I used my Mac device.

The test each have "The actual stderr differed from the expected stderr." The actual stderr seems to have extra lines " ...the full type name has been written to.." which are not in the expected stderr. Could that be the cause of the failure? If so, what can a fix look like?

Full output on terminal:
output.txt

@compiler-errors
Copy link
Member

@cchiw is your copy of rust cloned into some really deep directory path? like... /home/blah/blah/long_directory_name/even_more/folders/rust?

the problem is that your tests are failing because your build is producing type names that hit the length limit and are spilled to disk, and that file limit is dependent (unfortunately) on the path that the rust clone is located at...

@compiler-errors
Copy link
Member

we should probably fix this so that UI tests don't spill any long type names to disk by default.

We could do this by adding a compiler flag that disables this behavior, and enable that flag by default in the ui testing suite.

@compiler-errors compiler-errors added E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. labels Jul 7, 2023
@Noratrieb Noratrieb added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 8, 2023
@jyn514
Copy link
Member

jyn514 commented Jul 8, 2023

we should probably fix this so that UI tests don't spill any long type names to disk by default.

We could do this by adding a compiler flag that disables this behavior, and enable that flag by default in the ui testing suite.

this is a great idea — if we do this, we should also remove the code that enables remap-path-prefix in CI.

@jyn514 jyn514 added the A-testsuite Area: The testsuite used to check the correctness of rustc label Jul 8, 2023
@mdibaiee
Copy link
Contributor

I can reproduce this locally by cloning rust under a long path. I would like to work on this. I'll take a look to see if I can identify where we have the logic for spilling the type names to disk, and guard it with a flag. I'll ask questions if I have trouble with that.

@rustbot claim

@jyn514
Copy link
Member

jyn514 commented Jul 13, 2023

We could do this by adding a compiler flag that disables this behavior, and enable that flag by default in the ui testing suite.

alternatively, we could gate it under the existing -Z ui-testing flag

@mdibaiee
Copy link
Contributor

I have code that works for this, but there are some tests under tests/ui that seem to actually test specifically this behaviour of spilling to disk. So I'm thinking, under ui_testing we skip spilling to disk, unless there is another flag, -Z force-long-type-name-disk-spill enabled, in which case we spill long type names to disk so that logic can be tested as well. Thoughts?

@jyn514
Copy link
Member

jyn514 commented Jul 15, 2023

So I'm thinking, under ui_testing we skip spilling to disk, unless there is another flag, -Z force-long-type-name-disk-spill enabled, in which case we spill long type names to disk so that logic can be tested as well. Thoughts?

👍 this seems good. i would bikeshed the name as -Z write-long-types-to-disk and uncouple it from -Z ui-testing (i.e. compiletest would start passing -Z write-long-types-to-disk=no instead of you changing the behavior of ui-testing), but i like the idea :)

@jyn514 jyn514 changed the title Multiple tests failing on upstream pull "the full type name has been written to disk" causes UI tests to fail Jul 17, 2023
@mdibaiee
Copy link
Contributor

I have a pull-request for this, but I'm getting an error in the CI pipeline that I haven't dug too deep into, was wondering if there is a simple explanation for this? #113893 (comment)

Thanks

@mdibaiee
Copy link
Contributor

mdibaiee commented Jul 25, 2023

@jyn514 The pull-request is going through well, but I'm now wondering about this part:

we should also remove the code that enables remap-path-prefix in CI.

Do you mean to basically revert this pull-request: #110115

@mdibaiee
Copy link
Contributor

Pull-request to remove remap-path-prefix code for CI builds: #114090

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. 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