rust: add support for finding packages in virtual workspaces#1180
rust: add support for finding packages in virtual workspaces#1180j178 merged 7 commits intoj178:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1180 +/- ##
==========================================
+ Coverage 89.70% 89.74% +0.03%
==========================================
Files 77 78 +1
Lines 14599 14737 +138
==========================================
+ Hits 13096 13225 +129
- Misses 1503 1512 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +1.83% (16.4 MiB → 16.7 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
455ea3c to
76fe2a6
Compare
e622e9b to
3d3ce36
Compare
|
Thanks! |
| .await?; | ||
| } else if lib_deps.is_empty() { | ||
| // For workspace members without lib deps, use cargo build + copy | ||
| // (cargo install doesn't work well with virtual workspaces) |
There was a problem hiding this comment.
What problem is this?
(context: also a cargo team member)
There was a problem hiding this comment.
Here I was trying to install a specific binary from its path whose metadata I got from the workspace, and tried a few ways. I ended up deciding that it’s best to just build and copy the binary rather than try to point to the subpath. I forget exactly what error I was getting but this looked like the best way to do it.
There was a problem hiding this comment.
I would assume that the same install approach should be used regardless of whether the package is in the root of a workspace or not. It keeps the code simpler and makes it faster to discover the root cause of undesired behavior.
The following seemed to work for me
cargo +nightly install -Zunstable-options --dry-run --path ../typos/crates/typos-cli/ --bins(-Z is for --dry-run to work)
There was a problem hiding this comment.
Hmmm yes let me throw this in an issue so I can come back to it...
Edit: opened #1191 to track
language: rustfails with virtual workspaces #1174 (which pre-commit never supported)What's new:
typos-srchook in the crate-ci/typos repocargo_metadatato get package binary info robustly (+1.22% or +0.2MB binary size)Status