-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[move] Update syntax and usage for external resolvers in Move packages (
#19561) ## Description This updates the way external package resolvers are declared and used inside Move packages. In particular, external resolvers can be prefixed by `r.` so to use an external resolver binary `foo` you would declare a dependency like `A = { r.foo = "bar", <other args if you want here> }`. This additionally adds support for resolver-specific configs in the `Move.toml` however these are treated opaquely -- any top-level item prefixed with `r.` will be allowed by the parser. Bottom commit are the changes + new tests, and top commit are the test updates. ## Test plan Added new tests, as well as updated existing tests and made sure they continued to work as expected.
- Loading branch information
Showing
45 changed files
with
208 additions
and
124 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
8 changes: 2 additions & 6 deletions
8
...sts/test_sources/diamond_problem_dep_external_incorrect_override_v1/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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
[package] | ||
name = "C" | ||
|
||
[dependencies.A] | ||
resolver = "../../../resolvers/successful.sh" | ||
|
||
[dependencies.A.packages] | ||
Contains = "Anything" | ||
Has = { No = "Schema" } | ||
[dependencies] | ||
A = { r."../../../resolvers/successful.sh" = "A" } |
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
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
8 changes: 2 additions & 6 deletions
8
...ckage/tests/test_sources/diamond_problem_dep_external_override_root/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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
[package] | ||
name = "C" | ||
|
||
[dependencies.A] | ||
resolver = "../../../resolvers/successful.sh" | ||
|
||
[dependencies.A.packages] | ||
Contains = "Anything" | ||
Has = { No = "Schema" } | ||
[dependencies] | ||
A = { r."../../../resolvers/successful.sh" = "A" } |
8 changes: 2 additions & 6 deletions
8
...-package/tests/test_sources/diamond_problem_dep_nested_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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
[package] | ||
name = "C" | ||
|
||
[dependencies.A] | ||
resolver = "../../../resolvers/successful_subst.sh" | ||
|
||
[dependencies.A.packages] | ||
Contains = "Anything" | ||
Has = { No = "Schema" } | ||
[dependencies] | ||
A = { r."../../../resolvers/successful_subst.sh" = "A" } |
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
8 changes: 2 additions & 6 deletions
8
external-crates/move/crates/move-package/tests/test_sources/external/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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
[package] | ||
name = "Root" | ||
|
||
[dependencies.A] | ||
resolver = "../resolvers/successful.sh" | ||
|
||
[dependencies.A.packages] | ||
Contains = "Anything" | ||
Has = { No = "Schema" } | ||
[dependencies] | ||
A = { r."../resolvers/successful.sh" = "A" } |
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
4 changes: 2 additions & 2 deletions
4
external-crates/move/crates/move-package/tests/test_sources/external_bad_dep/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "Root" | ||
|
||
[dependencies.A] | ||
[dependencies] | ||
# The resolver will introduce Root -> A -> ADep into the dependency | ||
# graph, but ADep doesn't exist, so it will fail. | ||
resolver = "../resolvers/successful.sh" | ||
A = { r."../resolvers/successful.sh" = "A" } |
4 changes: 2 additions & 2 deletions
4
external-crates/move/crates/move-package/tests/test_sources/external_broken/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "Root" | ||
|
||
[dependencies.A] | ||
# This resolver exits with success but returns bad output (not a lock | ||
# file), so resolution fails. | ||
resolver = "../resolvers/broken.sh" | ||
[dependencies] | ||
A = {r."../resolvers/broken.sh" = "a" } |
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
8 changes: 4 additions & 4 deletions
8
external-crates/move/crates/move-package/tests/test_sources/external_dev_dep/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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[package] | ||
name = "Root" | ||
|
||
[dependencies.A] | ||
resolver = "../resolvers/successful.sh" | ||
[dependencies] | ||
A = { r."../resolvers/successful.sh" = "A" } | ||
|
||
[dev-dependencies.B] | ||
[dev-dependencies] | ||
# External resolvers can be used for dev dependencies as well as | ||
# regular dependencies | ||
resolver = "../resolvers/successful.sh" | ||
B = { r."../resolvers/successful.sh" = "B" } |
4 changes: 2 additions & 2 deletions
4
external-crates/move/crates/move-package/tests/test_sources/external_failing/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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "Root" | ||
|
||
[dependencies.A] | ||
[dependencies] | ||
# This resolver returns a non-zero exit code, which should cause | ||
# resolution to fail. | ||
resolver = "../resolvers/failing.sh" | ||
A = { r."../resolvers/failing.sh" = "A" } |
4 changes: 2 additions & 2 deletions
4
external-crates/move/crates/move-package/tests/test_sources/external_no_resolver/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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "Root" | ||
|
||
[dependencies.A] | ||
# This resolver doesn't exist, so calling out to it will fail. | ||
resolver = "../resolvers/doesnt_exist.sh" | ||
[dependencies] | ||
A = { r."../resolvers/doesnt_exist.sh" = "A" } |
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
6 changes: 6 additions & 0 deletions
6
...l-crates/move/crates/move-package/tests/test_sources/external_resolver_config/Move.locked
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 @@ | ||
# @generated by Move, please check-in and do not edit manually. | ||
|
||
[move] | ||
version = 3 | ||
manifest_digest = "D0A99B6D19946036C7A76C46B5B13EC9E47ED5FB3B8940036A0B93D627225A8A" | ||
deps_digest = "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855" |
Oops, something went wrong.