-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[move-package] Support dependency overrides (#11181)
## Description When building a dependency graph, different versions of the same (transitively) dependent package can be encountered. If this is indeed the case, a single version must be chosen by the developer to be the override, and this override must be specified in a manifest file whose package dominates all the conflicting "uses" of the dependent package. These overrides must taken into consideration during the dependency graph construction and this PR implements the relevant changes to dependency graph construction algorithm. For additional details see the doc-comments in the code as well as the PR this one is based on (move-language/move#1023) which contains a discussion of issues encountered during development of this algorithm. ## Test Plan A comprehensive test suite is attached. --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [x] user-visible impact ### Release notes This change allows a developer to override transitive dependencies of a package they are developing to avoid conflicts that could otherwise arise.
- Loading branch information
Showing
164 changed files
with
4,833 additions
and
160 deletions.
There are no files selected for viewing
586 changes: 475 additions & 111 deletions
586
tools/move-package/src/resolution/dependency_graph.rs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
3 changes: 3 additions & 0 deletions
3
tools/move-package/tests/test_sources/diamond_problem_dep_conflict/Move.resolved
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Failed to resolve dependencies for package 'Root': Resolving dependencies for package 'B': Conflicting dependencies found: | ||
C = { local = "deps_only/C", version = "2.0.0" } | ||
C = { local = "deps_only/C", version = "1.0.0" } |
7 changes: 7 additions & 0 deletions
7
tools/move-package/tests/test_sources/diamond_problem_dep_conflict/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "Root" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
A = { local = "./deps_only/A" } | ||
B = { local = "./deps_only/B" } |
6 changes: 6 additions & 0 deletions
6
tools/move-package/tests/test_sources/diamond_problem_dep_conflict/deps_only/A/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "A" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
C = { local = "../C", version = "2.0.0" } |
6 changes: 6 additions & 0 deletions
6
tools/move-package/tests/test_sources/diamond_problem_dep_conflict/deps_only/B/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "B" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
C = { local = "../C", version = "1.0.0" } |
3 changes: 3 additions & 0 deletions
3
tools/move-package/tests/test_sources/diamond_problem_dep_conflict/deps_only/C/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[package] | ||
name = "C" | ||
version = "0.0.0" |
3 changes: 3 additions & 0 deletions
3
tools/move-package/tests/test_sources/diamond_problem_dep_external_conflict/Move.resolved
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Failed to resolve dependencies for package 'Root': Adding dependencies from ../resolvers/successful.sh for dependency 'A' in 'Root': Conflicting dependencies found: | ||
ADep = { local = "deps_only/ADep", version = "1.0.0" } | ||
ADep = { local = "deps_only/ADep" } # Resolved by ../resolvers/successful.sh |
Oops, something went wrong.