4 ms·
`rg` has only one version, and one line of code: println!("You meant to install ripgrep: type `cargo uninstall rg` followed by `cargo install ripgrep`");
by micouay 4y ago
`rg` has only one version, and one line of code:
println!("You meant to install ripgrep: type `cargo uninstall rg` followed by `cargo install ripgrep`");
- dtolnay 4y agoSeems like it would be better to contain: compile_error!("You meant to …"); so that the install would fail and `cargo uninstall rg` wouldn't be needed.
- burntsushi 4y agoYeah that sounds much nicer.
- taink 4y agoCan always-failing-to-compile crates be deployed to the registry?
- orf 4y agoYes
- Arnavion 4y agocrates.io doesn't try to build crates. It couldn't do that anyway. Crates can require arbitrary C library dependencies, only run on some specific targets, etc. That's why docs.rs has to make some effort to be able to build crates, and even it doesn't get all of them.
- oconnor663 4y agoYes, `cargo publish` has the `--no-verify` flag if you want to force this. I think all the verification is client-side.
- est31 4y agoThere is some server side verification, mostly around checking that the dependencies all exist, the file isn't too large, etc. But 99% of the testing happens on the client. Eg: https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a7334357d573a1486d4fa60f1/src/controllers/krate/publish.rs#L386-L437 https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a... https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a7334357d573a1486d4fa60f1/src/controllers/krate/publish.rs#L325 https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a... https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a7334357d573a1486d4fa60f1/src/controllers/krate/publish.rs#L278 https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a... https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a7334357d573a1486d4fa60f1/src/views/krate_publish.rs#L16-L36 https://github.com/rust-lang/crates.io/blob/58e505f2abdabd6a...