Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

[8/x][move-package/lock] DependencyGraph::immediate_dependencies #784

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

amnn
Copy link
Collaborator

@amnn amnn commented Jan 2, 2023

amnn added 5 commits January 23, 2023 22:16
The initial design of `DependencyGraph` only allowed for one
`addr_subst` and `digest` per package in the transitive dependency
graph, but in actuality there can be as many of these as there are
dependency edges to that package:

- Different `addr_subst` for different packages `P`, `Q` depending on
  `R` allows the same address in `R` to appear as different addresses
  in `P` and `Q`.
- If `R` is a dependency of `P` and a dev-dependency of `Q`, then its
  source digest may differ between the two.

Fixed by moving the `subst` and `digest` to be edge labels in the
graph, rather than node labels.

Note that this also changes the lock file format in the following
ways:

- A package's dependencies are now no longer just the name of the
  dependency, but an inline table containing the name and optionally
  the digest and address substitution.
- The key within the `move` table that contains all the transitive
  dependencies is now called `package` rather than `dependency` (this
  was mainly driven by the naming within the schema, which required a
  name for the new, richer format for a package's dependencies.)

Test Plan:

```
move/language/tools/move-cli$ cargo nextest
move/language/tools/move-package$ cargo nextest
```
Function to return a package's immediate dependencies in the
transitive dependency graph, for use by `ResolutionGraph` when
resolving renamings and in-scope addresses during resolution

Test Plan:

New tests:

```
move/language/tools/move-package$ cargo nextest
```
Copy link
Member

@tnowacki tnowacki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8/x looks good to me!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants