Skip to content

Commit

Permalink
Disambiguate path dependencies using the ID of the package at the p…
Browse files Browse the repository at this point in the history
…ath root (FuelLabs#1790)

* Disambiguate `path` dependencies using the parent package ID

Implements and closes FuelLabs#1789.

TODO:

- [x] Disambiguate `path` dependencies using parent package ID.
- [ ] Impl `Display` and `FromStr` for `PinnedId` to convert it to and
  from hex for path source string in lock file.
- [ ] Address FuelLabs#1637 now to reduce this PR adding even more noise in the
  lock file `dependencies` lists.
- [ ] Refactor `fetch_deps` slightly to better accomodate new `Root`
  source variant.
- [ ] Update lock files of all examples and tests in repository.

* Swap `ToString` impls for `Display`. Add `PinnedId` impls.

Also removes the `lock::source_from_str/source_to_string` impls in
favour of implementing `Display` and `FromStr` for `SourcePinned`.

* Only disambiguate pkg lock dependencies if the name requires it

Closes FuelLabs#1637.

* Update new add_deps function for changes applied to pin_pkg

* Fix path dependency disambiguation using a path root rather than parent

Improves path dependency disambiguation by using the ID of the package
that is the root of the subgraph of path dependencies.

* Update `examples` forc lock files for path disambiguation changes

* Update E2E test forc lock files for path disambiguation changes

* Update stdlib test lock files for path dependency disambiguation changes

* Update new lock files introduced since previous rebase
  • Loading branch information
mitchmindtree authored Jun 8, 2022
1 parent def850a commit fb4bc7a
Show file tree
Hide file tree
Showing 240 changed files with 882 additions and 147 deletions.
3 changes: 3 additions & 0 deletions examples/asm_return_tuple_pointer/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'asm_return_tuple_pointer'
source = 'root'
dependencies = ['std']

[[package]]
name = 'core'
source = 'path+from-root-25602139F18DA3F2'
dependencies = []

[[package]]
name = 'std'
source = 'path+from-root-25602139F18DA3F2'
dependencies = ['core']
3 changes: 3 additions & 0 deletions examples/counter/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-D8BC155605882939'
dependencies = []

[[package]]
name = 'counter'
source = 'root'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-D8BC155605882939'
dependencies = ['core']
10 changes: 1 addition & 9 deletions examples/enums/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
[[package]]
name = 'core'
dependencies = []

[[package]]
name = 'enums'
source = 'root'
dependencies = []

[[package]]
name = 'std'
source = 'git+https://github.com/fuellabs/sway?tag=v0.14.5#60c626cf486d5c53c44d84db1ec81cb90174cad3'
dependencies = ['core']
3 changes: 3 additions & 0 deletions examples/fizzbuzz/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-08CA839BA84C13D2'
dependencies = []

[[package]]
name = 'fizzbuzz'
source = 'root'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-08CA839BA84C13D2'
dependencies = ['core']
3 changes: 3 additions & 0 deletions examples/hashing/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-BFCC9E74738B0693'
dependencies = []

[[package]]
name = 'hashing'
source = 'root'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-BFCC9E74738B0693'
dependencies = ['core']
3 changes: 3 additions & 0 deletions examples/liquidity_pool/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-FEF37F026EFAF705'
dependencies = []

[[package]]
name = 'liquidity_pool'
source = 'root'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-FEF37F026EFAF705'
dependencies = ['core']
3 changes: 3 additions & 0 deletions examples/match_statements/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-AA21FAE5126585F4'
dependencies = []

[[package]]
name = 'match_statements'
source = 'root'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-AA21FAE5126585F4'
dependencies = ['core']
3 changes: 3 additions & 0 deletions examples/msg_sender/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-8AE06FACEC4CD701'
dependencies = []

[[package]]
name = 'msg_sender'
source = 'root'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-8AE06FACEC4CD701'
dependencies = ['core']
3 changes: 3 additions & 0 deletions examples/native_token/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-A779871B261C194D'
dependencies = []

[[package]]
name = 'native_token'
source = 'root'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-A779871B261C194D'
dependencies = ['core']
3 changes: 3 additions & 0 deletions examples/signatures/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-1C601C86FBCFA98F'
dependencies = []

[[package]]
name = 'signatures'
source = 'root'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-1C601C86FBCFA98F'
dependencies = ['core']
11 changes: 7 additions & 4 deletions examples/storage_example/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-009C3999B9A47E51'
dependencies = []

[[package]]
name = 'storage_example'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-009C3999B9A47E51'
dependencies = ['core']

[[package]]
name = 'storage_example'
source = 'root'
dependencies = ['std']
3 changes: 3 additions & 0 deletions examples/storage_map/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-E6A0C4C40B2C3193'
dependencies = []

[[package]]
name = 'std'
source = 'path+from-root-E6A0C4C40B2C3193'
dependencies = ['core']

[[package]]
name = 'storage_map'
source = 'root'
dependencies = ['std']
10 changes: 1 addition & 9 deletions examples/structs/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
[[package]]
name = 'core'
dependencies = []

[[package]]
name = 'std'
source = 'git+https://github.com/fuellabs/sway?tag=v0.14.5#60c626cf486d5c53c44d84db1ec81cb90174cad3'
dependencies = ['core']

[[package]]
name = 'structs'
source = 'root'
dependencies = []
3 changes: 3 additions & 0 deletions examples/subcurrency/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-237819BD98C87E84'
dependencies = []

[[package]]
name = 'std'
source = 'path+from-root-237819BD98C87E84'
dependencies = ['core']

[[package]]
name = 'subcurrency'
source = 'root'
dependencies = ['std']
1 change: 1 addition & 0 deletions examples/tuples/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[[package]]
name = 'tuples'
source = 'root'
dependencies = []
3 changes: 3 additions & 0 deletions examples/wallet_smart_contract/Forc.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[[package]]
name = 'core'
source = 'path+from-root-E11027628D2FC8AD'
dependencies = []

[[package]]
name = 'std'
source = 'path+from-root-E11027628D2FC8AD'
dependencies = ['core']

[[package]]
name = 'wallet_smart_contract'
source = 'root'
dependencies = ['std']
Loading

0 comments on commit fb4bc7a

Please sign in to comment.