Hi there!
I am building a project that is organized in the following structure:
- A main repo (called "api"), hosted on Github
- Multiple submodules, each hosted in their own Github repo and linked to the main repo under a modules/ directory, as well as on a .gitmodules file
The main repo has 2 of these submodules as direct dependencies. The submodules also have dependencies among themselves (they're not independent pieces).
Example: Cargo.toml from the main repo
...
[dependencies]
api_auth = { git = "https://github.com/name/api_auth.git", version = "0.1.0", optional = true }
api_extensions = { git = "https://github.com/name/api_extensions.git", version = "0.1.0" }
Now I am trying to build and package the main repo into a tarball.
I ran cargo build
, then cargo package
.
Unfortunately, cargo package
fails me with the error:
error: failed to prepare local package for uploading
Caused by:
no matching package named `api_auth` found
location searched: registry `crates-io`
required by package `api v0.1.0
I understand that it is looking for the api_auth submodule on crates-io, but it shouldn't, as I have specified that it is on Github.
I only added the version = "0.1.0" on the two Git dependencies because before that, it was throwing me another error saying that all dependencies need versions.
Can you help me? Thanks!
Note: I need to host all of these things on Github instead of crates.io because they need to be private.