From 2626bb0a61d8e65fa74b6e57b48ead56e4845c88 Mon Sep 17 00:00:00 2001 From: Rain Date: Tue, 3 Oct 2023 19:52:42 -0700 Subject: [PATCH] [workspace-hack] switch to workspace-dotted + patch directive Docs about the `[patch]` directive will come at some future point. For now, try it out. --- .config/hakari.toml | 1 + Cargo.toml | 6 ++++++ cargo-guppy/Cargo.toml | 2 +- fixtures/Cargo.toml | 2 +- guppy-cmdlib/Cargo.toml | 2 +- guppy-summaries/Cargo.toml | 2 +- guppy/Cargo.toml | 2 +- internal-tools/benchmarks/Cargo.toml | 2 +- internal-tools/fixture-manager/Cargo.toml | 2 +- internal-tools/proptest-ext/Cargo.toml | 2 +- target-spec-miette/Cargo.toml | 2 +- target-spec/Cargo.toml | 2 +- tools/cargo-hakari/Cargo.toml | 2 +- tools/cargo-hakari/src/docs/config.rs | 7 ++++++- tools/determinator/Cargo.toml | 2 +- tools/hakari/Cargo.toml | 2 +- 16 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.config/hakari.toml b/.config/hakari.toml index 0faae802d96..9c0dab7c6d7 100644 --- a/.config/hakari.toml +++ b/.config/hakari.toml @@ -12,6 +12,7 @@ resolver = "2" # Format version for cargo-hakari's output. # See https://docs.rs/cargo-hakari/latest/cargo_hakari/config#dep-format-version for more. dep-format-version = "4" +workspace-hack-line-style = "workspace-dotted" # Add triples corresponding to platforms commonly used by developers here. # https://doc.rust-lang.org/rustc/platform-support.html diff --git a/Cargo.toml b/Cargo.toml index 9c1123b8de6..ea59891b2c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,12 @@ members = [ "workspace-hack", ] +[workspace.dependencies] +guppy-workspace-hack = "0.1.0" + +[patch.crates-io.guppy-workspace-hack] +path = "workspace-hack" + # Recommended for color-eyre [profile.dev.package.backtrace] opt-level = 3 diff --git a/cargo-guppy/Cargo.toml b/cargo-guppy/Cargo.toml index 501870cf7d7..f14d9dab0dd 100644 --- a/cargo-guppy/Cargo.toml +++ b/cargo-guppy/Cargo.toml @@ -18,4 +18,4 @@ pathdiff = { version = "0.2.1", features = ["camino"] } serde = { version = "1.0.188", features = ["derive"] } serde_json = "1.0.107" toml_edit = "0.17.1" -guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } +guppy-workspace-hack.workspace = true diff --git a/fixtures/Cargo.toml b/fixtures/Cargo.toml index 29e660a342e..92dc8e1cabd 100644 --- a/fixtures/Cargo.toml +++ b/fixtures/Cargo.toml @@ -11,4 +11,4 @@ guppy = { path = "../guppy" } once_cell = "1.18.0" pathdiff = "0.2.1" pretty_assertions = "1.4.0" -guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } +guppy-workspace-hack.workspace = true diff --git a/guppy-cmdlib/Cargo.toml b/guppy-cmdlib/Cargo.toml index 83c3414102e..05594c54385 100644 --- a/guppy-cmdlib/Cargo.toml +++ b/guppy-cmdlib/Cargo.toml @@ -14,7 +14,7 @@ clap = { version = "3.2.25", features = ["derive"] } color-eyre = { version = "0.6.2", default-features = false } guppy = { path = "../guppy" } proptest = { version = "1.2.0", optional = true } -guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } +guppy-workspace-hack.workspace = true [features] proptest1 = ["proptest", "guppy/proptest1"] diff --git a/guppy-summaries/Cargo.toml b/guppy-summaries/Cargo.toml index 9973be62b67..5210a7e4cdb 100644 --- a/guppy-summaries/Cargo.toml +++ b/guppy-summaries/Cargo.toml @@ -31,7 +31,7 @@ diffus = "0.10.0" toml = { version = "0.5.11", features = ["preserve_order"] } semver = { version = "1.0.19", features = ["serde"] } serde = { version = "1.0.188", features = ["derive"] } -guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } +guppy-workspace-hack.workspace = true [dev-dependencies] indoc = "2.0.4" diff --git a/guppy/Cargo.toml b/guppy/Cargo.toml index b9361db7ce8..1244cf399a0 100644 --- a/guppy/Cargo.toml +++ b/guppy/Cargo.toml @@ -51,7 +51,7 @@ smallvec = "1.11.1" static_assertions = "1.1.0" target-spec = { version = "3.0.1", path = "../target-spec" } toml = { version = "0.5.11", optional = true, features = ["preserve_order"] } -guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } +guppy-workspace-hack.workspace = true [dev-dependencies] fixtures = { path = "../fixtures" } diff --git a/internal-tools/benchmarks/Cargo.toml b/internal-tools/benchmarks/Cargo.toml index 1b819770d15..b2f95626cb8 100644 --- a/internal-tools/benchmarks/Cargo.toml +++ b/internal-tools/benchmarks/Cargo.toml @@ -9,7 +9,7 @@ publish = false # this is a private crate guppy = { path = "../../guppy", features = ["proptest1"] } proptest = "1.2.0" proptest-ext = { path = "../proptest-ext" } -guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } +guppy-workspace-hack.workspace = true [dev-dependencies] criterion = "0.5.1" diff --git a/internal-tools/fixture-manager/Cargo.toml b/internal-tools/fixture-manager/Cargo.toml index b08d3a5aa03..fadfe87c869 100644 --- a/internal-tools/fixture-manager/Cargo.toml +++ b/internal-tools/fixture-manager/Cargo.toml @@ -19,4 +19,4 @@ once_cell = "1.18.0" proptest = "1.2.0" proptest-ext = { path = "../proptest-ext" } structopt = "0.3.26" -guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } +guppy-workspace-hack.workspace = true diff --git a/internal-tools/proptest-ext/Cargo.toml b/internal-tools/proptest-ext/Cargo.toml index 40eba681846..6ee76f691f0 100644 --- a/internal-tools/proptest-ext/Cargo.toml +++ b/internal-tools/proptest-ext/Cargo.toml @@ -10,4 +10,4 @@ publish = false # this is a private crate [dependencies] proptest = "1.2.0" twox-hash = { version = "1.6.3", default-features = false } -guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } +guppy-workspace-hack.workspace = true diff --git a/target-spec-miette/Cargo.toml b/target-spec-miette/Cargo.toml index a32a8b15b5d..70faa174ee9 100644 --- a/target-spec-miette/Cargo.toml +++ b/target-spec-miette/Cargo.toml @@ -14,4 +14,4 @@ rust-version = "1.70" [dependencies] target-spec = { version = "3.0.1", path = "../target-spec" } miette = "5.10.0" -guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } +guppy-workspace-hack.workspace = true diff --git a/target-spec/Cargo.toml b/target-spec/Cargo.toml index 6ec81dba21e..8066497f801 100644 --- a/target-spec/Cargo.toml +++ b/target-spec/Cargo.toml @@ -25,8 +25,8 @@ proptest = { version = "1.2.0", optional = true } serde = { version = "1.0.188", optional = true, features = ["derive"] } serde_json = { version = "1.0.107", optional = true } target-lexicon = { version = "0.12.11", features = ["std"] } -guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } unicode-ident = "1.0.12" +guppy-workspace-hack.workspace = true [dev-dependencies] rustc_version = "0.4.0" diff --git a/tools/cargo-hakari/Cargo.toml b/tools/cargo-hakari/Cargo.toml index 9ae00bbca75..a3fedfe06af 100644 --- a/tools/cargo-hakari/Cargo.toml +++ b/tools/cargo-hakari/Cargo.toml @@ -32,7 +32,7 @@ hakari = { version = "0.17.1", path = "../hakari", features = ["cli-support"] } log = "0.4.20" owo-colors = { version = "3.5.0", features = ["supports-colors"] } supports-color = "1.3.1" -guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } +guppy-workspace-hack.workspace = true [dev-dependencies] tempfile = "3.8.0" diff --git a/tools/cargo-hakari/src/docs/config.rs b/tools/cargo-hakari/src/docs/config.rs index fbe7a95484b..00f2c3cf3e5 100644 --- a/tools/cargo-hakari/src/docs/config.rs +++ b/tools/cargo-hakari/src/docs/config.rs @@ -63,7 +63,12 @@ //! //! ## workspace-hack-line-style //! -//! Style of `workspace-hack` lines to output. +//! Style of `workspace-hack` lines to output. After changing this, you must run: +//! +//! ```sh +//! cargo hakari remove-deps +//! cargo hakari manage-deps +//! ``` //! //! Possible values: //! * *"full"*: `my-workspace-hack = { version = "0.1", path = ... }`. This is the default and a diff --git a/tools/determinator/Cargo.toml b/tools/determinator/Cargo.toml index f23b2cb8612..1aacd9caa11 100644 --- a/tools/determinator/Cargo.toml +++ b/tools/determinator/Cargo.toml @@ -38,7 +38,7 @@ petgraph = { version = "0.6.4", default-features = false, features = [ rayon = "1.8.0" serde = { version = "1.0.188", features = ["derive"] } toml = "0.5.11" -guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } +guppy-workspace-hack.workspace = true [dev-dependencies] fixtures = { path = "../../fixtures" } diff --git a/tools/hakari/Cargo.toml b/tools/hakari/Cargo.toml index 6b58825e408..d579a77ed1d 100644 --- a/tools/hakari/Cargo.toml +++ b/tools/hakari/Cargo.toml @@ -43,7 +43,7 @@ target-spec = { version = "3.0.1", path = "../../target-spec" } toml = { version = "0.5.11", optional = true } toml_edit = "0.17.1" twox-hash = { version = "1.6.3", default-features = false } -guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } +guppy-workspace-hack.workspace = true [dev-dependencies] fixtures = { path = "../../fixtures" }