Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add has_lib and bin_names fields to the versions API #8859

Merged
merged 5 commits into from
Jul 3, 2024

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Jun 13, 2024

https://docs.rs/cargo-manifest/latest/cargo_manifest/struct.Manifest.html#method.complete_from_abstract_filesystem is used to find implicit libraries or binaries in the crate file.

Tasks:

  • find libraries, binaries, etc. in the crate file
  • save that data in the database
  • expose that data in the API
  • adjust the install instructions on the web frontend depending on the data (see Show cargo install for crates with binaries #8883)
  • figure out a way to backfill the data for existing versions

Related:

@Turbo87 Turbo87 added C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works A-frontend 🐹 A-backend ⚙️ labels Jun 13, 2024
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.03%. Comparing base (db08219) to head (4d3342d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8859      +/-   ##
==========================================
+ Coverage   88.99%   89.03%   +0.03%     
==========================================
  Files         277      277              
  Lines       27845    27948     +103     
==========================================
+ Hits        24781    24883     +102     
- Misses       3064     3065       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Turbo87 Turbo87 force-pushed the lib-or-bin branch 2 times, most recently from db90124 to 000d461 Compare June 14, 2024 16:31
@bors
Copy link
Contributor

bors commented Jun 16, 2024

☔ The latest upstream changes (presumably ea2354c) made this pull request unmergeable. Please resolve the merge conflicts.

@Turbo87 Turbo87 force-pushed the lib-or-bin branch 2 times, most recently from fa2f990 to 5264735 Compare June 17, 2024 07:42
@Turbo87 Turbo87 marked this pull request as ready for review June 17, 2024 07:42
@Turbo87 Turbo87 requested a review from a team June 17, 2024 07:42
@Turbo87
Copy link
Member Author

Turbo87 commented Jun 17, 2024

This PR is ready for review now. The frontend part of this work will be opened in an independent PR, same for the backfilling code.

@Turbo87 Turbo87 changed the title WIP: Show cargo install for non-library crates Show cargo install for non-library crates Jun 17, 2024
@Turbo87 Turbo87 changed the title Show cargo install for non-library crates Add has_lib and bin_names fields to the versions API Jun 17, 2024
Copy link
Contributor

@LawnGnome LawnGnome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the obvious caveat that we're now dependent on cargo-manifest's target discovery working the same way as cargo, this LGTM. (On the bright side, this is something that's easily re-backfilled later if there are any issues, and certainly not on any critical path for publishing or using crates.)

@Turbo87
Copy link
Member Author

Turbo87 commented Jun 17, 2024

With the obvious caveat that we're now dependent on cargo-manifest's target discovery working the same way as cargo, this LGTM.

yeah, that's why I'm currently working on fixing some of the finer details of the target auto-discovery in cargo-manifest :D

Turbo87 added 5 commits July 3, 2024 13:35
…` to detect crate "products"

`Manifest::complete_from_abstract_filesystem()` looks at the filesystem paths and finds implicit "products" like libraries, binaries, or examples. This data can later be stored in the database to show `cargo install` instructions for non-library crates.
@Turbo87
Copy link
Member Author

Turbo87 commented Jul 3, 2024

#8951 has been merged, so this is now unblocked :)

@Turbo87 Turbo87 merged commit 4ba4d1d into rust-lang:main Jul 3, 2024
9 checks passed
@Turbo87 Turbo87 deleted the lib-or-bin branch July 3, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants