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

Add support for relative git submodule paths #9592

Closed
wants to merge 6 commits into from

Conversation

francis-starlab
Copy link

@francis-starlab francis-starlab commented Jun 17, 2021

GIt allows submodules to have relative URLs, but cargo does not handle this correctly, and simply fails to update submodules as described in issue #7992. This PR fixes that by passing in the parent git repo url to update_submodules.

Closes #7992

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 17, 2021
@ehuss
Copy link
Contributor

ehuss commented Jun 18, 2021

This looks great! Can you maybe change the test so that deployment is a dependency to verify that it is checked out correctly? I think to do that, in the base project, instead of using basic_lib_manifest, it would need to have a Cargo.toml that specifies a path dependency

[package]
name = "base"
version = "0.1.0"

[dependencies]
deployment.path = "deployment"

@ehuss ehuss changed the title Close #7992 Add support for relative git submodule paths Jun 18, 2021
@ehuss
Copy link
Contributor

ehuss commented Jun 18, 2021

Oh, and btw, it is usually best to use a descriptive title for a PR. Just mentioned an issue number doesn't have any context (especially when looking at a git log, or a list of PRs), and isn't clickable in the github UI. Also, to link an issue to a PR requires special keywords in the description (I edited it to add that).

@ehuss ehuss added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 21, 2021
@francis-starlab
Copy link
Author

@ehuss CI seems to be failing on windows, and I don't have easy access to a windows machine, so might take a few days for me to confirm fixes to those CI failures.

@francis-starlab francis-starlab force-pushed the issue-7992 branch 5 times, most recently from 4b9dfa7 to a194bfc Compare September 13, 2021 04:54
@stephenctw
Copy link

Really like to see this working.

@francis-starlab
Copy link
Author

Really like to see this working.

Yeah sorry about the time this is taking. I likely need to get a windows vm or something to debug this and its not currently a priority, so could take a while.

@stephenctw
Copy link

I have a regular windows laptop, if you can guide me, I am willing to help.

@bors
Copy link
Contributor

bors commented Jan 18, 2022

☔ The latest upstream changes (presumably #10296) made this pull request unmergeable. Please resolve the merge conflicts.

@ehuss
Copy link
Contributor

ehuss commented Mar 23, 2022

Closing due to inactivity. If someone wants to pick this back up, and has a Windows system to resolve the issues, feel free to open a new PR.

@ehuss ehuss closed this Mar 23, 2022
bors added a commit that referenced this pull request Sep 21, 2022
Add support for relative git submodule paths

Fixes #7992.

This is a continuation of #9592, tested on Linux and Windows.

> Git allows submodules to have relative URLs, but cargo does not handle this correctly, and simply fails to update submodules as described in issue #7992. This PR fixes that by passing in the parent git repo url to update_submodules.

The previous PR wasn't compatible on Windows, since it used [`std::path::Path`](https://doc.rust-lang.org/std/path/struct.Path.html) for merging the parent and relative submodule urls.

This PR uses [`url::Url`](https://docs.rs/url/latest/url/struct.Url.html) instead, which has the same behavior on all platforms. It also refers to the [git documentation](https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-add-bltbranchgt-f--force--nameltnamegt--referenceltrepositorygt--depthltdepthgt--ltrepositorygtltpathgt) for the definition of a relative git submodule path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Submodules with relative paths
6 participants