-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Relative git submodules did not resolve correctly #12151
Comments
Thanks for the report! The fix shouldn't be difficult I guess. Here and here since Cargo recurses into child submodules, we should pass the I'd also suggest renaming this cargo/src/cargo/sources/git/utils.rs Lines 447 to 467 in e07efd8
|
fix: git submodules with relative urls ### What does this PR try to resolve? Fixes #12151. When recursing submodules, the url of the parent remote was being passed to `update_submodules` instead of the child remote url. This caused Cargo to try to add the wrong submodule. ### How should we test and review this PR? A test case is added in the first commit. The second one renames the `url` variable as suggested in the issue. The third includes the changes to fix the issue. The last one includes a minor refactor where a redundant `match` expr is removed.
Problem
I'm trying to add dependency from git repo that have submodule from different git org/user. That submodule also have submodule as dependency. It looks something like this:
When cargo fetch the submodule, it's using the wrong url, instead of fetching from
https://github.com/ArtifexSoftware/thirdparty-curl.git
, it's fetching fromhttps://github.com/messense/thirdparty-curl.git
. When I check the.gitmodules
in the repo, it has relative url.the
.gitmodules
looks like this:Steps
cargo new test-submodule
cd test-submodule
cargo add mupdf --git "https://github.com/messense/mupdf-rs.git" --rev "77f17e2b52beeeb108927f65471f122dc572740e"
cargo build
Possible Solution(s)
No response
Notes
log:
Version
The text was updated successfully, but these errors were encountered: