Filter by bin/lib
Related to, but not quite the same as #483: have a way to filter crates by those that contain binaries or are binary-only, or the opposite, that have a library component.
I was looking for interesting rust binaries for a talk and I stumbled across this. Is this something that people would be keen to see? With a little support I'd like to try this 😄
for both this one and 1904, it seems like we could modify the body and the result of uploader.rs/verify_tarball() so that it could check for naming inconsistencies (in Cargo.toml) as well as return extra information to be stored in the db (such as whether this crate contains main.rs/lib.rs or both). As meantioned in 1904, this would best be accomplished as a background job, and I was wondering what the status quo for paralel work in crates.io, process, thread or async?
We use a framework that sgrif created called swirl. Search in this repo for swirl for some example uses.
I'm not sure that verify_tarball is the right place to do this but that's because our publishing logic has gotten messy and tangled in general; not sure if we should use this opportunity as a forcing function to make us clean up or if we should throw another hack on the pile for now and clean up after.
I would be honoured to help clean up now, but this is not my house so suggestions are neccessary from the team. I have alot of time to work on things, I am attempting to build experience in working with other developers so I don't make alot of n00b mistakes on my portfolio projects for my eventual applications to software companies.
FWIW we now have has_lib and bin_names columns in the database that would potentially allow us to implement a lib/bin filter for the search, if there is enough interest.
Would it be possible to support filtering baaed on binary/library crates in crates searching?
i..e. add a new query param like this https://crates.io/api/v1/crates?sort=downloads&has_binaries=true
Motivation: I'm working on cargo-bins/cargo-quickinstall#268
Without this functionality, I will have to issue one restful API per crate for the most popular crates I got from https://crates.io/api/v1/crates?sort=downloads
it would probably be better to work with our daily database dump instead of regularly querying the API for this information. also, whether a crate version contains a lib or bin does not change overtime, so you should only need to query the information once and then store it on your side.
Thanks!
I didn't think of that, this sounds much more efficient than using APIs.
Where can I get this db dump?
Edit:
thanks I've found it
Just in case anyone finds their way here in the future from a search result or something, the dumps are linked from https://crates.io/data-access#database-dumps.