-
Notifications
You must be signed in to change notification settings - Fork 314
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
More Cargo improvements #8497
Merged
Merged
More Cargo improvements #8497
Conversation
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 was referenced Apr 8, 2024
mnonnenmacher
requested changes
Apr 8, 2024
plugins/package-managers/cargo/src/main/kotlin/CargoMetadata.kt
Outdated
Show resolved
Hide resolved
Similar to like in e6b84fa, get the data directly from `projectPkg` which already contains the processed declared licenses. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Reduce the number of top-level functions for a better overview. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
fviernau
previously requested changes
Apr 9, 2024
@@ -93,6 +93,30 @@ internal data class CargoMetadata( | |||
/** The Package ID of this node. */ | |||
val id: String, | |||
/** The dependencies of this package, an array of Package IDs. */ | |||
val dependencies: List<String> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit message: Would you have a link pointing to some definition of "renamed dependencies" ?
This will allow to track renamed dependencies [1] in the future. [1]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#renaming-dependencies-in-cargotoml Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Rewrite getting the dependencies using `Node.deps` to be able to make fewer assumptions about Cargo's internal package IDs as a preparation for supporting Cargo 1.77 [1] and newer, which did "Stabilize the package identifier format as Package ID Spec" [2]. [1]: https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-177-2024-03-21 [2]: https://doc.rust-lang.org/nightly/cargo/reference/pkgid-spec.html Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Both lockfile versions 1 and 2 did not use a `version` field as part of the lockfile yet. One way to distinguish these versions is to look for the presence of "checksum" entries in the `metadata` field, see [1]. Do that and treat version 2 like version 3, instead of treating version 2 like version 1 before. [1]: rust-lang/cargo@34bca03 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
…kups The `pkg.id` is Cargo's internal package ID which does not look like "name version (source)" for all Cargo versions. So avoid using it and instead be explicit about the key format that was used to build the `hashes` map. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Instead of determining projects based on Cargo's internal package ID, use the `source` property which is `null` for local code. Fixes #8480. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Make higher-level functions go first for a better overview. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
mnonnenmacher
approved these changes
Apr 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please have a look at the individual commit messages for the details.