Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forc BuildPlan. Change GitHub dependencies to general git support. Add Forc.lock for more deterministic builds. #825

Merged
merged 27 commits into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3b8ece9
Construct `pkg_graph` at beginning of `forc build`
mitchmindtree Feb 21, 2022
2b96fe2
Replace old dependency compilation with new `pkg_graph` approach
mitchmindtree Feb 22, 2022
a4616c7
Move `pkg`-specific code into a new `pkg` submodule
mitchmindtree Feb 22, 2022
28a5598
Address cargo fmt and clippy nits
mitchmindtree Feb 22, 2022
87e48bd
Remove implied pkg from idents in pkg submodule
mitchmindtree Feb 22, 2022
f1165fc
Add support for specifying git dependency via tag
mitchmindtree Feb 23, 2022
1f43770
Fix dependency path handling to be relative to parent
mitchmindtree Feb 23, 2022
0e75565
Remove github-specific logic in favour of new git pkg handling
mitchmindtree Feb 23, 2022
1fb0708
Improve support for determinism and cachability with `Forc.lock`
mitchmindtree Feb 24, 2022
8ade669
Move `BuildPlan` under `pkg` module in anticipation for `forc update`
mitchmindtree Feb 28, 2022
850e2d6
Update `forc update` for lock. Print removed and added deps.
mitchmindtree Feb 28, 2022
c7a6693
Address doc comment nits
mitchmindtree Feb 28, 2022
fb89fc2
Validate `Lock` in accordance with `Manifest`
mitchmindtree Feb 28, 2022
e4ae6e1
Improve formatting of `Forc.lock` related stdout
mitchmindtree Feb 28, 2022
12dd280
Update sway-core petgraph version so that it matches forc
mitchmindtree Feb 28, 2022
8d59752
Update test and examples to pin via git tag rather than version field
mitchmindtree Feb 23, 2022
14affb8
Update some E2E tests due to unpinned `core` dep in `std`
mitchmindtree Feb 28, 2022
289f6ae
Only fetch pkgs that are missing, rather than whole pkg graph
mitchmindtree Mar 2, 2022
c917d92
Update forc git dep from 0.13 to 0.14
mitchmindtree Mar 2, 2022
9494f0b
Fix forc Cargo.toml dependency order
mitchmindtree Mar 2, 2022
e4bdbc0
Update Cargo.lock for the addition of git2, petgraph
mitchmindtree Mar 2, 2022
f381125
Add Forc.lock files for sway examples
mitchmindtree Mar 2, 2022
8fb70c6
Ensure `Namespace` only contains a package's dependencies
mitchmindtree Mar 2, 2022
2405ceb
Pin tests by adding their `Forc.lock` files for reproducibility
mitchmindtree Mar 2, 2022
5bc24e3
Temporarily warn about `version` field in dependencies
mitchmindtree Mar 2, 2022
81e9ebc
Address nits uncaught in anyhow PR review
mitchmindtree Mar 3, 2022
edd39aa
Fix formatting following rebase onto forc anyhow PR
mitchmindtree Mar 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 64 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions examples/fizzbuzz/Forc.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[package]]
name = 'core'
source = 'git+http://github.com/FuelLabs/sway-lib-core?reference=master#c331ed20ebc9d646acec6b8ee8f408627ce3b573'
dependencies = []

[[package]]
name = 'core'
source = 'git+http://github.com/FuelLabs/sway-lib-core?reference=v0.0.1#45c54ab37abde32a10e20964264cf7362dd73caa'
dependencies = []

[[package]]
name = 'fizzbuzz'
dependencies = [
'core git+http://github.com/FuelLabs/sway-lib-core?reference=v0.0.1#45c54ab37abde32a10e20964264cf7362dd73caa',
'std git+http://github.com/FuelLabs/sway-lib-std?reference=v0.0.1#5a0938f8248d820ef178b6efd9c105463c543226',
]

[[package]]
name = 'std'
source = 'git+http://github.com/FuelLabs/sway-lib-std?reference=v0.0.1#5a0938f8248d820ef178b6efd9c105463c543226'
dependencies = ['core git+http://github.com/FuelLabs/sway-lib-core?reference=master#c331ed20ebc9d646acec6b8ee8f408627ce3b573']
4 changes: 2 additions & 2 deletions examples/fizzbuzz/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "fizzbuzz"

[dependencies]
std = { git = "http://github.com/FuelLabs/sway-lib-std", version = "v0.0.1" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", version = "v0.0.1" }
std = { git = "http://github.com/FuelLabs/sway-lib-std", tag = "v0.0.1" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", tag = "v0.0.1" }
21 changes: 21 additions & 0 deletions examples/hello_world/Forc.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[package]]
name = 'core'
source = 'git+http://github.com/FuelLabs/sway-lib-core?reference=master#c331ed20ebc9d646acec6b8ee8f408627ce3b573'
dependencies = []

[[package]]
name = 'core'
source = 'git+http://github.com/FuelLabs/sway-lib-core?reference=v0.0.1#45c54ab37abde32a10e20964264cf7362dd73caa'
dependencies = []

[[package]]
name = 'hello_world'
dependencies = [
'core git+http://github.com/FuelLabs/sway-lib-core?reference=v0.0.1#45c54ab37abde32a10e20964264cf7362dd73caa',
'std git+http://github.com/FuelLabs/sway-lib-std?reference=v0.0.1#5a0938f8248d820ef178b6efd9c105463c543226',
]

[[package]]
name = 'std'
source = 'git+http://github.com/FuelLabs/sway-lib-std?reference=v0.0.1#5a0938f8248d820ef178b6efd9c105463c543226'
dependencies = ['core git+http://github.com/FuelLabs/sway-lib-core?reference=master#c331ed20ebc9d646acec6b8ee8f408627ce3b573']
4 changes: 2 additions & 2 deletions examples/hello_world/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "hello_world"

[dependencies]
std = { git = "http://github.com/FuelLabs/sway-lib-std", version = "v0.0.1" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", version = "v0.0.1" }
std = { git = "http://github.com/FuelLabs/sway-lib-std", tag = "v0.0.1" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", tag = "v0.0.1" }
21 changes: 21 additions & 0 deletions examples/subcurrency/Forc.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[package]]
name = 'core'
source = 'git+http://github.com/FuelLabs/sway-lib-core?reference=master#c331ed20ebc9d646acec6b8ee8f408627ce3b573'
dependencies = []

[[package]]
name = 'core'
source = 'git+http://github.com/FuelLabs/sway-lib-core?reference=v0.0.1#45c54ab37abde32a10e20964264cf7362dd73caa'
dependencies = []

[[package]]
name = 'std'
source = 'git+http://github.com/FuelLabs/sway-lib-std?reference=v0.0.1#5a0938f8248d820ef178b6efd9c105463c543226'
dependencies = ['core git+http://github.com/FuelLabs/sway-lib-core?reference=master#c331ed20ebc9d646acec6b8ee8f408627ce3b573']

[[package]]
name = 'subcurrency'
dependencies = [
'core git+http://github.com/FuelLabs/sway-lib-core?reference=v0.0.1#45c54ab37abde32a10e20964264cf7362dd73caa',
'std git+http://github.com/FuelLabs/sway-lib-std?reference=v0.0.1#5a0938f8248d820ef178b6efd9c105463c543226',
]
4 changes: 2 additions & 2 deletions examples/subcurrency/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "subcurrency"

[dependencies]
std = { git = "http://github.com/FuelLabs/sway-lib-std", version = "v0.0.1" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", version = "v0.0.1" }
std = { git = "http://github.com/FuelLabs/sway-lib-std", tag = "v0.0.1" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", tag = "v0.0.1" }
21 changes: 21 additions & 0 deletions examples/wallet_smart_contract/Forc.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[package]]
name = 'core'
source = 'git+http://github.com/FuelLabs/sway-lib-core?reference=master#c331ed20ebc9d646acec6b8ee8f408627ce3b573'
dependencies = []

[[package]]
name = 'core'
source = 'git+http://github.com/FuelLabs/sway-lib-core?reference=v0.0.1#45c54ab37abde32a10e20964264cf7362dd73caa'
dependencies = []

[[package]]
name = 'std'
source = 'git+http://github.com/FuelLabs/sway-lib-std?reference=v0.0.1#5a0938f8248d820ef178b6efd9c105463c543226'
dependencies = ['core git+http://github.com/FuelLabs/sway-lib-core?reference=master#c331ed20ebc9d646acec6b8ee8f408627ce3b573']

[[package]]
name = 'wallet_smart_contract'
dependencies = [
'core git+http://github.com/FuelLabs/sway-lib-core?reference=v0.0.1#45c54ab37abde32a10e20964264cf7362dd73caa',
'std git+http://github.com/FuelLabs/sway-lib-std?reference=v0.0.1#5a0938f8248d820ef178b6efd9c105463c543226',
]
4 changes: 2 additions & 2 deletions examples/wallet_smart_contract/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ license = "Apache-2.0"
name = "wallet_smart_contract"

[dependencies]
std = { git = "http://github.com/FuelLabs/sway-lib-std", version = "v0.0.1" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", version = "v0.0.1" }
std = { git = "http://github.com/FuelLabs/sway-lib-std", tag = "v0.0.1" }
core = { git = "http://github.com/FuelLabs/sway-lib-core", tag = "v0.0.1" }
10 changes: 6 additions & 4 deletions forc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ anyhow = "1.0.41"
clap = { version = "3.1.2", features = ["env", "derive"] }
clap_complete = "3.1"
dirs = "3.0.2"
flate2 = "1.0.20"
fuel-asm = "0.1"
fuel-asm = "0.1"
fuel-gql-client = { version = "0.3", default-features = false }
fuel-tx = "0.5"
fuel-vm = "0.4"
futures = "0.3"
git2 = "0.14"
hex = "0.4.3"
petgraph = { version = "0.6.0", features = ["serde-1"] }
prettydiff = "0.5.0"
reqwest = { version = "0.11.4", default-features = false, features = ["json", "rustls-tls"] }
semver = "1.0.3"
Expand All @@ -38,11 +39,12 @@ term-table = "1.3"
termcolor = "1.1"
tokio = { version = "1.8.0", features = ["macros", "rt-multi-thread", "process"] }
toml = "0.5"
unicode-xid = "0.2.2"
ureq = "2.4"
url = "2"
uwuify = { version = "^0.2", optional = true }
warp = "0.3"
whoami = "1.1"
unicode-xid = "0.2.2"
uwuify = { version = "^0.2", optional = true }

[features]
default = []
Expand Down
2 changes: 2 additions & 0 deletions forc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#![allow(dead_code)]
mod cli;
mod lock;
mod ops;
mod pkg;
mod utils;

#[cfg(feature = "test")]
Expand Down
Loading