This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix two bugs which together caused a crash in crates with a lib and bin
The first bug was in identifying the Cargo unit for a dirty file. We do this by comparing paths for each unit and the dirty file and choosing the unit with the longest prefix of the dirty file. For example if we have a unit at foo/bar and one at foo, and a dirty file at foo/bar/baz.rs, then the first unit would win. However, we were not checking that the unit was a prefix at all of the dirty file, so that foo/bar/bin would win over foo, even though foo ought to win. The second bug was that even after getting the right unit, there might not be a compiler job in our cache. This could happen if the workspace has crates a and b where b depends on b, a does not compile, so we have never attempted to compile b, then the user edits b. In this case we used to panic. We now do a full Cargo build which resets our caches and ensures we won't even try to build b.
- Loading branch information