Cargo and non-git

I have a few projects that I may want to publish in the not-too-distant-future. Reading the cargo documentation left me a little confused; when specifying repository location for dependencies there's a "service" field, but the only values I can find for it are essentially git1, git2 and git3.

How does one reference a non-git repository? In my case it's fossil, but if that's not possible, I assumed it would be possible to specify a tarball-via-{ftp,http}. Is this not the case?

I don't think it's possible to use a tarball directly.

You can specify path = "../dir" dependency, but you need to make it available at that path.

You can create an alternative registry that will serve metadata and the tarball, but that's probably an overkill for one package.

If you're planning to publish on crates.io, then you can't use any of it anyway. crates-io only accepts crates-io deps.

1 Like