-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Compiletest should set RUST_SAVE_ANALYSIS_CONFIG
for run-pass
tests
#96928
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I think it might run x.py from a working directory other than the source root. |
@rustbot claim |
@kingdido999 are you still working on it? |
@rustbot claim |
Hey @jyn514, thanks for offering to mentor! Some questions - What is the difference between
What is the best way to repro this? |
@lionellloh "the difference between cargo check and cargo run" - the first just runs
Change any existing UI test with -Z save-analysis and check-pass to be run-pass instead. |
Qq regarding dev efficiency: The command ran for 10 minutes. I deleted the One more n00b qn: |
@lionellloh |
I think there's also a force-rerun flag or something like that. |
Pardon the noob qns again - Here's my latest attempt, posting because I am not understanding the behaviour I am seeing.
I ran the compiled the test again at 15:32 I can see that the json file is freshly written:
But at the same time I also see that the json is
|
Why do you say it was not passed? It seems like |
@lionellloh path is passed all the time, but sometimes passed with -o instead of --out-dir. You can confirm this is the issue by running your |
@jyn514 So I think the code block is run twice, once matching on If we set it using |
Ok I think I got it, let me submit a PR for review. |
For anyone planning to pick up this issue: take a look at #97573 (comment), my instructions here are not quite right.
|
--out-dir
for run-pass
testsRUST_SAVE_ANALYSIS_CONFIG
for run-pass
tests
@lionellloh Are you going to continue working on this issue? |
@rustbot claim |
@rustbot claim |
@rustbot claim |
Hi @jyn514, rust/compiler/rustc_driver/src/lib.rs Lines 378 to 386 in 05c1ac0
I see an example of the RUST_SAVE_ANALYSIS_CONFIG env variable though output_file is null here:Lines 1795 to 1801 in 40ba0e8
My observation is that when run-pass tests are run, output_file matches TargetLocation::ThisFile(path) which is where I propose to set the environment variable:rust/src/tools/compiletest/src/runtest.rs Lines 1995 to 1998 in 40ba0e8
I should post a PR soon |
This fixes rust-lang#96928 by setting the RUST_SAVE_ANALYSIS_CONFIG environment variable for run-pass tests in order to change the location where the result of the analysis is saved.
…ests, r=Mark-Simulacrum Set RUST_SAVE_ANALYSIS_CONFIG env variable for run-pass tests This fixes rust-lang#96928 by setting the RUST_SAVE_ANALYSIS_CONFIG environment variable for run-pass tests in order to change the location where the result of the analysis is saved.
This fixes rust-lang#96928 by setting the RUST_SAVE_ANALYSIS_CONFIG environment variable for run-pass tests in order to change the location where the result of the analysis is saved.
Save-analysis has been removed from the compiler. |
Uh oh!
There was an error while loading. Please reload this page.
#96777 was necessary because a test used both -Zsave-analysis and run-pass. That generated an untracked
save-analysis-temp
file in the root directory. That behavior is not great - we shouldn't do that even if the test is marked run-pass. We can avoid it by passing--out-dir config.build_base
in compiletest:rust/src/tools/compiletest/src/runtest.rs
Lines 1895 to 1907 in fee75fb
We should also investigate why this wasn't caught by CI - it makes the source directory read only, which should have prevented this being merged.
@rustbot label +E-easy +A-testsuite +E-mentor
The text was updated successfully, but these errors were encountered: