Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: emit dependency relationships found in Cargo.lock #3443

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

willmurphyscode
Copy link
Contributor

@willmurphyscode willmurphyscode commented Nov 14, 2024

Include updating test dependency to have dependencies on multiple versions of the same crate.

Description

Partially implements #572 by adding support for emitting dependency relationships between crates as enumerated in Cargo.lock files.

Fixes #2353.

Type of change

This is a new feature.

Checklist:

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

Include updating test dependency to have dependencies on multiple
versions of the same crate.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
@willmurphyscode willmurphyscode added the enhancement New feature or request label Nov 14, 2024
I haven't actually seen the other two types of keys in the wild.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
Copy link
Contributor

@wagoodman wagoodman left a comment

Choose a reason for hiding this comment

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

nice!

Just an fyi, there is a dependency.Specifier and processor for these kinds of things (see the dpkg dependency and its usage as a cataloger post-processor.

The one difference with that specific approach and here is that we'd want to still keep dependencies from the single cargo.lock related (and not related to seemingly overlapping dependencies in other cargo.lock files), which means it's use as a post-processor across all packages found by the cataloger wouldn't be correct, but it could be used within the cataloger instead as a post-processor, thus reusing the abstraction.

No need to change this code on the PR, but could be helpful for future PRs like this one.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
@willmurphyscode willmurphyscode merged commit bc35345 into main Nov 14, 2024
12 checks passed
@willmurphyscode willmurphyscode deleted the feat-cargo-lock-dep-relationships branch November 14, 2024 21:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Surface Rust dependency relationships
2 participants