Skip to content

Conversation

nnethercote
Copy link
Contributor

It lets us avoid a lot of repetition of crate versions, etc.

I've just done a few as a start. Many more can be done in follow-ups.

r? @Kobzol

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Aug 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 22, 2025

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @TaKO8Ki

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

Some changes occurred in exhaustiveness checking

cc @Nadrieril

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred in src/tools/compiletest

cc @jieyouxu

Some changes occurred in compiler/rustc_sanitizers

cc @rcvalle

@rustbot

This comment has been minimized.

@Kobzol
Copy link
Member

Kobzol commented Aug 26, 2025

I think that this is a good idea that could help reduce our overall dependency count. If you remove the subtree changes, I'll r+ it.

@rustbot
Copy link
Collaborator

rustbot commented Aug 27, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@nnethercote
Copy link
Contributor Author

I think that this is a good idea that could help reduce our overall dependency count.

How would it reduce our dependency count? AFAIK the benefit is avoiding repetition.

If you remove the subtree changes, I'll r+ it.

I have done this. In case it helps, here are the submodules (edited output from git submodule):

library/backtrace (0.3.75-44-gb65ab93)
src/doc/book (one-book-to-rule-them-all-2909-g3e9dc46a)
src/doc/edition-guide (remotes/origin/HEAD)
src/doc/embedded-book (remotes/origin/HEAD)
src/doc/nomicon (remotes/origin/HEAD)
src/doc/reference (remotes/origin/HEAD)
src/doc/rust-by-example (heads/master-679-gadc1f3b)
src/gcc
src/llvm-project (remotes/origin/rustc/21.1-2025-08-01)
src/tools/cargo (0.86.0-1136-g623d53683)
src/tools/enzyme
src/tools/rustc-perf (heads/master-4965-gdde879cf1)

and here are the subtrees (edited output from git log | grep git-subtree-dir):

compiler/rustc_codegen_cranelift
compiler/rustc_codegen_gcc
compiler/rustc_smir
library/portable-simd
src/tools/clippy
src/tools/miri
src/tools/rust-analyzer
src/tools/rustfmt

@Kobzol
Copy link
Member

Kobzol commented Aug 27, 2025

How would it reduce our dependency count? AFAIK the benefit is avoiding repetition

Two packages might inadvertedly depend on a different major version of a dependency. If they share the dependency version, that won't happen.

@@ -62,6 +62,7 @@ exclude = [
[workspace.dependencies]
# tidy-alphabetical-start
bitflags = "2.9.3"
itertools = "0.12.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it not be kept at "0.12"... does it fail when built with "0.12.0"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer specifying only the major version in Cargo.toml, but since we have a lockfile, it shouldn't matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lockfile already had 0.12.1 in it. In every case I just specified the full version number that was present in the lockfile.

@@ -62,6 +62,7 @@ exclude = [
[workspace.dependencies]
# tidy-alphabetical-start
bitflags = "2.9.3"
itertools = "0.12.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer specifying only the major version in Cargo.toml, but since we have a lockfile, it shouldn't matter.

@Kobzol
Copy link
Member

Kobzol commented Aug 27, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 27, 2025

📌 Commit 200f56d has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2025
bors added a commit that referenced this pull request Aug 27, 2025
Rollup of 6 pull requests

Successful merges:

 - #144274 (add Option::reduce)
 - #145562 (Simplify macro generating ToString implementations for `&…&str`)
 - #145625 (improve float to_degrees/to_radians rounding comments and impl)
 - #145740 (Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml`)
 - #145885 (Inherit TCC in debuginfo tests on macOS)
 - #145905 (Stop calling unwrap when format foreign has trailing dollar)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 693d5ea into rust-lang:master Aug 27, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 27, 2025
rust-timer added a commit that referenced this pull request Aug 27, 2025
Rollup merge of #145740 - nnethercote:workspace-members, r=Kobzol

Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml`

It lets us avoid a lot of repetition of crate versions, etc.

I've just done a few as a start. Many more can be done in follow-ups.

r? `@Kobzol`
@nnethercote nnethercote deleted the workspace-members branch August 27, 2025 21:30
bors added a commit that referenced this pull request Aug 28, 2025
Add more to the `[workspace.dependencies]` section in the top-level `Cargo.toml`

Following on from #145740.

r? `@Kobzol`
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 29, 2025
…=Kobzol

Add more to the `[workspace.dependencies]` section in the top-level `Cargo.toml`

Following on from rust-lang#145740.

r? `@Kobzol`
rust-timer added a commit that referenced this pull request Aug 29, 2025
Rollup merge of #145947 - nnethercote:workspace-members-2, r=Kobzol

Add more to the `[workspace.dependencies]` section in the top-level `Cargo.toml`

Following on from #145740.

r? `@Kobzol`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants