-
Notifications
You must be signed in to change notification settings - Fork 99
Refine support for workspaces #950
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
base: main
Are you sure you want to change the base?
Refine support for workspaces #950
Conversation
Thanks! I think you discussed the changes a bit on Discord, and they look good to me. Could you also go over what has changed in the description of the issue making it easier to keep a record? |
let (path, name) = file?; | ||
if ["lib", "main"].iter().any(|entry| *entry == name) { | ||
output.try_push(Found { | ||
kind: FoundKind::Source, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we might want to be careful about is that a lib
and a main
are two different kinds of entrypoints. One is a binary named the same as the crate and if we follow Rust autosource conventions there can be more binaries under a src/bin
folder. The other is a library.
I'm not sure this matters, but now might be a good time to set up workspace tests to make sure things work as intended even when many things are named the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree. I'll try to formalize this to match Rust conventions and change the existing workspace stuff in the repo to match next week. I just wanted to make sure I was on the right track first 🙂
…ction to workspaces
6168832
to
164927f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thank you for putting this together! I'll merge this when I get back feel free in case you want to tinker some more.
The |
This PR refines the existing workspace support to closely align with the typical Rust package layout.
For a full description of the workspace auto-detection based on package structure, see the new section of the book.
On top of the new tests for workspace handling, the sample workspace created for the test was verified against the CLI commands for
check
,doc
,test
,bench
,run
, andfmt
to make sure the correct workspace members were picked up.