-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use workspaces and switch to a single Cargo.lock. #36032
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
And does anyone know why |
Thanks for the PR @ahmedcharles! One of my original intentions was that adding a crate was super easy (e.g. didn't require unduly modifying config files), so I'm a little uneasy with these manual lists. I'm afraid it'll make for confusing errors when adding a crate to the compiler or another tool unfortunately. One interesting point, though, is that libstd's and libtest's crate DAGs are quite stable, unlike the compiler's. I wonder if we could implement a hardcoded list of those crates, and avoid having to write down the compiler's DAG as well? I'm envisioning something like this:
This is all kinda unfortunate to do, but hopefully rust-lang/rfcs#1133 will make it easier to implement this as we won't have to split apart the suites. |
Isn't the issue here that bootstrap is forced to read I'm not actually sure how that RFC is related to this at all. If there's a change in cargo in the foreseeable future, then I don't really think it matters much what gets hardcoded today, since it will only last until the next cycle before it can be improved. |
Yeah we just need to know what set of The RFC would allows to take these three "pseudo workspaces" and move them all into one, so we can just pass I'd prefer to not land this until we alleviate the restriction of having to modify the build system when adding a crate. Right now we don't have that restriction, and having a workspace isn't really buying us that much as it's all managed internally anyway, so I'd consider this a step backwards if we can't figure it out for now. |
I was under the impression that this would be necessary for getting rustbuild into a better shape for distribution by distros, since it's mentioned in #34687. I assumed that was more than 'casual' priority, hence why I worked on this. :) If using a single workspace is the desired approach, I'd prefer to be able to make forward progress, somehow. If I can write bootstrap in a way that doesn't require updating on crate additions, probably based on cargo metadata, will that be considered for acceptance? My perspective is that if I want to test all of my local crates in one go, how do I do that with cargo today, assuming a workspace with multiple crates? I'd rather solve the general problem, if that makes sense? Perhaps even a As an aside: I'm still not sure how the RFC about making cargo aware of libstd dependencies (to fix cross compiling) will help it tell you how to test a set of path dependences of a given crate (in a generic way)? They seem like two completely distinct problems, so I'm clearly missing something here still. Note, the issue with this commit isn't specific to libstd, it's IMO, a lack of support for testing either path dependencies or workspaces. |
Oh right, yes! I had forgotten about rustbuild + distros. So thinking about it more, I think
I wouldn't worry about it, it's not relevant to this PR anyway. |
☔ The latest upstream changes (presumably #35718) made this pull request unmergeable. Please resolve the merge conflicts. |
As far as I'm concerned, this is a great foundation upon which to continue working after rust-lang/rfcs#1133 :). |
☔ The latest upstream changes (presumably #35957) made this pull request unmergeable. Please resolve the merge conflicts. |
@ahmedcharles any update here about using |
I've been busy with work lately, but I'll get back to this soon. |
Ok no worries! Let me know if any surprises come up. |
☔ The latest upstream changes (presumably #35021) made this pull request unmergeable. Please resolve the merge conflicts. |
This involves hacking the code used to run cargo test on various packages, because it reads Cargo.lock to determine which packages should be tested. This change implements a blacklist, since that will catch new crates when they are added in the future.
☔ The latest upstream changes (presumably #36551) made this pull request unmergeable. Please resolve the merge conflicts. |
Leverage Cargo workspaces in rustbuild This is a continuation of rust-lang#36032 which implements the change to use `cargo metadata` to learn about the crate graph.
Landed with #37016 |
Leverage Cargo workspaces in rustbuild This is a continuation of rust-lang/rust#36032 which implements the change to use `cargo metadata` to learn about the crate graph.
This involves hacking the code used to run cargo test on various
packages, because it reads Cargo.lock to determine which packages should
be tested. This change implements a blacklist, since that will catch new
crates when they are added in the future.