Closed
Description
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 tellcargo
to skip fetching the submodules ofbase
?