rust-lang / crates.io

The Rust package registry
https://crates.io
Apache License 2.0
2.91k stars 593 forks source link

Filter by bin/lib #814

Open carols10cents opened 7 years ago

carols10cents commented 7 years ago

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.

felipesere commented 6 years ago

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 😄

smokytheangel0 commented 4 years ago

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?

carols10cents commented 4 years ago

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.

smokytheangel0 commented 4 years ago

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.

Turbo87 commented 1 month ago

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.