Crates.io: Allow people to directly download crate source tarball

Created on 23 Nov 2014  ·  9Comments  ·  Source: rust-lang/crates.io

I find it useful if I want to check out a package before depending on it or need to look at the source.

C-enhancement

Most helpful comment

Deployed! this should now work!

All 9 comments

This was originally offered, but this is somewhat nuanced. The fact that the download is a tarball is an implementation detail, so this would need to be accompanied with equivalent support in Cargo itself it inspect and unpack the .crate file that was downloaded.

There needs to be some pointer to the source, regardless what's in the projects Cargo.toml.

Take for ex. https://crates.io/crates/servo-glutin/0.4.10 the only link is to https://github.com/tomaka/glutin which doesn't even have a 0.4.10 version/tag (and this is actually the servo/glutin repo).

The servo/glutin repo only has a servo-0.4.10 tag, which I don't know if is the version on crates.io

as a packager, i need this. i need to point to a file and say “download this and verify with that sha1” instead of “let something download stuff for me”

So the URLs https://crates.io/api/v1/crates/name/version/download work, but that's not really exposed anywhere.

In what manner would yinz want to see this exposed? API docs? A link on the crate page?

So the URLs https://crates.io/api/v1/crates/name/version/download work

It doesn't work anymore; it used to in the past, but I tried it with a few crates and it didn't do the trick, at least not with a browser.

related Stack Overflow question

It doesn't work anymore; it used to in the past, but I tried it with a few crates and it didn't do the trick, at least not with a browser.

It won't work with a browser, no, but curl should work.

It won't work with a browser, no, but curl should work.

I checked it; it works.

I would suggest describing this download method in the API docs, especially since it is not trivial - you need to pass the -L option (follow redirects), otherwise you may not receive anything. In addition, although the downloaded file's extension is .crate (and after unzipping it the file has a .crate extension again), it is a tarball (.tar.gz).

It should work in the browser after the next deploy

Deployed! this should now work!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vrdhn picture vrdhn  ·  4Comments

carols10cents picture carols10cents  ·  9Comments

vignesh-sankaran picture vignesh-sankaran  ·  5Comments

ehuss picture ehuss  ·  5Comments

XuShaohua picture XuShaohua  ·  5Comments