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

Submodules with relative paths #7992

Closed
gliderkite opened this issue Mar 12, 2020 · 0 comments · Fixed by #11106
Closed

Submodules with relative paths #7992

gliderkite opened this issue Mar 12, 2020 · 0 comments · Fixed by #11106
Labels
A-git Area: anything dealing with git C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@gliderkite
Copy link

I have a crate base in a git repository hosted in GitLab that uses submodules, and none of this submodules are actually necessary to cargo build the crate:

[submodule "deployment"]
	path = deployment
	url = ../../backend/deployment.git

Please nothe the use of a relative url, since GitLab requires it.

I also have another crate super that needs to have base as a dependency. Normally I'll add my dependency in the Cargo.toml of super with:

base = { git = "ssh://gitlab.example.com/backend/base" }

Unfortunately this raises the following error when I run cargo update or try to build the project:

error: failed to load source for a dependency on `base`

Caused by:
  Unable to update ssh://gitlab.example.com/backend/base

Caused by:
  failed to update submodule `deployment`

Caused by:
  failed to fetch submodule `deployment` from ../../backend/deployment.git

Caused by:
  unsupported URL protocol; class=Net (12)

I guess the problem is the relative path of the submodule, so as workaround for now I add to super a new submodule pointing to base and I specify its local path in the Cargo.toml:

base = { path = "base" }
  • Is there a way to use relative paths for submodules and avoid this error?
  • Since I don't actually need the submodules to build base, is there a way to tell cargo to skip fetching the submodules of base?
@gliderkite gliderkite added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Mar 12, 2020
@ehuss ehuss added the A-git Area: anything dealing with git label Mar 24, 2020
SafariMonkey added a commit to SafariMonkey/reactphysics3d-sys that referenced this issue Nov 24, 2021
Submodules with relative paths don't work
rust-lang/cargo#7992
SafariMonkey added a commit to SafariMonkey/reactphysics3d-sys that referenced this issue Nov 24, 2021
Submodules with relative paths don't work
rust-lang/cargo#7992
@bors bors closed this as completed in 23ab870 Sep 21, 2022
n-prat added a commit to Interstellar-Network/lib-garble-rs that referenced this issue Jan 4, 2023
Apparently cargo does not like relative ones rust-lang/cargo#7992
(Even with CARGO_NET_GIT_FETCH_WITH_CLI=true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
2 participants