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

cargo-bazel: Corrected sparse registry splicing code #2325

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

JulianSchmid
Copy link
Contributor

@JulianSchmid JulianSchmid commented Dec 13, 2023

This is a fix for supporting sparse-registries (private).

Issue:

When we tried to use crate_universe together with an internal sparse registry (Artifactory) we ran into an issue. cargo-bazel splice was not correctly detecting sparse registries as "sparse", even though the URLs correctly started with the "sparse+https://" prefix in the Cargo.lock file. Instead it re-interpreted them as registries with a git index.

The root cause of this is thatcargo_lock::Lockfile automatically removes the prefix sparse+ from the URL and the only way to determine that a registry is sparse is to check the kind. The code previously assumed it could check for sparse registries by checking if the url starts with "sparse+https://".

Problem solution:

This pull requests adapts the code so it uses the lockfile "SourceKind" instead of the URL to check if a registry is sparse or not.

Copy link
Collaborator

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Thanks!

@illicitonion illicitonion merged commit 33e1820 into bazelbuild:main Dec 13, 2023
3 checks passed
@JulianSchmid JulianSchmid deleted the sparse-fix branch December 18, 2023 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants