Repository navigation
rust: fix the env-dep basedir test after dep-info reuse - #2982
Closed
xdustinface wants to merge 1 commit into
Closed
xdustinface wants to merge 1 commit into
xdustinface wants to merge 1 commit into
Conversation
`test_hash_env_dep_equal_to_basedir_is_not_unset` has failed on every platform since c72ff6c started reusing dep-info across compiles of a crate. The test set `Y` only in the mocked dep-info, never in the environment, so both of its compiles had the same dep-info key and the second reused the first's env-deps. It then compared a key with itself. rustc reads `Y` from the environment, so the test now puts a set `Y` there too. The two compiles get their own dep-info keys again, and the test still fails if a stripped env-dep value hashes like an unset one.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2982 +/- ##
===========================================
+ Coverage 28.28% 79.01% +50.73%
===========================================
Files 74 74
Lines 42086 45841 +3755
===========================================
+ Hits 11904 36222 +24318
+ Misses 30182 9619 -20563 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
I added the test in #2918 |
Contributor
Author
|
Closing: #2989 fixed this on |
Collaborator
|
i am still taking your version, it is better, i didn't see it, sorry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
compiler::rust::test::test_hash_env_dep_equal_to_basedir_is_not_unsetfails onmainon every platform, which turns every open PR's test jobs red. It started with c72ff6c ("rust: reuse dep-info and output lists across compiles of a crate").The test set
Yonly in the mocked dep-info and never in the environment. Both of its compiles therefore had the samedep_info_key, so the second reused the first's remembered env-deps and the test compared a key with itself.rustc reads
Yfrom the environment, so the test now puts a setYthere too, and leaves it out for the unset case. The two compiles get their own dep-info keys again.The test still guards what it was written for: with the
\0prefix removed fromstrip_basedirs_os, it fails again.cargo test --libpasses (625 tests) andcargo clippy --lib --testsis clean.