-
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: enable bytecode as dependencies 1/n (#15035)
## Description Make it possible to build packages with bytecode dependencies. This is part of the work to enable compiling against on-chain. ## Test Plan There is a unit test and it was tested manually. --- 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) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes It is now possible to build packages with dependencies with bytecode modules.
- Loading branch information
Showing
19 changed files
with
245 additions
and
70 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/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,9 @@ | ||
[package] | ||
name = "Bar" | ||
version = "0.0.0" | ||
|
||
[addresses] | ||
B = "0x2" | ||
|
||
[dependencies] | ||
Foo = { local = "../C" } |
7 changes: 7 additions & 0 deletions
7
...rnal-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/B/sources/Bar.move
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 @@ | ||
module B::Bar { | ||
use C::Foo; | ||
|
||
public fun foo(): u64 { | ||
Foo::bar() | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/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,6 @@ | ||
[package] | ||
name = "Foo" | ||
version = "0.0.0" | ||
|
||
[addresses] | ||
C = "0x3" |
5 changes: 5 additions & 0 deletions
5
...rnal-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/C/sources/Foo.move
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,5 @@ | ||
module C::Foo { | ||
public fun bar(): u64 { | ||
1 | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/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,10 @@ | ||
[package] | ||
name = "A" | ||
version = "0.0.0" | ||
|
||
[addresses] | ||
A = "0x2" | ||
|
||
[dependencies] | ||
Bar = { local = "./B" } | ||
Foo = { local = "./C" } |
13 changes: 13 additions & 0 deletions
13
external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/args.exp
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,13 @@ | ||
Command `build -v -p ./C`: | ||
BUILDING Foo | ||
External Command `mv ./C/sources/Foo.move ./C/sources/Foo.move_old`: | ||
External Command `rm -rf ./C/build/Foo/sources`: | ||
Command `build -v -p ./B`: | ||
INCLUDING DEPENDENCY Foo | ||
BUILDING Bar | ||
External Command `mv ./B/sources/Bar.move ./C/sources/Bar.move_old`: | ||
External Command `rm -rf ./B/build/Bar/sources`: | ||
Command `build -v`: | ||
INCLUDING DEPENDENCY Bar | ||
INCLUDING DEPENDENCY Foo | ||
BUILDING A |
7 changes: 7 additions & 0 deletions
7
external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/args.txt
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 @@ | ||
build -v -p ./C | ||
> mv ./C/sources/Foo.move ./C/sources/Foo.move_old | ||
> rm -rf ./C/build/Foo/sources | ||
build -v -p ./B | ||
> mv ./B/sources/Bar.move ./C/sources/Bar.move_old | ||
> rm -rf ./B/build/Bar/sources | ||
build -v |
8 changes: 8 additions & 0 deletions
8
external-crates/move/crates/move-cli/tests/build_tests/build_with_bytecode/sources/A.move
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,8 @@ | ||
module A::A { | ||
use B::Bar; | ||
use C::Foo; | ||
|
||
public fun foo(): u64 { | ||
Bar::foo() + Foo::bar() | ||
} | ||
} |
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
Oops, something went wrong.