This repository was archived by the owner on May 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 704
[move-package] Support dependency overrides #1023
Open
awelc
wants to merge
10
commits into
sui-move
Choose a base branch
from
aw/dep-override
base: sui-move
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0eeded6
Added dep override parsing and local path normalization
awelc 6312772
[move-package] Support dependency overrides
awelc 9b461a3
Fixed a linting problem
awelc b9870ed
Addressing review comments - round one
awelc aafc655
Addressing review comments - round two
awelc 2ddd632
Refactoring and documentation updates
awelc 2672c71
Finessed some comments
awelc 97267a8
Added more tests and updated comments
awelc 371296b
Removed accidentally added temp files
awelc fa8a38f
Fixed linting errors
awelc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
300 changes: 172 additions & 128 deletions
300
language/tools/move-package/src/resolution/dependency_graph.rs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
1 change: 1 addition & 0 deletions
1
...ove-package/tests/test_sources/diamond_problem_dep_incorrect_override_cycle/Move.resolved
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Failed to resolve dependencies for package 'Root': Found cycle between packages: D -> B -> C -> D |
27 changes: 27 additions & 0 deletions
27
...ls/move-package/tests/test_sources/diamond_problem_dep_incorrect_override_cycle/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Dependency graph and and override (ov) - when override is processed there is no entry in the graph | ||
# yet (override is incorrect). This part is the same as in the | ||
# diamond_problem_dep_incorrect_override_empty test. Additionally, a cycle introduced during graph | ||
# construction interferes with part of the algorithm responsible for validating potentially | ||
# incorrect overrides (dependency_graph::override_verify) and if not explicitly handled would | ||
# trigger infinite recursion. | ||
# | ||
# +--------------------------------------------+ | ||
# | | | ||
# +---->+----+ | | ||
# +---->| B |----+ | | ||
# | +----+ | | | ||
# | | | | ||
# +----+ | | +----+ +----+--+ v1 +----+ | ||
# |Root|----+ +---->| C |-------->| D |--------->| E | | ||
# +----+ | | +----+ +----+ +--->+----+ | ||
# | | | | ||
# | +----+----+ ov(2) | | ||
# +---->| A |------------------------------------+ | ||
# +----+ | ||
[package] | ||
name = "Root" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
A = { local = "./deps_only/A" } | ||
B = { local = "./deps_only/B" } |
7 changes: 7 additions & 0 deletions
7
...age/tests/test_sources/diamond_problem_dep_incorrect_override_cycle/deps_only/A/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "A" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
C = { local = "../C" } | ||
E = { local = "../E", version = "2.0.0", override = true } |
6 changes: 6 additions & 0 deletions
6
...age/tests/test_sources/diamond_problem_dep_incorrect_override_cycle/deps_only/B/Move.toml
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
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" } |
6 changes: 6 additions & 0 deletions
6
...age/tests/test_sources/diamond_problem_dep_incorrect_override_cycle/deps_only/C/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "C" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
D = { local = "../D", version = "1.0.0" } |
7 changes: 7 additions & 0 deletions
7
...age/tests/test_sources/diamond_problem_dep_incorrect_override_cycle/deps_only/D/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "D" | ||
version = "0.0.0" | ||
|
||
[dependencies] | ||
B = { local = "../B" } | ||
E = { local = "../E", version = "1.0.0" } |
3 changes: 3 additions & 0 deletions
3
...age/tests/test_sources/diamond_problem_dep_incorrect_override_cycle/deps_only/E/Move.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[package] | ||
name = "E" | ||
version = "0.0.0" |
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
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.
Uh oh!
There was an error while loading. Please reload this page.