-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(package): detect dirty workspace manifest
This addresses one of the corner cases of VCS dirtiness in #14967. > Workspace inheritance — like changing `workspace.package.edition` > to `2021` would actually make member Cargo.toml dirty, > but the current dirty status check doesn't capture that. The solution here is * Retrieve workspace manifest from Git index. * Use the ws manifest from index to normalize package manifest. * Compare the difference between normalized tomls from Git index and from Git working directory. The implementation here is a bit ugly, as it exposes some internals functions to `pub(crate)`. The current implementation also has performance issues. When the workspace contains lots of members and has a dirty workspace manifest: * It adds one extra manifest parsing and normalization for checking each member. * Parsing part can be cached for the entire workspace. However normalization cannot be skipped. * It adds two TOML serializations for checking each member. * If we derive `Eq` for manifest types, we might be able to skip serializations and instead just compare them.
- Loading branch information
Showing
4 changed files
with
185 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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