From be84fe8322c87406983cfa579ecce272ef55c0d2 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Fri, 25 Oct 2024 14:59:39 -0600 Subject: [PATCH] infra: change how packages are opted out of workspaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `trpl`, `mdbook-trpl-note`, and `mdbook-trpl-listing` crates should *never* be part of a host workspace: neither in `rust-lang/book` nor in `rust-lang/rust`. They are always built as independent packages, so they do not end up depending implicitly on the host’s workspace dependencies. Accordingly, opt out by setting an empty `[workspace]` key in each of the packages' `Cargo.toml` files so that they do not have to be configured in both places they might be used. --- Cargo.toml | 8 -------- packages/mdbook-trpl-listing/Cargo.toml | 5 +++++ packages/mdbook-trpl-note/Cargo.toml | 5 +++++ packages/trpl/Cargo.toml | 5 +++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 20fc14643d..73c7ba471a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,14 +6,6 @@ exclude = [ "linkchecker", # linkchecker is part of the CI workflow "listings", # these are intentionally distinct from the workspace "tmp", # listings are built here when updating output via tools/update-rustc.sh - "packages/trpl", # manages its own dependencies as a standalone crate - - # These are used as path dependencies in `rust-lang/rust` (since we are not - # publishing them to crates.io), so they cannot be part of this workspace, - # because path dependencies do not get built as a crate within the hosting - # workspace. - "packages/mdbook-trpl-listing", - "packages/mdbook-trpl-note", ] [workspace.dependencies] diff --git a/packages/mdbook-trpl-listing/Cargo.toml b/packages/mdbook-trpl-listing/Cargo.toml index 20bfe347db..4b90001e23 100644 --- a/packages/mdbook-trpl-listing/Cargo.toml +++ b/packages/mdbook-trpl-listing/Cargo.toml @@ -17,3 +17,8 @@ toml = "0.8.12" [dev-dependencies] assert_cmd = "2" + +# This package is used as a path dependency in `rust-lang/rust`, not published +# to crates.io, so it cannot be part of the `rust-lang/book` workspace, because +# path dependencies do not get built as a crate within the hosting workspace. +[workspace] diff --git a/packages/mdbook-trpl-note/Cargo.toml b/packages/mdbook-trpl-note/Cargo.toml index e8dc53cc4c..4fde2fd878 100644 --- a/packages/mdbook-trpl-note/Cargo.toml +++ b/packages/mdbook-trpl-note/Cargo.toml @@ -14,3 +14,8 @@ serde_json = "1" [dev-dependencies] assert_cmd = "2" + +# This package is used as a path dependency in `rust-lang/rust`, not published +# to crates.io, so it cannot be part of the `rust-lang/book` workspace, because +# path dependencies do not get built as a crate within the hosting workspace. +[workspace] diff --git a/packages/trpl/Cargo.toml b/packages/trpl/Cargo.toml index 61c46319cc..26503e6b88 100644 --- a/packages/trpl/Cargo.toml +++ b/packages/trpl/Cargo.toml @@ -21,3 +21,8 @@ tokio = { version = "1", default-features = false, features = [ "time", ] } tokio-stream = "0.1" + +# This package is built as a standalone package to publish to crates.io, and is +# also built as a path dependency for distribution with Rust, so it must not be +# built as part of the `rust-lang/book` or `rust-lang/rust` workspaces. +[workspace]