-
Notifications
You must be signed in to change notification settings - Fork 104
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
Workspace support #276
Workspace support #276
Conversation
@acmcarther sorry about the large PR. Looking forward to your feedback. I'm really hoping you like some of the changes here 😄 |
This is work pulled out of #276 Changes: * renamed settings::testing to settings::tests to be consistent with other modules * Ran cargo fmt
Ah, found https://doc.rust-lang.org/cargo/reference/workspaces.html#the-workspacemetadata-table Sorry to bother 😅 |
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.
I got tired half way through the review (on me, not you, didn't get enough sleep last night), so I'm only half way done. I'll need to continue from about half way through impl/src/metadata.rs on my next review.
Looks good so far. Thank you for your continued work here and throughout the repo!
@acmcarther Hey, I've addressed some stuff here and had questions on a few things but is otherwise ready for another pass 😀 |
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.
This is going to take a very long time to review.
Why is that? Is there something I can do to help with that? |
#276 (comment) |
Oh, is it just that you're busy @acmcarther ? Totally understandable if so. Also, this PR is ready for another review |
@acmcarther Don't know why comments are being hidden (maybe the rebasing?) but I think I've gone over everything now. |
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.
functions are too long man
too long
#276 (comment) |
Humble request to stop rebasing the commits unless you have a good reason. It's wrecking the review history. I try to click https://github.com/google/cargo-raze/pull/276/files/558e3cb7b2259a369880d26642269f376801b73c#diff-c8fe41d4c65c6cc6fc8160d444cb04842ac218c135768f6e4309b18ec27ee784 because you asked me to provide an example, and the link is broken |
@acmcarther Updated. Back to you 🙏 |
This may be a "breaking" change for more obscure projects. Notable the generation of the aliases is controlled by the |
Fixed a typo which should fix CI. |
#277 is also green with no changes other than a rebase |
@acmcarther Hey, are you around to take another quick look? 😅 |
@acmcarther Removed the whitespace. Ready for another pass 🙏 |
Will wait for green from CI |
@acmcarther Just finished 😄 |
@acmcarther thank you so much for all your support!!! 🙏 |
@UebelAndre would it make sense for workspace_member_dir to default to "." for compatibility? After updating I found I was getting cargo/cargo/BUILD.bazel instead of cargo/BUILD.bazel, and had to dig around to find out how to change it. |
@dae I can do that but I originally worried about setting it to Also, what do you think of the name |
Would |
@dae Also, is your project public? I'd love to know more about how raze is used. From what I've gathered, there's two kinds of usage:
I've been focusing on the first case for some time which is partly why Anywho, I'd love to see your project structure and to know which camp you fall into (camp 1 or camp 2) to give me better context for future changes. |
I feel like that's similar to |
I run an open source project that was recently converted to Bazel, though it does not currently use workspaces: https://github.com/ankitects/anki |
(the point being that when the BUILD file moved, I was hunting for something related to the build file that controlled where it was placed) |
Would I be correct in saying your primary frustration was in the lack of documentation? This I can understand and I'm going to be writing documentation ASAP if that's the case or not. I've created #306 to start addressing this feedback. We should continue the conversation there. Also, thanks for showing me your project! 🙏 |
The following pull requests are included in this change set and should be closed first:
This pull requests adds support for cargo workspaces and closes #262
Notable Changes:
workspace_member_dir
which is used to determine the location where a package's dependencies will get aliased. Previously, a BUILD file would be rendered intoworkspace_path
which would contain aliases for direct dependencies. Because we now account for there being multiple packages (ie, in a workspace) a directory matching the name specified byworkspace_member_dir
will be created in each package directory (where aCargo.toml
file lives) containing a BUILD file with the aliases. This is intended to make it easier for users to specify the dependencies they care about as well as maintain the previous behavior (workspace_member_dir
should simply match the package name specified byworkspace_path
to result in no change for existing projects).raze
is gathering metadata and modifying the workspace root'sCargo.toml
to include a workspace definition that includes the binary dependency. This allowsraze
to share a single lockfile for all dependencies and ensure all dependencies use compatible versions with each other. (this actually solves a bug I noticed when generatingwasm-bindgen-cli
forrules_rust
. This dependency will update if the file is regenerated and cause a build error).Cargo-raze
will now output aCargo.raze.lock
file when binary dependencies are specified. This file is authoritative over subsequent raze runs.[workspace.metadata.raze]
. This will take precedence over package definitions ([package.metadata.raze]
) if it's defined. This should provide a consistent central location for settings even in projects that only provide a single root package.Sorry about the large PR. I did a pass to split out what I could into other pull requests but I found it difficult to do so.