-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Make cargo a workspace #11851
Make cargo a workspace #11851
Conversation
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
imo everything buildable should be in it
I agree that it should be separate. Sometimes, I'll actually do it before by making a commit on top that fixes them but then cherry-pick that into a separate branch. However, I'm not saying we have to do this and we can instead pick it up later |
db3a838
to
712e7af
Compare
This is to help prepare for checking for doc warnings across the entire workspace being created in rust-lang#11851 `Mutation` was made `pub`, along with its fields, but they aren't actually usable with anything, so I went and made it private to match what its documentation references
docs: Address warnings This is to help prepare for checking for doc warnings across the entire workspace being created in #11851 `Mutation` was made `pub`, along with its fields, but they aren't actually usable with anything, so I went and made it private to match what its documentation references
712e7af
to
54810df
Compare
54810df
to
b36c0b2
Compare
68399a1
to
f725d3d
Compare
Cargo.toml
Outdated
# For linkchecker (downloaded during CI) and semver-check | ||
# TODO: consider move semver-check to crates/ folder |
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.
Does the linkcheck.sh
script need to be updated to support running from a directory separate from the book?
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.
It definitely could. I just postpone it a bit to make this PR easier to get merged. I'll add this suggestion to TODO as well.
9eed0c5
to
80d4306
Compare
Some dependencies in `resolver-tests` do not have any license information. This prevent it from being a member when integrating in rust-lang/rust. Will figure it out after. Co-authored-by: Scott Schafer <[email protected]> Co-authored-by: Eric Huss <[email protected]>
This is primarily for the release process of rust-lang/rust. Note that in rustc-worksace-hack[1] it enable http2 via libnghttp2, cargo probably needs to enable it to compile in rust-lang/rust. [1]: https://github.com/rust-lang/rust/blob/992d154f3a84cc8abcefcf6e6cf3698e4821b506/src/tools/rustc-workspace-hack/Cargo.toml#L77 Co-authored-by: Scott Schafer <[email protected]> Co-authored-by: Eric Huss <[email protected]>
Co-authored-by: Scott Schafer <[email protected]> Co-authored-by: Eric Huss <[email protected]>
Co-authored-by: Scott Schafer <[email protected]> Co-authored-by: Eric Huss <[email protected]>
Co-authored-by: Scott Schafer <[email protected]> Co-authored-by: Eric Huss <[email protected]>
80d4306
to
aaca5a0
Compare
@ehuss, I guess we get a green light from t-bootstrap (rust-lang/rust#109133 (comment)). Do we want to move forward? |
I'm a little concerned about trying to land this just before the beta branch. I suspect this will be a pretty major change, and may have a high risk that it will encounter CI issues or other regressions we'll need to deal with. Would you mind waiting a few days until that happens? And, BTW, would you mind doing a submodule update todoy or tomorrow to include #11960 so we don't need to backport it after the beta branch? I can do it if needed. And also maybe consider #11878? |
Sure for all. I'll take a look at #11878 today. |
@weihanglo It looks like the bump has landed. Whenever you are ready, feel free to r=me this PR and the rust-lang/rust one as well. |
Thanks! @bors r=ehuss |
☀️ Test successful - checks-actions |
…ehuss Make cargo a workspace 8 commits in 7bf43f028ba5eb1f4d70d271c2546c38512c9875..39116ccc9b420a883a98a960f0597f9cf87414b8 2023-04-10 16:01:41 +0000 to 2023-04-15 20:24:15 +0000 - Make cargo a workspace (rust-lang/cargo#11851) - Fix flaky not_found_permutations test. (rust-lang/cargo#11976) - Use restricted Damerau-Levenshtein algorithm (rust-lang/cargo#11963) - Correct the bug report for `cargo clippy --fix` (rust-lang/cargo#11882) - Stabilize `cargo logout` (rust-lang/cargo#11950) - Add more information to HTTP errors to help with debugging. (rust-lang/cargo#11878) - Use registry.default for login/logout (rust-lang/cargo#11949) - Change -C to be unstable (rust-lang/cargo#11960) --- ### What does this PR try to resolve? Making cargo a workspace. Why doing this? * `rustc-workspace-hack` is primarily for sharing dependencies between rls and cargo, as rls previously depends on cargo. After rls retired, it is no longer the case sharing dependencies. * It's q bit painful that cargo needs to deal with some dependency and licensing complexities. For example, rust-lang#108665 failed because of the interaction bewteen `windows-sys` and `raw-dylib`. It currenctly blocks cargo's feature `-Zgitxodie` from moving forward. * See rust-lang/cargo#11851 ### Benchmark result I've done a simple benchmark on both keeping or removing entire `rustc-workspace-hack`. It had no significant difference. Both took ~2m30s to finish `./x.py build -j8 src/tools/cargo src/tools/rls src/tools/clippy src/tools/miri src/tools/rustfmt`. Environment info: ``` host: aarch64-apple-darwin os: Mac OS 13.2.1 [64-bit] ``` A sophisticated benchmark may be needed. ### Additional information This depends on prior works from `@Muscraft` and `@ehuss.` Credits to them!
Since rust-lang/cargo#11851, Cargo became a Cargo workspace of itself. However, since `src/tools/linkchecker` cannot run inside a workspace, Cargo needs a workaround that excludes `src/doc` from workspace member probing. To remove this hack, this PR adds a new optional argument `--path` for `linkchecker.sh`. With this new argument, `linkchecker.sh` can be run from a directory separate from the book. This also benefits other projects using linkchecker, as they can run it under target directory or any other directory, reducing leftover.
linkchecker: running from a directory separate from the book Since rust-lang/cargo#11851, Cargo became a Cargo workspace of itself. However, since `src/tools/linkchecker` cannot run inside a workspace, Cargo needs a workaround that excludes `src/doc` from workspace member probing. To remove this hack, this PR adds a new optional argument `--path` for `linkchecker.sh`. With this new argument, `linkchecker.sh` can be run from a directory separate from the book. This also benefits other projects using linkchecker, as they can run it under target directory or any other directory, reducing leftover.
chore: Use `[workspace.dependencies]` ### What does this PR try to resolve? Keeping shared dependencies in sync. It does this by utilizing workspace inheritance and adding `[workspace.dependencies]`. ### Additional information The ability to use workspace inheritance was added in #11851, as that PR added a workspace for `cargo`. The changes were made by a tool I wrote to assist in finding duplicate dependencies.
What does this PR try to resolve?
The first step of making cargo a workspace.
Benefits:
gix
to v0.41 to fix flaky auth tests. #11831: It got stuck because the new version of tempfile usingwindows-sys
but some issues haven't yet be solved in rust-lang/rust.cargo xtask
or similar developer workflow possible (e.g.,src/doc/build-man.sh
is not able to run on platforms missingsh
#11717)How should we test and review this PR?
Please review it commit by commit. A companion PR is here rust-lang/rust#109133, and should be reviewed together.
Unresolved issues
To limit the scope of this pull request, the following issues are intentionally left unresolved. They will be addressed right after this pull request gets merged.
benches/capture
andbenches/capture
workspace members. (Addressed with 2cf9718)crates/resolver-tests
a workspace member. (Addressed with Update proptest #11886)Fix clippy warnings and re-enable clippy check in CI for all workspace members.[lints]
table toCargo.toml
rfcs#3389 so we can more easily propagate our clippy settingslinkchecker.sh
warnings in CI (Make cargo a workspace #11851 (comment))--workspace
when runningcargo build
orcargo test
, instead of using flag-p
.[workspace]
in Cargo.toml (i.e.,crates/*
).Additional information
This depends on prior works from @Muscraft and @ehuss. Credits to them!