From 84a505e9f07963fbd6b22e0dc25ad69629924cb3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:01:42 +0100 Subject: [PATCH 01/13] Bump the known_good_semver group with 3 updates (#73) Bumps the known_good_semver group with 3 updates: [serde](https://github.com/serde-rs/serde), [serde_json](https://github.com/serde-rs/json) and [serde_yaml](https://github.com/dtolnay/serde-yaml). Updates `serde` from 1.0.195 to 1.0.196 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.195...v1.0.196) Updates `serde_json` from 1.0.111 to 1.0.113 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.111...v1.0.113) Updates `serde_yaml` from 0.9.30 to 0.9.31 - [Release notes](https://github.com/dtolnay/serde-yaml/releases) - [Commits](https://github.com/dtolnay/serde-yaml/compare/0.9.30...0.9.31) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: serde_yaml dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 95320c0..8e38094 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -553,9 +553,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", "hashbrown", @@ -998,18 +998,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -1018,9 +1018,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -1029,9 +1029,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.30" +version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ "indexmap", "itoa", diff --git a/Cargo.toml b/Cargo.toml index b3c0f42..7aa7ba3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,9 +29,9 @@ histo = "1.0.0" itertools = "0.12.0" log = { version = "0.4.20", optional = true } semver = "1" -serde = "1.0.193" -serde_json = "1.0.111" -serde_yaml = "0.9.30" +serde = "1.0.196" +serde_json = "1.0.113" +serde_yaml = "0.9.31" tempfile = { version = "3.9.0", optional = true } toml_edit = "0.21.0" tracing = { version = "0.1.40", optional = true } @@ -43,7 +43,7 @@ lazy_static = "1.4.0" pretty_assertions = "1.4.0" rand = "0.8.5" rstest = "0.18.2" -serde = "1.0.193" +serde = "1.0.196" zepter = { path = ".", features = ["testing"] } [features] From 5fdf46049c1defabd53a46b74b3a959e8cbbe09a Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Mon, 5 Feb 2024 17:46:16 +0100 Subject: [PATCH 02/13] transpose: error instead of panic (#74) * Error instead of panic Signed-off-by: Oliver Tale-Yazdi * Bump to 1.0.2 Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- CHANGELOG.md | 5 +++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/cmd/transpose.rs | 12 ++++++++---- tests/integration/orml/release.yaml | 10 ++++------ tests/integration/sdk/transpose.yaml | 18 ++++++++---------- tests/ui/config/v1/basic.yaml | 10 +++++----- tests/ui/config/v1/finds_all.yaml | 16 ++++++++-------- tests/ui/config/v1/version_bin.yaml | 4 ++-- tests/ui/root-args/version.yaml | 4 ++-- 10 files changed, 44 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b6d78e..3396d9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.0.2] - 2024-02-02 + +### Fixed +- Let `transpose` exit with code 1 on error instead of panic. + ## [0.15.0] - 2023-11-14 ### Added diff --git a/Cargo.lock b/Cargo.lock index 8e38094..d4c1f0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1504,7 +1504,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zepter" -version = "1.0.1" +version = "1.0.2" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index 7aa7ba3..0dc41a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zepter" -version = "1.0.1" +version = "1.0.2" edition = "2021" authors = [ "Oliver Tale-Yazdi" ] description = "Analyze, Fix and Format features in your Rust workspace." diff --git a/src/cmd/transpose.rs b/src/cmd/transpose.rs index 16f471c..ada24ed 100644 --- a/src/cmd/transpose.rs +++ b/src/cmd/transpose.rs @@ -160,16 +160,18 @@ impl LiftToWorkspaceCmd { }, }; let hint = format!("cargo upgrade -p {}@{version_hint}", &self.dependency); - panic!( + eprintln!( "\nFound {} different versions of '{}' in the workspace:\n\n{err}\nHint: {}\n", versions.len(), &self.dependency, g.bold(&hint), ); + std::process::exit(1); } let Some(version) = by_version.keys().next() else { - panic!("Could not find any dependency named '{}'", g.red(&self.dependency)); + eprintln!("Could not find any dependency named '{}'", g.red(&self.dependency)); + std::process::exit(1); }; let _ = version; let _found: usize = by_version.values().map(Vec::len).sum(); @@ -248,7 +250,8 @@ impl StripDevDepsCmd { for name in self.packages.iter().flatten() { if !meta.packages.iter().any(|p| p.name == *name) { - panic!("Could not find package named '{}'", g.red(name)); + eprintln!("Could not find package named '{}'", g.red(name)); + std::process::exit(1); } } @@ -278,7 +281,8 @@ impl StripDevDepsCmd { for dep in only_dev.iter() { // Account for renamed crates: let Some(dep) = resolve_dep(pkg, dep, &meta) else { - panic!("Could not resolve dependency '{}'", g.red(&dep.name)); + eprintln!("Could not resolve dependency '{}'", g.red(&dep.name)); + std::process::exit(1); }; fixer.remove_feature(&format!("{}/", dep.name())); diff --git a/tests/integration/orml/release.yaml b/tests/integration/orml/release.yaml index 6bf559f..f7fd2d5 100644 --- a/tests/integration/orml/release.yaml +++ b/tests/integration/orml/release.yaml @@ -5,15 +5,13 @@ cases: - cmd: transpose features strip-dev-only -p asdf stderr: | [WARN] Unstable feature - do not rely on this! - thread 'main' panicked at 'Could not find package named 'asdf'', src/cmd/transpose.rs:251:17 - note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace - code: 101 + Could not find package named 'asdf' + code: 1 - cmd: transpose features strip-dev-only -p orml-asset-registry,asdf stderr: | [WARN] Unstable feature - do not rely on this! - thread 'main' panicked at 'Could not find package named 'asdf'', src/cmd/transpose.rs:251:17 - note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace - code: 101 + Could not find package named 'asdf' + code: 1 - cmd: transpose features strip-dev-only stderr: | [WARN] Unstable feature - do not rely on this! diff --git a/tests/integration/sdk/transpose.yaml b/tests/integration/sdk/transpose.yaml index 8e2eaf1..0c3e89f 100644 --- a/tests/integration/sdk/transpose.yaml +++ b/tests/integration/sdk/transpose.yaml @@ -3,9 +3,9 @@ repo: ref: c86b633695299ed27053940d5ea5c5a2392964b3 cases: - cmd: transpose dependency lift-to-workspace parity-scale-codec - stderr: | + stderr: |+ [WARN] Unstable feature - do not rely on this! - thread 'main' panicked at ' + Found 6 different versions of 'parity-scale-codec' in the workspace: ^3.6.1: 244 times (frame-support, sp-api, sp-core, …) @@ -16,13 +16,12 @@ cases: ^3.4.0: 4 times (asset-hub-rococo-integration-tests, integration-tests-common, asset-hub-westend-integration-tests, …) Hint: cargo upgrade -p parity-scale-codec@3.6.4 - ', src/cmd/transpose.rs:163:13 - note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace - code: 101 + + code: 1 - cmd: transpose dependency lift-to-workspace log - stderr: | + stderr: |+ [WARN] Unstable feature - do not rely on this! - thread 'main' panicked at ' + Found 8 different versions of 'log' in the workspace: ^0.4.17: 135 times (frame-support, sp-api, sp-core, …) @@ -35,9 +34,8 @@ cases: ^0.4.8 : 1 time (sc-consensus-grandpa-rpc) Hint: cargo upgrade -p log@0.4.20 - ', src/cmd/transpose.rs:163:13 - note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace - code: 101 + + code: 1 - cmd: zepter transpose dependency lift-to-workspace macro_magic stderr: | [WARN] Unstable feature - do not rely on this! diff --git a/tests/ui/config/v1/basic.yaml b/tests/ui/config/v1/basic.yaml index b217916..98f2445 100644 --- a/tests/ui/config/v1/basic.yaml +++ b/tests/ui/config/v1/basic.yaml @@ -3,25 +3,25 @@ crates: cases: - cmd: run default stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: '' stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run my_version stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'my_version' [INFO] 1/1 --version @@ -38,7 +38,7 @@ cases: [INFO] 1/1 debug --no-benchmark - cmd: run both stdout: |+ - zepter 1.0.1 + zepter 1.0.2 Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 diff --git a/tests/ui/config/v1/finds_all.yaml b/tests/ui/config/v1/finds_all.yaml index 62c06c4..18aa925 100644 --- a/tests/ui/config/v1/finds_all.yaml +++ b/tests/ui/config/v1/finds_all.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: '' stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -19,7 +19,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -35,7 +35,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -51,7 +51,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -67,7 +67,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -83,7 +83,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -99,7 +99,7 @@ cases: - [ '--version' ] - cmd: run default --config .cargo/polkadot.yaml stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -115,7 +115,7 @@ cases: - [ '--version' ] - cmd: run default -c .cargo/polkadot.yaml stdout: | - zepter 1.0.1 + zepter 1.0.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version diff --git a/tests/ui/config/v1/version_bin.yaml b/tests/ui/config/v1/version_bin.yaml index 777d598..02b5c36 100644 --- a/tests/ui/config/v1/version_bin.yaml +++ b/tests/ui/config/v1/version_bin.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: run default stderr: | - thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.0.1. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 + thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.0.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 - cmd: run default --check-cfg-compatibility=off @@ -11,7 +11,7 @@ cases: Error: Command '' failed with exit code 101 stderr: | [INFO] Running workflow 'default' - thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.0.1. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 + thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.0.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 1 configs: diff --git a/tests/ui/root-args/version.yaml b/tests/ui/root-args/version.yaml index 45c2968..0047b51 100644 --- a/tests/ui/root-args/version.yaml +++ b/tests/ui/root-args/version.yaml @@ -2,7 +2,7 @@ crates: [] cases: - cmd: --version stdout: | - zepter 1.0.1 + zepter 1.0.2 - cmd: -V stdout: | - zepter 1.0.1 + zepter 1.0.2 From 91175374cf2e0d61707bedc0a17b36223d5fcff2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:53:37 +0000 Subject: [PATCH 03/13] Bump the known_good_semver group with 2 updates (#75) Bumps the known_good_semver group with 2 updates: [itertools](https://github.com/rust-itertools/itertools) and [toml_edit](https://github.com/toml-rs/toml). Updates `itertools` from 0.12.0 to 0.12.1 - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.12.0...v0.12.1) Updates `toml_edit` from 0.21.0 to 0.21.1 - [Commits](https://github.com/toml-rs/toml/compare/v0.21.0...v0.21.1) --- updated-dependencies: - dependency-name: itertools dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Oliver Tale-Yazdi --- Cargo.lock | 10 +++++----- Cargo.toml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4c1f0c..af3fa7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,9 +592,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -1177,9 +1177,9 @@ checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", @@ -1515,7 +1515,7 @@ dependencies = [ "env_logger", "glob", "histo", - "itertools 0.12.0", + "itertools 0.12.1", "lazy_static", "log", "pretty_assertions", diff --git a/Cargo.toml b/Cargo.toml index 0dc41a3..d81852d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,14 +26,14 @@ colour = { version = "0.7.0", optional = true } criterion = { version = "0.5", optional = true } env_logger = { version = "0.10.2", features = [ "auto-color", "humantime" ], optional = true } histo = "1.0.0" -itertools = "0.12.0" +itertools = "0.12.1" log = { version = "0.4.20", optional = true } semver = "1" serde = "1.0.196" serde_json = "1.0.113" serde_yaml = "0.9.31" tempfile = { version = "3.9.0", optional = true } -toml_edit = "0.21.0" +toml_edit = "0.21.1" tracing = { version = "0.1.40", optional = true } [dev-dependencies] From 261f4041b1a195096e01f4856d5cff2988169753 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Tue, 6 Feb 2024 16:19:54 +0100 Subject: [PATCH 04/13] Update `transpose` command (#76) * Update transpose Signed-off-by: Oliver Tale-Yazdi * Add chagnelog Signed-off-by: Oliver Tale-Yazdi * Update UI tests Signed-off-by: Oliver Tale-Yazdi * fmt Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- CHANGELOG.md | 5 + Cargo.lock | 12 +- Cargo.toml | 6 +- src/autofix.rs | 62 +- src/cmd/lint.rs | 4 +- src/cmd/mod.rs | 33 +- src/cmd/transpose.rs | 208 ++-- src/main.rs | 9 +- src/mock/mod.rs | 4 +- src/tests.rs | 234 ++++ tests/integration/sdk/transpose.yaml | 1517 +++++++++++++++++++++++++- tests/ui/config/v1/basic.yaml | 10 +- tests/ui/config/v1/finds_all.yaml | 16 +- tests/ui/config/v1/version_bin.yaml | 4 +- tests/ui/root-args/version.yaml | 4 +- 15 files changed, 1973 insertions(+), 155 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3396d9c..75d3260 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.1.0] - 2024-02-06 + +### Changed +- Make `transpose` smarter and add tests for `dependency lift-to-workspace`. + ## [1.0.2] - 2024-02-02 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index af3fa7b..bee260f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,9 +592,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" dependencies = [ "either", ] @@ -1177,9 +1177,9 @@ checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap", "toml_datetime", @@ -1504,7 +1504,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zepter" -version = "1.0.2" +version = "1.1.0" dependencies = [ "anyhow", "assert_cmd", @@ -1515,7 +1515,7 @@ dependencies = [ "env_logger", "glob", "histo", - "itertools 0.12.1", + "itertools 0.12.0", "lazy_static", "log", "pretty_assertions", diff --git a/Cargo.toml b/Cargo.toml index d81852d..3a0678f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zepter" -version = "1.0.2" +version = "1.1.0" edition = "2021" authors = [ "Oliver Tale-Yazdi" ] description = "Analyze, Fix and Format features in your Rust workspace." @@ -26,14 +26,14 @@ colour = { version = "0.7.0", optional = true } criterion = { version = "0.5", optional = true } env_logger = { version = "0.10.2", features = [ "auto-color", "humantime" ], optional = true } histo = "1.0.0" -itertools = "0.12.1" +itertools = "0.12.0" log = { version = "0.4.20", optional = true } semver = "1" serde = "1.0.196" serde_json = "1.0.113" serde_yaml = "0.9.31" tempfile = { version = "3.9.0", optional = true } -toml_edit = "0.21.1" +toml_edit = "0.21.0" tracing = { version = "0.1.40", optional = true } [dev-dependencies] diff --git a/src/autofix.rs b/src/autofix.rs index b8c3eb6..9621cd4 100644 --- a/src/autofix.rs +++ b/src/autofix.rs @@ -475,11 +475,12 @@ impl AutoFixer { if let Some(as_str) = dep.as_str() { cargo_metadata::semver::VersionReq::parse(as_str).expect("Is semver"); let mut table = InlineTable::new(); - table.remove("default-features"); // We also remove it to get the order right. table.insert("workspace", Value::Boolean(Formatted::new(true))); if let Some(default_feats) = default_feats { table.insert("default-features", Value::Boolean(Formatted::new(default_feats))); + } else { + table.remove("default-features"); } table.set_dotted(false); @@ -490,11 +491,12 @@ impl AutoFixer { return Err("'git' or 'path' dependency are currently not supported".into()) } as_table.remove("version"); - as_table.remove("default-features"); // We also remove it to get the order right. as_table.insert("workspace", Value::Boolean(Formatted::new(true))); if let Some(default_feats) = default_feats { as_table.insert("default-features", Value::Boolean(Formatted::new(default_feats))); + } else { + as_table.remove("default-features"); } } else { unreachable!("Unknown kind of dependency: {:?}", dep); @@ -507,10 +509,21 @@ impl AutoFixer { dep: &Dependency, default_feats: bool, ) -> Result<(), String> { + self.add_workspace_dep_inner(&dep.name, &dep.req.to_string(), default_feats) + } + + pub(crate) fn add_workspace_dep_inner( + &mut self, + dep_name: &str, + dep_version: &str, + default_feats: bool, + ) -> Result<(), String> { + // The carrot is implicit in cargo. + let version_str = dep_version.to_string().trim_start_matches('^').to_string(); let doc: &mut Document = self.doc.as_mut().unwrap(); if !doc.contains_table("workspace") { - return Err("No workspace table".into()) + return Err("No workspace entry found".into()) } let workspace = doc["workspace"].as_table_mut().unwrap(); @@ -519,16 +532,45 @@ impl AutoFixer { } let deps = workspace["dependencies"].as_table_mut().unwrap(); + let mut t = InlineTable::new(); - if deps.contains_key(&dep.name) { - return Err("Dependency already exists in the workspace".into()) + if let Some(found) = deps.get(dep_name) { + if let Some(found) = found.as_inline_table() { + if let Some(version) = found.get("version") { + if remove_carrot(version.as_str().unwrap()) != version_str { + return Err(format!( + "Dependency '{}' already exists in the workspace with a different 'version' field: '{}' vs '{}'", + dep_name, + version.as_str().unwrap(), + dep_version + )) + } + } + + if let Some(default) = found.get("default-features") { + if default.as_bool().unwrap() != default_feats { + return Err(format!( + "Dependency '{}' already exists in the workspace with a different 'default-features' fields: '{}' vs '{}'", + dep_name, + default.as_bool().unwrap(), + default_feats + )) + } + } + + // We checked that: + // - There is either no version or its compatible + // - There is either no default-features or its compatible + t = found.clone(); + } else { + return Err(format!("Dependency '{}' already exists in the workspace but could not validate its compatibility", dep_name)) + } } - let mut t = InlineTable::new(); - t.insert("version", Value::String(Formatted::new(dep.req.to_string()))); + t.insert("version", Value::String(Formatted::new(version_str))); t.insert("default-features", Value::Boolean(Formatted::new(default_feats))); - deps.insert(&dep.name, Item::Value(Value::InlineTable(t))); + deps.insert(dep_name, Item::Value(Value::InlineTable(t))); Ok(()) } @@ -576,3 +618,7 @@ impl ToString for AutoFixer { self.doc.as_ref().unwrap().to_string() } } + +fn remove_carrot(version: &str) -> &str { + version.strip_prefix('^').unwrap_or(version) +} diff --git a/src/cmd/lint.rs b/src/cmd/lint.rs index 5e690f3..a61269b 100644 --- a/src/cmd/lint.rs +++ b/src/cmd/lint.rs @@ -844,9 +844,7 @@ pub fn build_feature_dag(meta: &Metadata, pkgs: &[Package]) -> Dag { diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 1f8034e..8d69836 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -84,17 +84,36 @@ pub enum FixHint { } impl Command { - pub fn run(&self) { + pub fn run(&self) -> Result<(), String> { self.global.setup_logging(); match self.subcommand.as_ref() { - Some(SubCommand::Trace(cmd)) => cmd.run(&self.global), - Some(SubCommand::Lint(cmd)) => cmd.run(&self.global), - Some(SubCommand::Format(cmd)) => cmd.run(&self.global), - Some(SubCommand::Run(cmd)) => cmd.run(&self.global), Some(SubCommand::Transpose(cmd)) => cmd.run(&self.global), - Some(SubCommand::Debug(cmd)) => cmd.run(&self.global), - None => run::RunCmd::default().run(&self.global), + + Some(SubCommand::Trace(cmd)) => { + cmd.run(&self.global); + Ok(()) + }, + Some(SubCommand::Lint(cmd)) => { + cmd.run(&self.global); + Ok(()) + }, + Some(SubCommand::Format(cmd)) => { + cmd.run(&self.global); + Ok(()) + }, + Some(SubCommand::Run(cmd)) => { + cmd.run(&self.global); + Ok(()) + }, + Some(SubCommand::Debug(cmd)) => { + cmd.run(&self.global); + Ok(()) + }, + None => { + run::RunCmd::default().run(&self.global); + Ok(()) + }, } } } diff --git a/src/cmd/transpose.rs b/src/cmd/transpose.rs index ada24ed..c168410 100644 --- a/src/cmd/transpose.rs +++ b/src/cmd/transpose.rs @@ -20,10 +20,13 @@ pub struct TransposeCmd { } impl TransposeCmd { - pub fn run(&self, global: &GlobalArgs) { + pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { match &self.subcommand { TransposeSubCmd::Dependency(cmd) => cmd.run(global), - TransposeSubCmd::Features(cmd) => cmd.run(global), + TransposeSubCmd::Features(cmd) => { + cmd.run(global); + Ok(()) + }, } } } @@ -44,7 +47,7 @@ pub struct DependencyCmd { } impl DependencyCmd { - pub fn run(&self, global: &GlobalArgs) { + pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { match &self.subcommand { DependencySubCmd::LiftToWorkspace(cmd) => cmd.run(global), } @@ -87,8 +90,30 @@ pub struct LiftToWorkspaceCmd { #[clap(index(1))] dependency: String, - #[clap(long, value_enum, default_value_t = DefaultFeatureMode::False)] - default_feature: DefaultFeatureMode, + /// Instead of dry-running, actually modify the files. + #[clap(long)] + fix: bool, + + /// How to determine which version to use for the whole workspace. + #[clap(long, value_enum, default_value_t = VersionResolveMode::Unambiguous, requires_if("exact", "exact_version"))] + version_resolver: VersionResolveMode, + + /// The exact version to use for the whole workspace. + #[clap(long)] + exact_version: Option, +} + +/// How to determine which version to use for the whole workspace. +#[derive(Debug, Clone, PartialEq, clap::ValueEnum)] +pub enum VersionResolveMode { + /// The version must be unambiguous - eg. there is only one version in the workspace. + Unambiguous, + /// A specific version. + Exact, + /// The latest version that was seen in the workspace. + /// + /// This is *not* the latest version from crates-io. + Latest, } #[derive(Debug, clap::Parser)] @@ -102,18 +127,17 @@ pub struct StripDevDepsCmd { packages: Option>, } -#[derive(Debug, Clone, PartialEq, clap::ValueEnum)] -pub enum DefaultFeatureMode { - False, -} - impl LiftToWorkspaceCmd { - pub fn run(&self, g: &GlobalArgs) { + pub fn run(&self, g: &GlobalArgs) -> Result<(), String> { g.warn_unstable(); + if self.exact_version.is_some() && self.version_resolver != VersionResolveMode::Exact { + return Err("Cannot use --exact-version without --version-resolver=exact".to_string()) + } + let mut args = self.cargo_args.clone(); args.workspace = true; - let meta = args.load_metadata().expect("Loads metadata"); + let meta = args.load_metadata()?; log::debug!("Scanning workspace for '{}'", self.dependency); // version -> crate let mut by_version = HashMap::>::new(); @@ -129,82 +153,122 @@ impl LiftToWorkspaceCmd { } let versions = by_version.keys().collect::>(); - if versions.len() > 1 { - let str_width = versions.iter().map(|v| v.to_string().len()).max().unwrap(); - let mut err = String::new(); - // iter by descending frequence - for (version, pkgs) in - by_version.iter().sorted_by_key(|(v, pkgs)| (pkgs.len(), v.to_string())).rev() - { - let ddd = if pkgs.len() > 3 { ", …" } else { "" }; - let s = plural_or(pkgs.len(), " "); - // TODO plural s - err.push_str(&format!( - " {: 3} time{s} ({}{ddd})\n", - version.to_string(), - pkgs.len(), - pkgs.iter() - .map(|(c, _)| c.name.as_str()) - .take(3) - .collect::>() - .join(", "), - width = str_width - )); - } - - let version_hint = match try_find_latest(by_version.keys()) { - Ok(latest) => latest.to_string(), - Err(_e) => { - log::warn!("Could not find determine latest common version: {}", _e); - "version".to_string() - }, - }; - let hint = format!("cargo upgrade -p {}@{version_hint}", &self.dependency); - eprintln!( - "\nFound {} different versions of '{}' in the workspace:\n\n{err}\nHint: {}\n", - versions.len(), - &self.dependency, - g.bold(&hint), - ); - std::process::exit(1); - } - - let Some(version) = by_version.keys().next() else { - eprintln!("Could not find any dependency named '{}'", g.red(&self.dependency)); - std::process::exit(1); + let best_version = match self.version_resolver { + VersionResolveMode::Exact => self.exact_version.clone().expect("Checked by clippy"), + VersionResolveMode::Latest => try_find_latest(by_version.keys())?.to_string(), + VersionResolveMode::Unambiguous => { + if versions.len() > 1 { + let str_width = versions.iter().map(|v| v.to_string().len()).max().unwrap(); + let mut err = String::new(); + // iter by descending frequency + for (version, pkgs) in by_version + .iter() + .sorted_by_key(|(v, pkgs)| (pkgs.len(), v.to_string())) + .rev() + { + let ddd = if pkgs.len() > 3 { ", …" } else { "" }; + let s = plural_or(pkgs.len(), " "); + err.push_str(&format!( + " {: 3} time{s} ({}{ddd})\n", + version.to_string(), + pkgs.len(), + pkgs.iter() + .map(|(c, _)| c.name.as_str()) + .take(3) + .collect::>() + .join(", "), + width = str_width + )); + } + + let version_hint = match try_find_latest(by_version.keys()) { + Ok(latest) => latest.to_string(), + Err(_e) => { + log::warn!("Could not find determine latest common version: {}", _e); + "version".to_string() + }, + }; + + let hint = format!("cargo upgrade -p {}@{version_hint}", &self.dependency); + return Err(format!( + "\nFound {} different versions of '{}' in the workspace:\n\n{err}\nHint: {}\n", + versions.len(), + &self.dependency, + g.bold(&hint), + )) + } else { + versions.first().unwrap().to_string() + } + }, }; - let _ = version; - let _found: usize = by_version.values().map(Vec::len).sum(); log::info!( - "Selected '{} {}' for lift up ({} occurrence{})", //: N={}, D={}, B={})", + "Selected '{} {}'", //: N={}, D={}, B={})", &self.dependency, - &version, - _found, - crate::grammar::plural(_found), + &best_version, ); let mut fixers = Map::new(); for (pkg, dep) in by_version.values().flatten() { let krate_path = canonicalize(pkg.manifest_path.clone().into_std_path_buf()).unwrap(); + let allowed_dir = canonicalize(meta.workspace_root.as_std_path()).unwrap(); + + if !krate_path.starts_with(&allowed_dir) { + log::info!( + "Skipping path outside of the workspace: {:?} (not in {:?})", + krate_path.display(), + allowed_dir.display() + ); + continue + } + fixers .entry(pkg.name.clone()) - .or_insert_with(|| AutoFixer::from_manifest(&krate_path).unwrap()); - let fixer = fixers.get_mut(&pkg.name).unwrap(); + .or_insert_with(|| (pkg, AutoFixer::from_manifest(&krate_path).unwrap())); + let (_, fixer) = fixers.get_mut(&pkg.name).unwrap(); - fixer.lift_dependency(&dep.name, None).unwrap(); // TODO - } - - for fixer in fixers.values_mut() { - fixer.save().unwrap(); + let default_feats = dep.uses_default_features.then_some(true); + fixer.lift_dependency(&dep.name, default_feats)?; } // Now create fixer for the root package let root_manifest_path = meta.workspace_root.join("Cargo.toml"); - let mut fixer = AutoFixer::from_manifest(&root_manifest_path.into_std_path_buf()).unwrap(); - let dep = by_version.values().next().unwrap().first().unwrap().1.clone(); - fixer.add_workspace_dep(&dep, false).unwrap(); - fixer.save().unwrap(); + let mut fixer = AutoFixer::from_manifest(&root_manifest_path.into_std_path_buf())?; + let mut dep = by_version.values().next().unwrap().first().unwrap().1.clone(); + dep.req = best_version.parse().unwrap(); + // We always add `default-features = false` into the workspace: + fixer.add_workspace_dep(&dep, false)?; + + let mut modified = 0; + for (pkg, fixer) in fixers.values_mut() { + if !fixer.modified() { + continue + } + + modified += 1; + if self.fix { + fixer.save()?; + } else { + log::debug!("Would modify {:?}", pkg.name); + } + } + if fixer.modified() { + modified += 1; + log::debug!("Would modify the workspace"); + + if self.fix { + fixer.save()?; + } + } + + if modified > 0 && !self.fix { + let s = plural(modified); + Err(format!( + "Held back modifications to {modified} file{s}; re-run with --fix to apply." + )) + } else { + Ok(()) + } } } diff --git a/src/main.rs b/src/main.rs index 70c9638..4741334 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ use clap::Parser; use zepter::cmd::Command; -fn main() { +fn main() -> Result<(), String> { setup_logging(); // Need to remove this in case `cargo-zepter` is used: @@ -15,7 +15,12 @@ fn main() { args.remove(1); } - Command::parse_from(args).run(); + if let Err(err) = Command::parse_from(args).run() { + eprintln!("{}", err); + Err("see log".into()) + } else { + Ok(()) + } } #[cfg(not(feature = "logging"))] diff --git a/src/mock/mod.rs b/src/mock/mod.rs index 97d84dd..d0a38bc 100644 --- a/src/mock/mod.rs +++ b/src/mock/mod.rs @@ -264,12 +264,12 @@ impl Context { &format!("new --vcs=none --offline --lib --name {} {}", module.name, module.path()), None, )?; - let toml_path = self.root.path().join(&module.path()).join("Cargo.toml"); + let toml_path = self.root.path().join(module.path()).join("Cargo.toml"); assert!(toml_path.exists(), "Crate must exist"); // Add the deps let mut out_deps = HashMap::::new(); for dep in module.deps.iter().flatten() { - out_deps.entry(dep.kind()).or_insert_with(String::new).push_str(&dep.def()); + out_deps.entry(dep.kind()).or_default().push_str(&dep.def()); } let mut txt = String::from("[features]\n"); diff --git a/src/tests.rs b/src/tests.rs index 47a15e5..5430f79 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1139,6 +1139,7 @@ fn deduplicate_feature_works(#[case] input: &str, #[case] modify: Result { + res.unwrap(); pretty_assertions::assert_str_eq!(fixer.to_string(), modify.unwrap_or(input)); }, Err(modify) => { @@ -1146,3 +1147,236 @@ fn deduplicate_feature_works(#[case] input: &str, #[case] modify: Result, &str>, +) { + let mut fixer = AutoFixer::from_raw(input).unwrap(); + let res = fixer.add_workspace_dep_inner("log", "^0.4.20", default); + + match output { + Ok(modify) => { + res.unwrap(); + pretty_assertions::assert_str_eq!(fixer.to_string(), modify.unwrap_or(input)); + }, + Err(modify) => { + assert_eq!(res, Err(modify.into())); + }, + } +} + +#[rstest] +#[case( + r#"[dependencies] +log = { random = "321", default-features = true, hey = true, git = "123" } +"#, + Some(true), + Err("'git' or 'path' dependency are currently not supported") +)] +#[case( + r#"[dependencies] +log = { random = "321", default-features = true, hey = true, path = "123" } +"#, + Some(true), + Err("'git' or 'path' dependency are currently not supported") +)] +#[case( + r#"[dependencies] +log = { random = "321", default-features = true, version = "0.4.20", hey = true } +"#, + Some(true), + Ok(Some( + r#"[dependencies] +log = { random = "321", default-features = true, hey = true , workspace = true } +"# + )) +)] +#[case( + r#"[dependencies] +log = "321" +"#, + Some(true), + Ok(Some( + r#"[dependencies] +log = { workspace = true, default-features = true } +"# + )) +)] +#[case( + r#"[dependencies] +log = "321" +"#, + Some(false), + Ok(Some( + r#"[dependencies] +log = { workspace = true, default-features = false } +"# + )) +)] +#[case( + r#"[dependencies] +log = "321" +"#, + None, + Ok(Some( + r#"[dependencies] +log = { workspace = true } +"# + )) +)] +fn lift_to_workspace_works( + #[case] input: &str, + #[case] default: Option, + #[case] output: Result, &str>, +) { + for table in ["dependencies", "dev-dependencies", "build-dependencies"] { + let input = &input.replace("dependencies", table); + let mut fixer = AutoFixer::from_raw(input).unwrap(); + let res = fixer.lift_dependency("log", default); + + match output { + Ok(modify) => { + res.unwrap(); + let modify = modify.unwrap_or(input).replace("dependencies", table); + pretty_assertions::assert_str_eq!(fixer.to_string(), modify); + }, + Err(modify) => { + assert_eq!(res, Err(modify.into())); + }, + } + } +} diff --git a/tests/integration/sdk/transpose.yaml b/tests/integration/sdk/transpose.yaml index 0c3e89f..d25f4c6 100644 --- a/tests/integration/sdk/transpose.yaml +++ b/tests/integration/sdk/transpose.yaml @@ -1,33 +1,35 @@ repo: name: paritytech/polkadot-sdk - ref: c86b633695299ed27053940d5ea5c5a2392964b3 + ref: 7df1ae3b8111d534cce108b2b405b6a33fcdedc3 cases: - cmd: transpose dependency lift-to-workspace parity-scale-codec - stderr: |+ + stderr: | [WARN] Unstable feature - do not rely on this! - Found 6 different versions of 'parity-scale-codec' in the workspace: + Found 7 different versions of 'parity-scale-codec' in the workspace: - ^3.6.1: 244 times (frame-support, sp-api, sp-core, …) - ^3.0.0: 51 times (pallet-broker, cumulus-client-cli, cumulus-client-collator, …) - ^3.1.5: 19 times (bridge-runtime-common, bp-header-chain, bp-runtime, …) - ^3.2.2: 5 times (pallet-asset-conversion-tx-payment, pallet-safe-mode, pallet-tx-pause, …) + ^3.6.1: 260 times (frame-support, sp-api, sp-core, …) + ^3.0.0: 58 times (pallet-broker, bridge-hub-common, cumulus-primitives-core, …) + ^3.1.5: 20 times (bridge-runtime-common, bp-header-chain, bp-runtime, …) + ^3.4.0: 6 times (emulated-integration-tests-common, asset-hub-rococo-integration-tests, asset-hub-westend-integration-tests, …) + ^3.2.2: 6 times (pallet-asset-conversion-tx-payment, pallet-safe-mode, pallet-tx-pause, …) ^3.6.4: 4 times (cumulus-relay-chain-interface, polkadot-node-core-prospective-parachains, cumulus-relay-chain-rpc-interface, …) - ^3.4.0: 4 times (asset-hub-rococo-integration-tests, integration-tests-common, asset-hub-westend-integration-tests, …) + ^3.6.5: 1 time (polkadot-sdk-docs) - Hint: cargo upgrade -p parity-scale-codec@3.6.4 + Hint: cargo upgrade -p parity-scale-codec@3.6.5 + Error: "see log" code: 1 - cmd: transpose dependency lift-to-workspace log - stderr: |+ + stderr: | [WARN] Unstable feature - do not rely on this! Found 8 different versions of 'log' in the workspace: - ^0.4.17: 135 times (frame-support, sp-api, sp-core, …) - ^0.4.20: 28 times (bridge-runtime-common, pallet-bridge-grandpa, pallet-bridge-messages, …) - ^0.4 : 7 times (sc-utils, pallet-contracts, substrate-rpc-client, …) - ^0.4.16: 4 times (sc-network-light, pallet-core-fellowship, pallet-ranked-collective, …) + ^0.4.17: 142 times (frame-support, sp-api, sp-core, …) + ^0.4.20: 37 times (bridge-runtime-common, pallet-bridge-grandpa, pallet-bridge-messages, …) + ^0.4 : 7 times (sc-utils, binary-merkle-tree, pallet-contracts, …) + ^0.4.16: 4 times (sc-network-light, pallet-salary, pallet-ranked-collective, …) ^0.4.14: 4 times (pallet-alliance, pallet-elections-phragmen, pallet-glutton, …) ^0.4.19: 2 times (bp-runtime, parachains-common) ^0.4.0 : 2 times (pallet-nomination-pools, pallet-nomination-pools-test-staking) @@ -35,49 +37,1494 @@ cases: Hint: cargo upgrade -p log@0.4.20 + Error: "see log" + code: 1 +- cmd: transpose dependency lift-to-workspace log --version-resolver Unambiguous + stderr: | + error: invalid value 'Unambiguous' for '--version-resolver ' + [possible values: unambiguous, exact, latest] + + tip: a similar value exists: 'unambiguous' + + For more information, try '--help'. + code: 2 +- cmd: transpose dependency lift-to-workspace log --version-resolver latest + stderr: | + [WARN] Unstable feature - do not rely on this! + Held back modifications to 200 files; re-run with --fix to apply. + Error: "see log" + code: 1 +- cmd: transpose dependency lift-to-workspace log --version-resolver exact + stderr: | + error: the following required arguments were not provided: + --exact-version + + Usage: zepter transpose dependency lift-to-workspace --exact-version --version-resolver --manifest-path --log --offline + + For more information, try '--help'. + code: 2 +- cmd: transpose dependency lift-to-workspace log --exact-version 0.4.20 + stderr: | + [WARN] Unstable feature - do not rely on this! + Cannot use --exact-version without --version-resolver=exact + Error: "see log" + code: 1 +- cmd: transpose dependency lift-to-workspace log --version-resolver exact --exact-version 0.4.20 + stderr: | + [WARN] Unstable feature - do not rely on this! + Held back modifications to 200 files; re-run with --fix to apply. + Error: "see log" code: 1 - cmd: zepter transpose dependency lift-to-workspace macro_magic stderr: | [WARN] Unstable feature - do not rely on this! + Held back modifications to 3 files; re-run with --fix to apply. + Error: "see log" + code: 1 +- cmd: zepter transpose dependency lift-to-workspace tt-call --version-resolver latest --fix + stderr: | + [WARN] Unstable feature - do not rely on this! + code: 0 diff: | diff --git Cargo.toml Cargo.toml - index c98fe6d1a3..229870c266 100644 + index e807171b24..9bf53ed414 100644 --- Cargo.toml +++ Cargo.toml - @@ -6,0 +7,3 @@ license = "GPL-3.0-only" - +[workspace.dependencies] - +macro_magic = { version = "^0.5.0", default-features = false } - + + @@ -537,0 +538 @@ polkavm-derive = "0.8.0" + +tt-call = { version = "1.0.8", default-features = false } diff --git substrate/frame/support/Cargo.toml substrate/frame/support/Cargo.toml - index 5caf993bb3..71d14e587d 100644 + index ad97ad5146..d7b4a66ebd 100644 --- substrate/frame/support/Cargo.toml +++ substrate/frame/support/Cargo.toml - @@ -33 +33 @@ tt-call = "1.0.8" + @@ -36 +36 @@ sp-metadata-ir = { path = "../../primitives/metadata-ir", default-features = fal + -tt-call = "1.0.8" + +tt-call = { workspace = true, default-features = true } +- cmd: zepter transpose dependency lift-to-workspace macro_magic --version-resolver latest --fix + stderr: | + [WARN] Unstable feature - do not rely on this! + code: 0 + diff: | + diff --git Cargo.toml Cargo.toml + index e807171b24..de52367e86 100644 + --- Cargo.toml + +++ Cargo.toml + @@ -537,0 +538 @@ polkavm-derive = "0.8.0" + +macro_magic = { version = "0.5.0", default-features = false } + diff --git substrate/frame/support/Cargo.toml substrate/frame/support/Cargo.toml + index ad97ad5146..c4ebb255f2 100644 + --- substrate/frame/support/Cargo.toml + +++ substrate/frame/support/Cargo.toml + @@ -37 +37 @@ tt-call = "1.0.8" -macro_magic = "0.5.0" - +macro_magic = { workspace = true } + +macro_magic = { workspace = true, default-features = true } diff --git substrate/frame/support/procedural/Cargo.toml substrate/frame/support/procedural/Cargo.toml - index 45ed1750a5..9b84497581 100644 + index d77f6595db..6a58a6e136 100644 --- substrate/frame/support/procedural/Cargo.toml +++ substrate/frame/support/procedural/Cargo.toml - @@ -26 +26 @@ frame-support-procedural-tools = { path = "tools" } + @@ -29 +29 @@ frame-support-procedural-tools = { path = "tools" } -macro_magic = { version = "0.5.0", features = ["proc_support"] } - +macro_magic = { features = ["proc_support"] , workspace = true } -- cmd: zepter transpose dependency lift-to-workspace tt-call + +macro_magic = { features = ["proc_support"] , workspace = true, default-features = true } +- cmd: transpose dependency lift-to-workspace log --version-resolver latest --fix stderr: | [WARN] Unstable feature - do not rely on this! + code: 0 diff: | diff --git Cargo.toml Cargo.toml - index c98fe6d1a3..42db4817d6 100644 + index e807171b24..6bb50da1b6 100644 --- Cargo.toml +++ Cargo.toml - @@ -6,0 +7,3 @@ license = "GPL-3.0-only" - +[workspace.dependencies] - +tt-call = { version = "^1.0.8", default-features = false } - + + @@ -537,0 +538 @@ polkavm-derive = "0.8.0" + +log = { version = "0.4.20", default-features = false } + diff --git bridges/bin/runtime-common/Cargo.toml bridges/bin/runtime-common/Cargo.toml + index c007206450..fac88b20ca 100644 + --- bridges/bin/runtime-common/Cargo.toml + +++ bridges/bin/runtime-common/Cargo.toml + @@ -16 +16 @@ hash-db = { version = "0.16.0", default-features = false } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/modules/grandpa/Cargo.toml bridges/modules/grandpa/Cargo.toml + index 562a6e43e0..dccd7b3bdc 100644 + --- bridges/modules/grandpa/Cargo.toml + +++ bridges/modules/grandpa/Cargo.toml + @@ -17 +17 @@ finality-grandpa = { version = "0.16.2", default-features = false } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/modules/messages/Cargo.toml bridges/modules/messages/Cargo.toml + index 224aad7b36..173d6f1c16 100644 + --- bridges/modules/messages/Cargo.toml + +++ bridges/modules/messages/Cargo.toml + @@ -14 +14 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features = + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/modules/parachains/Cargo.toml bridges/modules/parachains/Cargo.toml + index 41aeca4b3b..e454a6f288 100644 + --- bridges/modules/parachains/Cargo.toml + +++ bridges/modules/parachains/Cargo.toml + @@ -14 +14 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features = + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/modules/relayers/Cargo.toml bridges/modules/relayers/Cargo.toml + index 35017ebbd3..b78da5cbee 100644 + --- bridges/modules/relayers/Cargo.toml + +++ bridges/modules/relayers/Cargo.toml + @@ -14 +14 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features = + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/modules/xcm-bridge-hub-router/Cargo.toml bridges/modules/xcm-bridge-hub-router/Cargo.toml + index ff33b19a58..20f8ff4407 100644 + --- bridges/modules/xcm-bridge-hub-router/Cargo.toml + +++ bridges/modules/xcm-bridge-hub-router/Cargo.toml + @@ -14 +14 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features = + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/modules/xcm-bridge-hub/Cargo.toml bridges/modules/xcm-bridge-hub/Cargo.toml + index 89e261dc6d..e10119e864 100644 + --- bridges/modules/xcm-bridge-hub/Cargo.toml + +++ bridges/modules/xcm-bridge-hub/Cargo.toml + @@ -14 +14 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features = + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/primitives/runtime/Cargo.toml bridges/primitives/runtime/Cargo.toml + index 6786bf8f21..2ea31c26d6 100644 + --- bridges/primitives/runtime/Cargo.toml + +++ bridges/primitives/runtime/Cargo.toml + @@ -16 +16 @@ impl-trait-for-tuples = "0.2.2" + -log = { version = "0.4.19", default-features = false } + +log = { workspace = true } + diff --git bridges/snowbridge/pallets/ethereum-client/Cargo.toml bridges/snowbridge/pallets/ethereum-client/Cargo.toml + index 2f76d5b835..dd7051fe3f 100644 + --- bridges/snowbridge/pallets/ethereum-client/Cargo.toml + +++ bridges/snowbridge/pallets/ethereum-client/Cargo.toml + @@ -27 +27 @@ hex-literal = { version = "0.4.1", optional = true } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/snowbridge/pallets/inbound-queue/Cargo.toml bridges/snowbridge/pallets/inbound-queue/Cargo.toml + index 1081b162dd..8756982ed7 100644 + --- bridges/snowbridge/pallets/inbound-queue/Cargo.toml + +++ bridges/snowbridge/pallets/inbound-queue/Cargo.toml + @@ -22 +22 @@ hex-literal = { version = "0.4.1", optional = true } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/snowbridge/pallets/system/Cargo.toml bridges/snowbridge/pallets/system/Cargo.toml + index aa60051163..f6c642e737 100644 + --- bridges/snowbridge/pallets/system/Cargo.toml + +++ bridges/snowbridge/pallets/system/Cargo.toml + @@ -25 +25 @@ frame-system = { path = "../../../../substrate/frame/system", default-features = + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/snowbridge/primitives/router/Cargo.toml bridges/snowbridge/primitives/router/Cargo.toml + index 712c60c214..3dbf5483e1 100644 + --- bridges/snowbridge/primitives/router/Cargo.toml + +++ bridges/snowbridge/primitives/router/Cargo.toml + @@ -18 +18 @@ scale-info = { version = "2.9.0", default-features = false, features = ["derive" + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/snowbridge/runtime/runtime-common/Cargo.toml bridges/snowbridge/runtime/runtime-common/Cargo.toml + index f5b44b2558..d4c86f8aa7 100644 + --- bridges/snowbridge/runtime/runtime-common/Cargo.toml + +++ bridges/snowbridge/runtime/runtime-common/Cargo.toml + @@ -15 +15 @@ workspace = true + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git bridges/snowbridge/runtime/test-common/Cargo.toml bridges/snowbridge/runtime/test-common/Cargo.toml + index a2994e6189..ecf0a6fcc6 100644 + --- bridges/snowbridge/runtime/test-common/Cargo.toml + +++ bridges/snowbridge/runtime/test-common/Cargo.toml + @@ -16 +16 @@ hex-literal = { version = "0.4.1" } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/client/consensus/common/Cargo.toml cumulus/client/consensus/common/Cargo.toml + index 7fee51310d..5a014b10e3 100644 + --- cumulus/client/consensus/common/Cargo.toml + +++ cumulus/client/consensus/common/Cargo.toml + @@ -17 +17 @@ futures = "0.3.28" + -log = "0.4.20" + +log = { workspace = true, default-features = true } + diff --git cumulus/pallets/collator-selection/Cargo.toml cumulus/pallets/collator-selection/Cargo.toml + index 4216776fe8..20f048b97d 100644 + --- cumulus/pallets/collator-selection/Cargo.toml + +++ cumulus/pallets/collator-selection/Cargo.toml + @@ -19 +19 @@ targets = ["x86_64-unknown-linux-gnu"] + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/pallets/dmp-queue/Cargo.toml cumulus/pallets/dmp-queue/Cargo.toml + index 301a77003c..83ed994d04 100644 + --- cumulus/pallets/dmp-queue/Cargo.toml + +++ cumulus/pallets/dmp-queue/Cargo.toml + @@ -18 +18 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/pallets/parachain-system/Cargo.toml cumulus/pallets/parachain-system/Cargo.toml + index 848efd3eab..8664729056 100644 + --- cumulus/pallets/parachain-system/Cargo.toml + +++ cumulus/pallets/parachain-system/Cargo.toml + @@ -17 +17 @@ impl-trait-for-tuples = "0.2.1" + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/pallets/xcmp-queue/Cargo.toml cumulus/pallets/xcmp-queue/Cargo.toml + index 8dde44ca0f..9078d5eda9 100644 + --- cumulus/pallets/xcmp-queue/Cargo.toml + +++ cumulus/pallets/xcmp-queue/Cargo.toml + @@ -14 +14 @@ codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachain-template/node/Cargo.toml cumulus/parachain-template/node/Cargo.toml + index c66c96056b..0ad07ac7aa 100644 + --- cumulus/parachain-template/node/Cargo.toml + +++ cumulus/parachain-template/node/Cargo.toml + @@ -18 +18 @@ clap = { version = "4.4.18", features = ["derive"] } + -log = "0.4.20" + +log = { workspace = true, default-features = true } + diff --git cumulus/parachain-template/runtime/Cargo.toml cumulus/parachain-template/runtime/Cargo.toml + index e4575d196c..44d96ffc4e 100644 + --- cumulus/parachain-template/runtime/Cargo.toml + +++ cumulus/parachain-template/runtime/Cargo.toml + @@ -23 +23 @@ hex-literal = { version = "0.4.1", optional = true } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/common/Cargo.toml cumulus/parachains/common/Cargo.toml + index fe5e24ee60..ebc9f822be 100644 + --- cumulus/parachains/common/Cargo.toml + +++ cumulus/parachains/common/Cargo.toml + @@ -17 +17 @@ codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive + -log = { version = "0.4.19", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml + index d1b302dc6d..05936e9399 100644 + --- cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml + +++ cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml + @@ -15 +15 @@ hex-literal = { version = "0.4.1" } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml + index 415c8c1cb0..78c48507a7 100644 + --- cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml + +++ cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml + @@ -15 +15 @@ hex-literal = { version = "0.4.1", optional = true } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/assets/common/Cargo.toml cumulus/parachains/runtimes/assets/common/Cargo.toml + index 74e5e44ce1..c9252375cf 100644 + --- cumulus/parachains/runtimes/assets/common/Cargo.toml + +++ cumulus/parachains/runtimes/assets/common/Cargo.toml + @@ -15 +15 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml + index 920e7b1571..88fb56a2f0 100644 + --- cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml + +++ cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml + @@ -20 +20 @@ hex-literal = { version = "0.4.1" } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml + index 4cbfde91d0..4ce77f8060 100644 + --- cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml + +++ cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/Cargo.toml + @@ -18 +18 @@ hex-literal = { version = "0.4.1" } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml + index f2cf60354a..d34b5cd0ee 100644 + --- cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml + +++ cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml + @@ -15 +15 @@ impl-trait-for-tuples = "0.2" + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml + index c16cee4fed..ed264f28c2 100644 + --- cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml + +++ cumulus/parachains/runtimes/collectives/collectives-westend/Cargo.toml + @@ -15 +15 @@ hex-literal = { version = "0.4.1" } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml + index 9f719421b9..dcc6c4e853 100644 + --- cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml + +++ cumulus/parachains/runtimes/contracts/contracts-rococo/Cargo.toml + @@ -21 +21 @@ hex-literal = { version = "0.4.1", optional = true } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml + index ae604da87a..ef9869d727 100644 + --- cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml + +++ cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml + @@ -18 +18 @@ hex-literal = "0.4.1" + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml + index f85f6896cb..aae194f9ad 100644 + --- cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml + +++ cumulus/parachains/runtimes/coretime/coretime-westend/Cargo.toml + @@ -18 +18 @@ hex-literal = "0.4.1" + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/people/people-rococo/Cargo.toml cumulus/parachains/runtimes/people/people-rococo/Cargo.toml + index 5e5e1e0160..b44d40c701 100644 + --- cumulus/parachains/runtimes/people/people-rococo/Cargo.toml + +++ cumulus/parachains/runtimes/people/people-rococo/Cargo.toml + @@ -16 +16 @@ hex-literal = { version = "0.4.1" } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/people/people-westend/Cargo.toml cumulus/parachains/runtimes/people/people-westend/Cargo.toml + index c4c76074d7..7295b22f5a 100644 + --- cumulus/parachains/runtimes/people/people-westend/Cargo.toml + +++ cumulus/parachains/runtimes/people/people-westend/Cargo.toml + @@ -16 +16 @@ hex-literal = { version = "0.4.1" } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/parachains/runtimes/testing/penpal/Cargo.toml cumulus/parachains/runtimes/testing/penpal/Cargo.toml + index dab687c527..08e5987d43 100644 + --- cumulus/parachains/runtimes/testing/penpal/Cargo.toml + +++ cumulus/parachains/runtimes/testing/penpal/Cargo.toml + @@ -23 +23 @@ hex-literal = { version = "0.4.1", optional = true } + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/polkadot-parachain/Cargo.toml cumulus/polkadot-parachain/Cargo.toml + index cc0bd47cc7..646efe3c5f 100644 + --- cumulus/polkadot-parachain/Cargo.toml + +++ cumulus/polkadot-parachain/Cargo.toml + @@ -23 +23 @@ hex-literal = "0.4.1" + -log = "0.4.20" + +log = { workspace = true, default-features = true } + diff --git cumulus/primitives/utility/Cargo.toml cumulus/primitives/utility/Cargo.toml + index 27e9fbe3c7..45c0e66709 100644 + --- cumulus/primitives/utility/Cargo.toml + +++ cumulus/primitives/utility/Cargo.toml + @@ -14 +14 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git cumulus/xcm/xcm-emulator/Cargo.toml cumulus/xcm/xcm-emulator/Cargo.toml + index fb37fd0176..6b45770a8e 100644 + --- cumulus/xcm/xcm-emulator/Cargo.toml + +++ cumulus/xcm/xcm-emulator/Cargo.toml + @@ -15 +15 @@ paste = "1.0.14" + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git polkadot/cli/Cargo.toml polkadot/cli/Cargo.toml + index 3186e31f39..33bea510eb 100644 + --- polkadot/cli/Cargo.toml + +++ polkadot/cli/Cargo.toml + @@ -23 +23 @@ clap = { version = "4.4.18", features = ["derive"], optional = true } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/core/approval-voting/Cargo.toml polkadot/node/core/approval-voting/Cargo.toml + index 5ab823f489..1010779a1b 100644 + --- polkadot/node/core/approval-voting/Cargo.toml + +++ polkadot/node/core/approval-voting/Cargo.toml + @@ -54 +54 @@ test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../ + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/core/av-store/Cargo.toml polkadot/node/core/av-store/Cargo.toml + index 68769fb8cc..4f5c18a68d 100644 + --- polkadot/node/core/av-store/Cargo.toml + +++ polkadot/node/core/av-store/Cargo.toml + @@ -31 +31 @@ polkadot-node-jaeger = { path = "../../jaeger" } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/jaeger/Cargo.toml polkadot/node/jaeger/Cargo.toml + index 892292c714..c8fd3d4628 100644 + --- polkadot/node/jaeger/Cargo.toml + +++ polkadot/node/jaeger/Cargo.toml + @@ -22 +22 @@ tokio = "1.24.2" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/metrics/Cargo.toml polkadot/node/metrics/Cargo.toml + index 7d67c0a58d..c567278f70 100644 + --- polkadot/node/metrics/Cargo.toml + +++ polkadot/node/metrics/Cargo.toml + @@ -27 +27 @@ bs58 = { version = "0.5.0", features = ["alloc"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/network/approval-distribution/Cargo.toml polkadot/node/network/approval-distribution/Cargo.toml + index a1fa803abc..2bc09c5f42 100644 + --- polkadot/node/network/approval-distribution/Cargo.toml + +++ polkadot/node/network/approval-distribution/Cargo.toml + @@ -41 +41 @@ env_logger = "0.9.0" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/network/availability-recovery/Cargo.toml polkadot/node/network/availability-recovery/Cargo.toml + index 9f1d905231..e86445730f 100644 + --- polkadot/node/network/availability-recovery/Cargo.toml + +++ polkadot/node/network/availability-recovery/Cargo.toml + @@ -35 +35 @@ futures-timer = "3.0.2" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/network/bitfield-distribution/Cargo.toml polkadot/node/network/bitfield-distribution/Cargo.toml + index 8a05bcbd49..0ddb5f643b 100644 + --- polkadot/node/network/bitfield-distribution/Cargo.toml + +++ polkadot/node/network/bitfield-distribution/Cargo.toml + @@ -32 +32 @@ maplit = "1.0.2" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/network/collator-protocol/Cargo.toml polkadot/node/network/collator-protocol/Cargo.toml + index 9a9ce6fce6..f88e8182ec 100644 + --- polkadot/node/network/collator-protocol/Cargo.toml + +++ polkadot/node/network/collator-protocol/Cargo.toml + @@ -32 +32 @@ tokio-util = "0.7.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/service/Cargo.toml polkadot/node/service/Cargo.toml + index 007e3dc595..5b73d420e3 100644 + --- polkadot/node/service/Cargo.toml + +++ polkadot/node/service/Cargo.toml + @@ -86 +86 @@ gum = { package = "tracing-gum", path = "../gum" } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/subsystem-bench/Cargo.toml polkadot/node/subsystem-bench/Cargo.toml + index 136eccbf68..bc038abd64 100644 + --- polkadot/node/subsystem-bench/Cargo.toml + +++ polkadot/node/subsystem-bench/Cargo.toml + @@ -46 +46 @@ polkadot-erasure-coding = { package = "polkadot-erasure-coding", path = "../../e + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/node/subsystem-util/Cargo.toml polkadot/node/subsystem-util/Cargo.toml + index 5f615e05ab..b2a643d92f 100644 + --- polkadot/node/subsystem-util/Cargo.toml + +++ polkadot/node/subsystem-util/Cargo.toml + @@ -49 +49 @@ futures = { version = "0.3.21", features = ["thread-pool"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/parachain/test-parachains/adder/collator/Cargo.toml polkadot/parachain/test-parachains/adder/collator/Cargo.toml + index 7dd0d9a563..c2b11aadb5 100644 + --- polkadot/parachain/test-parachains/adder/collator/Cargo.toml + +++ polkadot/parachain/test-parachains/adder/collator/Cargo.toml + @@ -22 +22 @@ futures-timer = "3.0.2" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/parachain/test-parachains/undying/Cargo.toml polkadot/parachain/test-parachains/undying/Cargo.toml + index 19e1261db1..82ceebcf4e 100644 + --- polkadot/parachain/test-parachains/undying/Cargo.toml + +++ polkadot/parachain/test-parachains/undying/Cargo.toml + @@ -20 +20 @@ dlmalloc = { version = "0.2.4", features = ["global"] } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/parachain/test-parachains/undying/collator/Cargo.toml polkadot/parachain/test-parachains/undying/collator/Cargo.toml + index 001c48476b..c74b01be08 100644 + --- polkadot/parachain/test-parachains/undying/collator/Cargo.toml + +++ polkadot/parachain/test-parachains/undying/collator/Cargo.toml + @@ -22 +22 @@ futures-timer = "3.0.2" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/runtime/common/Cargo.toml polkadot/runtime/common/Cargo.toml + index acbc845c41..7257ca1d6d 100644 + --- polkadot/runtime/common/Cargo.toml + +++ polkadot/runtime/common/Cargo.toml + @@ -16 +16 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/runtime/parachains/Cargo.toml polkadot/runtime/parachains/Cargo.toml + index 507df01ac4..12cebe8e79 100644 + --- polkadot/runtime/parachains/Cargo.toml + +++ polkadot/runtime/parachains/Cargo.toml + @@ -16 +16 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/runtime/rococo/Cargo.toml polkadot/runtime/rococo/Cargo.toml + index 11be7a9ffc..6b718e824b 100644 + --- polkadot/runtime/rococo/Cargo.toml + +++ polkadot/runtime/rococo/Cargo.toml + @@ -16 +16 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/runtime/test-runtime/Cargo.toml polkadot/runtime/test-runtime/Cargo.toml + index 9778ff8243..3eca55a73d 100644 + --- polkadot/runtime/test-runtime/Cargo.toml + +++ polkadot/runtime/test-runtime/Cargo.toml + @@ -16 +16 @@ parity-scale-codec = { version = "3.6.1", default-features = false, features = [ + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/runtime/westend/Cargo.toml polkadot/runtime/westend/Cargo.toml + index 0ea2436b68..77acb1b856 100644 + --- polkadot/runtime/westend/Cargo.toml + +++ polkadot/runtime/westend/Cargo.toml + @@ -17 +17 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/utils/remote-ext-tests/bags-list/Cargo.toml polkadot/utils/remote-ext-tests/bags-list/Cargo.toml + index f8190e6aef..a300f0fca1 100644 + --- polkadot/utils/remote-ext-tests/bags-list/Cargo.toml + +++ polkadot/utils/remote-ext-tests/bags-list/Cargo.toml + @@ -22 +22 @@ clap = { version = "4.4.18", features = ["derive"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/xcm/Cargo.toml polkadot/xcm/Cargo.toml + index 41b79051bb..b89a5c5c87 100644 + --- polkadot/xcm/Cargo.toml + +++ polkadot/xcm/Cargo.toml + @@ -17 +17 @@ impl-trait-for-tuples = "0.2.2" + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml + index adeacddf90..80f2d1deed 100644 + --- polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml + +++ polkadot/xcm/pallet-xcm-benchmarks/Cargo.toml + @@ -27 +27 @@ xcm-builder = { package = "staging-xcm-builder", path = "../xcm-builder", defaul + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git polkadot/xcm/pallet-xcm/Cargo.toml polkadot/xcm/pallet-xcm/Cargo.toml + index dc9b3c0e20..aa15d5edc8 100644 + --- polkadot/xcm/pallet-xcm/Cargo.toml + +++ polkadot/xcm/pallet-xcm/Cargo.toml + @@ -17 +17 @@ serde = { version = "1.0.195", optional = true, features = ["derive"] } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/xcm/xcm-builder/Cargo.toml polkadot/xcm/xcm-builder/Cargo.toml + index 30010fc210..10726b0f51 100644 + --- polkadot/xcm/xcm-builder/Cargo.toml + +++ polkadot/xcm/xcm-builder/Cargo.toml + @@ -26 +26 @@ pallet-transaction-payment = { path = "../../../substrate/frame/transaction-paym + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/xcm/xcm-executor/Cargo.toml polkadot/xcm/xcm-executor/Cargo.toml + index 7ce4a1cc17..71bd58073d 100644 + --- polkadot/xcm/xcm-executor/Cargo.toml + +++ polkadot/xcm/xcm-executor/Cargo.toml + @@ -25 +25 @@ frame-support = { path = "../../../substrate/frame/support", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git polkadot/xcm/xcm-simulator/example/Cargo.toml polkadot/xcm/xcm-simulator/example/Cargo.toml + index 9cb5b6b7ee..af471df60a 100644 + --- polkadot/xcm/xcm-simulator/example/Cargo.toml + +++ polkadot/xcm/xcm-simulator/example/Cargo.toml + @@ -15 +15 @@ scale-info = { version = "2.10.0", features = ["derive"] } + -log = { version = "0.4.14", default-features = false } + +log = { workspace = true } + diff --git substrate/bin/node/bench/Cargo.toml substrate/bin/node/bench/Cargo.toml + index 42af802d71..78cdaeb0ce 100644 + --- substrate/bin/node/bench/Cargo.toml + +++ substrate/bin/node/bench/Cargo.toml + @@ -20 +20 @@ clap = { version = "4.4.18", features = ["derive"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/bin/node/cli/Cargo.toml substrate/bin/node/cli/Cargo.toml + index 5dfe915b78..efdbd0f5b2 100644 + --- substrate/bin/node/cli/Cargo.toml + +++ substrate/bin/node/cli/Cargo.toml + @@ -49 +49 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/bin/node/runtime/Cargo.toml substrate/bin/node/runtime/Cargo.toml + index 4bb5fed2b0..6745a34e88 100644 + --- substrate/bin/node/runtime/Cargo.toml + +++ substrate/bin/node/runtime/Cargo.toml + @@ -28 +28 @@ static_assertions = "1.1.0" + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/bin/node/testing/Cargo.toml substrate/bin/node/testing/Cargo.toml + index 9ca8b8ef72..31f8689d46 100644 + --- substrate/bin/node/testing/Cargo.toml + +++ substrate/bin/node/testing/Cargo.toml + @@ -22 +22 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/bin/utils/chain-spec-builder/Cargo.toml substrate/bin/utils/chain-spec-builder/Cargo.toml + index e39c989838..df4ddf3331 100644 + --- substrate/bin/utils/chain-spec-builder/Cargo.toml + +++ substrate/bin/utils/chain-spec-builder/Cargo.toml + @@ -27 +27 @@ clap = { version = "4.4.18", features = ["derive"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/allocator/Cargo.toml substrate/client/allocator/Cargo.toml + index f882cda908..662125814f 100644 + --- substrate/client/allocator/Cargo.toml + +++ substrate/client/allocator/Cargo.toml + @@ -20 +20 @@ targets = ["x86_64-unknown-linux-gnu"] + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/api/Cargo.toml substrate/client/api/Cargo.toml + index 14aca6d9a2..09f60a4767 100644 + --- substrate/client/api/Cargo.toml + +++ substrate/client/api/Cargo.toml + @@ -25 +25 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/authority-discovery/Cargo.toml substrate/client/authority-discovery/Cargo.toml + index 4c8370233e..78f7144f43 100644 + --- substrate/client/authority-discovery/Cargo.toml + +++ substrate/client/authority-discovery/Cargo.toml + @@ -32 +32 @@ multihash = { version = "0.18.1", default-features = false, features = [ + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/basic-authorship/Cargo.toml substrate/client/basic-authorship/Cargo.toml + index 370f4a4adf..51a06464d0 100644 + --- substrate/client/basic-authorship/Cargo.toml + +++ substrate/client/basic-authorship/Cargo.toml + @@ -22 +22 @@ futures-timer = "3.0.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/chain-spec/Cargo.toml substrate/client/chain-spec/Cargo.toml + index 9ab12dc2ad..e8ad9e3509 100644 + --- substrate/client/chain-spec/Cargo.toml + +++ substrate/client/chain-spec/Cargo.toml + @@ -35 +35 @@ sp-state-machine = { path = "../../primitives/state-machine" } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/client/cli/Cargo.toml substrate/client/cli/Cargo.toml + index 2d9c2fa5ff..50fb57bf1f 100644 + --- substrate/client/cli/Cargo.toml + +++ substrate/client/cli/Cargo.toml + @@ -26 +26 @@ libp2p-identity = { version = "0.1.3", features = ["ed25519", "peerid"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/aura/Cargo.toml substrate/client/consensus/aura/Cargo.toml + index 33f7d160d8..d1076da35f 100644 + --- substrate/client/consensus/aura/Cargo.toml + +++ substrate/client/consensus/aura/Cargo.toml + @@ -22 +22 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/babe/Cargo.toml substrate/client/consensus/babe/Cargo.toml + index 01c5d062d6..9bfed7e541 100644 + --- substrate/client/consensus/babe/Cargo.toml + +++ substrate/client/consensus/babe/Cargo.toml + @@ -23 +23 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/beefy/Cargo.toml substrate/client/consensus/beefy/Cargo.toml + index 3522697427..fe90503cae 100644 + --- substrate/client/consensus/beefy/Cargo.toml + +++ substrate/client/consensus/beefy/Cargo.toml + @@ -21 +21 @@ futures = "0.3" + -log = "0.4" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/beefy/rpc/Cargo.toml substrate/client/consensus/beefy/rpc/Cargo.toml + index 496aefac11..810959dad3 100644 + --- substrate/client/consensus/beefy/rpc/Cargo.toml + +++ substrate/client/consensus/beefy/rpc/Cargo.toml + @@ -18 +18 @@ jsonrpsee = { version = "0.20.3", features = ["client-core", "macros", "server"] + -log = "0.4" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/common/Cargo.toml substrate/client/consensus/common/Cargo.toml + index 16d3a4a144..496e6c8274 100644 + --- substrate/client/consensus/common/Cargo.toml + +++ substrate/client/consensus/common/Cargo.toml + @@ -23 +23 @@ libp2p-identity = { version = "0.1.3", features = ["ed25519", "peerid"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/grandpa/Cargo.toml substrate/client/consensus/grandpa/Cargo.toml + index 3f7b48d9f2..1d02fbb2c8 100644 + --- substrate/client/consensus/grandpa/Cargo.toml + +++ substrate/client/consensus/grandpa/Cargo.toml + @@ -27 +27 @@ futures-timer = "3.0.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/grandpa/rpc/Cargo.toml substrate/client/consensus/grandpa/rpc/Cargo.toml + index ae9ab5d9d0..e6f884336b 100644 + --- substrate/client/consensus/grandpa/rpc/Cargo.toml + +++ substrate/client/consensus/grandpa/rpc/Cargo.toml + @@ -19 +19 @@ jsonrpsee = { version = "0.20.3", features = ["client-core", "macros", "server"] + -log = "0.4.8" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/manual-seal/Cargo.toml substrate/client/consensus/manual-seal/Cargo.toml + index 0094fb8780..80eeac4dd1 100644 + --- substrate/client/consensus/manual-seal/Cargo.toml + +++ substrate/client/consensus/manual-seal/Cargo.toml + @@ -25 +25 @@ futures-timer = "3.0.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/pow/Cargo.toml substrate/client/consensus/pow/Cargo.toml + index c59a6a2711..6caccb9879 100644 + --- substrate/client/consensus/pow/Cargo.toml + +++ substrate/client/consensus/pow/Cargo.toml + @@ -23 +23 @@ futures-timer = "3.0.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/consensus/slots/Cargo.toml substrate/client/consensus/slots/Cargo.toml + index 8eed24532c..75f8b29a2f 100644 + --- substrate/client/consensus/slots/Cargo.toml + +++ substrate/client/consensus/slots/Cargo.toml + @@ -24 +24 @@ futures-timer = "3.0.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/db/Cargo.toml substrate/client/db/Cargo.toml + index ed7b4178f2..57ee1a8ad3 100644 + --- substrate/client/db/Cargo.toml + +++ substrate/client/db/Cargo.toml + @@ -27 +27 @@ linked-hash-map = "0.5.4" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/executor/wasmtime/Cargo.toml substrate/client/executor/wasmtime/Cargo.toml + index 12e6647c69..75cc76a235 100644 + --- substrate/client/executor/wasmtime/Cargo.toml + +++ substrate/client/executor/wasmtime/Cargo.toml + @@ -19 +19 @@ targets = ["x86_64-unknown-linux-gnu"] + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/informant/Cargo.toml substrate/client/informant/Cargo.toml + index 0252e9a115..bd15e94eba 100644 + --- substrate/client/informant/Cargo.toml + +++ substrate/client/informant/Cargo.toml + @@ -22 +22 @@ futures-timer = "3.0.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/merkle-mountain-range/Cargo.toml substrate/client/merkle-mountain-range/Cargo.toml + index 201c179f30..60232bccb0 100644 + --- substrate/client/merkle-mountain-range/Cargo.toml + +++ substrate/client/merkle-mountain-range/Cargo.toml + @@ -19 +19 @@ futures = "0.3" + -log = "0.4" + +log = { workspace = true, default-features = true } + diff --git substrate/client/mixnet/Cargo.toml substrate/client/mixnet/Cargo.toml + index 280af81b86..8bcd963bd5 100644 + --- substrate/client/mixnet/Cargo.toml + +++ substrate/client/mixnet/Cargo.toml + @@ -27 +27 @@ libp2p-identity = { version = "0.1.3", features = ["peerid"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/network-gossip/Cargo.toml substrate/client/network-gossip/Cargo.toml + index baf4def0b8..a14761c0d6 100644 + --- substrate/client/network-gossip/Cargo.toml + +++ substrate/client/network-gossip/Cargo.toml + @@ -24 +24 @@ libp2p = "0.51.4" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/network/Cargo.toml substrate/client/network/Cargo.toml + index 167f112705..79f5a6b4fa 100644 + --- substrate/client/network/Cargo.toml + +++ substrate/client/network/Cargo.toml + @@ -33 +33 @@ linked_hash_set = "0.1.3" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/network/bitswap/Cargo.toml substrate/client/network/bitswap/Cargo.toml + index 9982ef80cf..63544b069e 100644 + --- substrate/client/network/bitswap/Cargo.toml + +++ substrate/client/network/bitswap/Cargo.toml + @@ -26 +26 @@ libp2p-identity = { version = "0.1.3", features = ["peerid"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/network/light/Cargo.toml substrate/client/network/light/Cargo.toml + index efefc6f18b..a83be7538b 100644 + --- substrate/client/network/light/Cargo.toml + +++ substrate/client/network/light/Cargo.toml + @@ -29 +29 @@ libp2p-identity = { version = "0.1.3", features = ["peerid"] } + -log = "0.4.16" + +log = { workspace = true, default-features = true } + diff --git substrate/client/network/statement/Cargo.toml substrate/client/network/statement/Cargo.toml + index 0a0ce61527..b6efee5d9d 100644 + --- substrate/client/network/statement/Cargo.toml + +++ substrate/client/network/statement/Cargo.toml + @@ -24 +24 @@ libp2p = "0.51.4" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/network/sync/Cargo.toml substrate/client/network/sync/Cargo.toml + index f81b4ee77b..19f86e87ac 100644 + --- substrate/client/network/sync/Cargo.toml + +++ substrate/client/network/sync/Cargo.toml + @@ -29 +29 @@ libp2p = "0.51.4" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/network/test/Cargo.toml substrate/client/network/test/Cargo.toml + index dced6ed673..4f57287a39 100644 + --- substrate/client/network/test/Cargo.toml + +++ substrate/client/network/test/Cargo.toml + @@ -24 +24 @@ libp2p = "0.51.4" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/network/transactions/Cargo.toml substrate/client/network/transactions/Cargo.toml + index 9e021059eb..01c8ac8814 100644 + --- substrate/client/network/transactions/Cargo.toml + +++ substrate/client/network/transactions/Cargo.toml + @@ -23 +23 @@ libp2p = "0.51.4" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/offchain/Cargo.toml substrate/client/offchain/Cargo.toml + index 5205237128..eef385a6dd 100644 + --- substrate/client/offchain/Cargo.toml + +++ substrate/client/offchain/Cargo.toml + @@ -45 +45 @@ sp-externalities = { path = "../../primitives/externalities" } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/proposer-metrics/Cargo.toml substrate/client/proposer-metrics/Cargo.toml + index 40fcc72201..f560ce2d65 100644 + --- substrate/client/proposer-metrics/Cargo.toml + +++ substrate/client/proposer-metrics/Cargo.toml + @@ -19 +19 @@ targets = ["x86_64-unknown-linux-gnu"] + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/rpc-servers/Cargo.toml substrate/client/rpc-servers/Cargo.toml + index b624a14e26..8a0b8f80f4 100644 + --- substrate/client/rpc-servers/Cargo.toml + +++ substrate/client/rpc-servers/Cargo.toml + @@ -20 +20 @@ jsonrpsee = { version = "0.20.3", features = ["server"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/rpc-spec-v2/Cargo.toml substrate/client/rpc-spec-v2/Cargo.toml + index 6d0e7e0784..12a02e0b45 100644 + --- substrate/client/rpc-spec-v2/Cargo.toml + +++ substrate/client/rpc-spec-v2/Cargo.toml + @@ -42 +42 @@ array-bytes = "6.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/rpc/Cargo.toml substrate/client/rpc/Cargo.toml + index 6917eb0b55..a39d9226b6 100644 + --- substrate/client/rpc/Cargo.toml + +++ substrate/client/rpc/Cargo.toml + @@ -22 +22 @@ jsonrpsee = { version = "0.20.3", features = ["server"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/service/Cargo.toml substrate/client/service/Cargo.toml + index 1c95112aa6..41ec22a97c 100644 + --- substrate/client/service/Cargo.toml + +++ substrate/client/service/Cargo.toml + @@ -36 +36 @@ parking_lot = "0.12.1" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/service/test/Cargo.toml substrate/client/service/test/Cargo.toml + index 625d828639..ee7e60f601 100644 + --- substrate/client/service/test/Cargo.toml + +++ substrate/client/service/test/Cargo.toml + @@ -22 +22 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/state-db/Cargo.toml substrate/client/state-db/Cargo.toml + index 3f86a0da88..400dda20c2 100644 + --- substrate/client/state-db/Cargo.toml + +++ substrate/client/state-db/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/statement-store/Cargo.toml substrate/client/statement-store/Cargo.toml + index ed22925937..676f6cb36f 100644 + --- substrate/client/statement-store/Cargo.toml + +++ substrate/client/statement-store/Cargo.toml + @@ -19 +19 @@ targets = ["x86_64-unknown-linux-gnu"] + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/storage-monitor/Cargo.toml substrate/client/storage-monitor/Cargo.toml + index f4db58d6bb..6cea3f3894 100644 + --- substrate/client/storage-monitor/Cargo.toml + +++ substrate/client/storage-monitor/Cargo.toml + @@ -16 +16 @@ clap = { version = "4.4.18", features = ["derive", "string"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/sysinfo/Cargo.toml substrate/client/sysinfo/Cargo.toml + index c09fa41d4d..4c2b0eae16 100644 + --- substrate/client/sysinfo/Cargo.toml + +++ substrate/client/sysinfo/Cargo.toml + @@ -22 +22 @@ libc = "0.2" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/telemetry/Cargo.toml substrate/client/telemetry/Cargo.toml + index 3270a2e148..e0563c44bc 100644 + --- substrate/client/telemetry/Cargo.toml + +++ substrate/client/telemetry/Cargo.toml + @@ -23 +23 @@ libp2p = { version = "0.51.4", features = ["dns", "tcp", "tokio", "wasm-ext", "w + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/tracing/Cargo.toml substrate/client/tracing/Cargo.toml + index 9f0f5fb693..1331071d3b 100644 + --- substrate/client/tracing/Cargo.toml + +++ substrate/client/tracing/Cargo.toml + @@ -25 +25 @@ libc = "0.2.152" + -log = { version = "0.4.17" } + +log = { workspace = true, default-features = true } + diff --git substrate/client/transaction-pool/Cargo.toml substrate/client/transaction-pool/Cargo.toml + index b491f7bcaf..23ffebec67 100644 + --- substrate/client/transaction-pool/Cargo.toml + +++ substrate/client/transaction-pool/Cargo.toml + @@ -24 +24 @@ linked-hash-map = "0.5.4" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/transaction-pool/api/Cargo.toml substrate/client/transaction-pool/api/Cargo.toml + index f5fba65a06..9cf732cb87 100644 + --- substrate/client/transaction-pool/api/Cargo.toml + +++ substrate/client/transaction-pool/api/Cargo.toml + @@ -18 +18 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/client/utils/Cargo.toml substrate/client/utils/Cargo.toml + index ec7b3d0eb0..7f604219bc 100644 + --- substrate/client/utils/Cargo.toml + +++ substrate/client/utils/Cargo.toml + @@ -20 +20 @@ lazy_static = "1.4.0" + -log = "0.4" + +log = { workspace = true, default-features = true } + diff --git substrate/frame/Cargo.toml substrate/frame/Cargo.toml + index 9419eb1597..01c1358ecb 100644 + --- substrate/frame/Cargo.toml + +++ substrate/frame/Cargo.toml + @@ -52 +52 @@ simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev + -log = { version = "0.4.20", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/alliance/Cargo.toml substrate/frame/alliance/Cargo.toml + index 955f9e268c..bc873ad69c 100644 + --- substrate/frame/alliance/Cargo.toml + +++ substrate/frame/alliance/Cargo.toml + @@ -20 +20 @@ array-bytes = { version = "6.1", optional = true } + -log = { version = "0.4.14", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/assets/Cargo.toml substrate/frame/assets/Cargo.toml + index 6fe3a27236..2efc96348c 100644 + --- substrate/frame/assets/Cargo.toml + +++ substrate/frame/assets/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/aura/Cargo.toml substrate/frame/aura/Cargo.toml + index 7620d172ff..de698487ef 100644 + --- substrate/frame/aura/Cargo.toml + +++ substrate/frame/aura/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/babe/Cargo.toml substrate/frame/babe/Cargo.toml + index 8f49faaa2d..fc7385efa1 100644 + --- substrate/frame/babe/Cargo.toml + +++ substrate/frame/babe/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/bags-list/Cargo.toml substrate/frame/bags-list/Cargo.toml + index b8ab099a06..f9ae462e16 100644 + --- substrate/frame/bags-list/Cargo.toml + +++ substrate/frame/bags-list/Cargo.toml + @@ -36 +36 @@ frame-election-provider-support = { path = "../election-provider-support", defau + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/bags-list/remote-tests/Cargo.toml substrate/frame/bags-list/remote-tests/Cargo.toml + index fb61a98677..266355f5ca 100644 + --- substrate/frame/bags-list/remote-tests/Cargo.toml + +++ substrate/frame/bags-list/remote-tests/Cargo.toml + @@ -37 +37 @@ remote-externalities = { package = "frame-remote-externalities", path = "../../. + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/frame/balances/Cargo.toml substrate/frame/balances/Cargo.toml + index e47e916a27..64ae90c675 100644 + --- substrate/frame/balances/Cargo.toml + +++ substrate/frame/balances/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/beefy-mmr/Cargo.toml substrate/frame/beefy-mmr/Cargo.toml + index 250a6fb450..b2ede900f2 100644 + --- substrate/frame/beefy-mmr/Cargo.toml + +++ substrate/frame/beefy-mmr/Cargo.toml + @@ -17 +17 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/beefy/Cargo.toml substrate/frame/beefy/Cargo.toml + index ba02cf1460..54b57b4474 100644 + --- substrate/frame/beefy/Cargo.toml + +++ substrate/frame/beefy/Cargo.toml + @@ -16 +16 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/benchmarking/Cargo.toml substrate/frame/benchmarking/Cargo.toml + index 38c7bc2b90..cde1aea188 100644 + --- substrate/frame/benchmarking/Cargo.toml + +++ substrate/frame/benchmarking/Cargo.toml + @@ -21 +21 @@ linregress = { version = "0.5.1", optional = true } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/bounties/Cargo.toml substrate/frame/bounties/Cargo.toml + index df7c3c0cbe..191a38d20b 100644 + --- substrate/frame/bounties/Cargo.toml + +++ substrate/frame/bounties/Cargo.toml + @@ -22 +22 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/child-bounties/Cargo.toml substrate/frame/child-bounties/Cargo.toml + index bcd8426c31..589ca95a75 100644 + --- substrate/frame/child-bounties/Cargo.toml + +++ substrate/frame/child-bounties/Cargo.toml + @@ -22 +22 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/collective/Cargo.toml substrate/frame/collective/Cargo.toml + index 91bb36bb89..e19e1496e7 100644 + --- substrate/frame/collective/Cargo.toml + +++ substrate/frame/collective/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/contracts/Cargo.toml substrate/frame/contracts/Cargo.toml + index de49983a4b..0b127a5a45 100644 + --- substrate/frame/contracts/Cargo.toml + +++ substrate/frame/contracts/Cargo.toml + @@ -27 +27 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive + -log = { version = "0.4", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/core-fellowship/Cargo.toml substrate/frame/core-fellowship/Cargo.toml + index 8e59725d31..3e678d3274 100644 + --- substrate/frame/core-fellowship/Cargo.toml + +++ substrate/frame/core-fellowship/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.16", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/democracy/Cargo.toml substrate/frame/democracy/Cargo.toml + index 0ade0d58a6..1e824eac2d 100644 + --- substrate/frame/democracy/Cargo.toml + +++ substrate/frame/democracy/Cargo.toml + @@ -31 +31 @@ sp-core = { path = "../../primitives/core", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/election-provider-multi-phase/Cargo.toml substrate/frame/election-provider-multi-phase/Cargo.toml + index 91bdb3c027..eadce8c1ff 100644 + --- substrate/frame/election-provider-multi-phase/Cargo.toml + +++ substrate/frame/election-provider-multi-phase/Cargo.toml + @@ -24 +24 @@ scale-info = { version = "2.10.0", default-features = false, features = [ + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/election-provider-multi-phase/test-staking-e2e/Cargo.toml substrate/frame/election-provider-multi-phase/test-staking-e2e/Cargo.toml + index 05c6a6d404..540f4c4423 100644 + --- substrate/frame/election-provider-multi-phase/test-staking-e2e/Cargo.toml + +++ substrate/frame/election-provider-multi-phase/test-staking-e2e/Cargo.toml + @@ -22 +22 @@ scale-info = { version = "2.10.0", features = ["derive"] } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/elections-phragmen/Cargo.toml substrate/frame/elections-phragmen/Cargo.toml + index 4f8c5638d4..4dc4a3454a 100644 + --- substrate/frame/elections-phragmen/Cargo.toml + +++ substrate/frame/elections-phragmen/Cargo.toml + @@ -22 +22 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.14", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/examples/basic/Cargo.toml substrate/frame/examples/basic/Cargo.toml + index 2be5aecb96..e4ab511220 100644 + --- substrate/frame/examples/basic/Cargo.toml + +++ substrate/frame/examples/basic/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/examples/default-config/Cargo.toml substrate/frame/examples/default-config/Cargo.toml + index 83d9ae7951..e40845a425 100644 + --- substrate/frame/examples/default-config/Cargo.toml + +++ substrate/frame/examples/default-config/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/examples/dev-mode/Cargo.toml substrate/frame/examples/dev-mode/Cargo.toml + index f150f44644..a9c4e3f3b1 100644 + --- substrate/frame/examples/dev-mode/Cargo.toml + +++ substrate/frame/examples/dev-mode/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/examples/kitchensink/Cargo.toml substrate/frame/examples/kitchensink/Cargo.toml + index 4255ebb66b..0aa14cc502 100644 + --- substrate/frame/examples/kitchensink/Cargo.toml + +++ substrate/frame/examples/kitchensink/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/examples/offchain-worker/Cargo.toml substrate/frame/examples/offchain-worker/Cargo.toml + index cc337707a2..fc5151ff29 100644 + --- substrate/frame/examples/offchain-worker/Cargo.toml + +++ substrate/frame/examples/offchain-worker/Cargo.toml + @@ -21 +21 @@ lite-json = { version = "0.2.0", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/examples/split/Cargo.toml substrate/frame/examples/split/Cargo.toml + index 733ca92b82..d140fc3eef 100644 + --- substrate/frame/examples/split/Cargo.toml + +++ substrate/frame/examples/split/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.2.2", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/examples/tasks/Cargo.toml substrate/frame/examples/tasks/Cargo.toml + index f6850b53c0..4152111436 100644 + --- substrate/frame/examples/tasks/Cargo.toml + +++ substrate/frame/examples/tasks/Cargo.toml + @@ -18 +18 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/executive/Cargo.toml substrate/frame/executive/Cargo.toml + index 7c72fc77be..a4ca265f61 100644 + --- substrate/frame/executive/Cargo.toml + +++ substrate/frame/executive/Cargo.toml + @@ -22 +22 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/fast-unstake/Cargo.toml substrate/frame/fast-unstake/Cargo.toml + index 5d0a5410f8..eca8247845 100644 + --- substrate/frame/fast-unstake/Cargo.toml + +++ substrate/frame/fast-unstake/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/glutton/Cargo.toml substrate/frame/glutton/Cargo.toml + index b9543e7f47..7de18080b8 100644 + --- substrate/frame/glutton/Cargo.toml + +++ substrate/frame/glutton/Cargo.toml + @@ -22 +22 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive + -log = { version = "0.4.14", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/grandpa/Cargo.toml substrate/frame/grandpa/Cargo.toml + index 3775ccdac1..db540564fb 100644 + --- substrate/frame/grandpa/Cargo.toml + +++ substrate/frame/grandpa/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/identity/Cargo.toml substrate/frame/identity/Cargo.toml + index ba1fd500f7..912444bf60 100644 + --- substrate/frame/identity/Cargo.toml + +++ substrate/frame/identity/Cargo.toml + @@ -21 +21 @@ enumflags2 = { version = "0.7.7" } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/im-online/Cargo.toml substrate/frame/im-online/Cargo.toml + index 04c35908c5..038cbbcd67 100644 + --- substrate/frame/im-online/Cargo.toml + +++ substrate/frame/im-online/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/membership/Cargo.toml substrate/frame/membership/Cargo.toml + index 658bf67f12..6421467029 100644 + --- substrate/frame/membership/Cargo.toml + +++ substrate/frame/membership/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/merkle-mountain-range/Cargo.toml substrate/frame/merkle-mountain-range/Cargo.toml + index 607fa340e9..d623e25cec 100644 + --- substrate/frame/merkle-mountain-range/Cargo.toml + +++ substrate/frame/merkle-mountain-range/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/message-queue/Cargo.toml substrate/frame/message-queue/Cargo.toml + index c2ecf44526..8f3e913ee3 100644 + --- substrate/frame/message-queue/Cargo.toml + +++ substrate/frame/message-queue/Cargo.toml + @@ -18 +18 @@ serde = { version = "1.0.195", optional = true, features = ["derive"] } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/mixnet/Cargo.toml substrate/frame/mixnet/Cargo.toml + index cb00b38890..de4c2074e7 100644 + --- substrate/frame/mixnet/Cargo.toml + +++ substrate/frame/mixnet/Cargo.toml + @@ -23 +23 @@ frame-system = { default-features = false, path = "../system" } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/multisig/Cargo.toml substrate/frame/multisig/Cargo.toml + index aefdbe855a..1d2a79bdc5 100644 + --- substrate/frame/multisig/Cargo.toml + +++ substrate/frame/multisig/Cargo.toml + @@ -29 +29 @@ sp-std = { path = "../../primitives/std", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/nft-fractionalization/Cargo.toml substrate/frame/nft-fractionalization/Cargo.toml + index a55bcab533..8002b7e116 100644 + --- substrate/frame/nft-fractionalization/Cargo.toml + +++ substrate/frame/nft-fractionalization/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/nfts/Cargo.toml substrate/frame/nfts/Cargo.toml + index d92a9c0b44..69e9ea170b 100644 + --- substrate/frame/nfts/Cargo.toml + +++ substrate/frame/nfts/Cargo.toml + @@ -21 +21 @@ enumflags2 = { version = "0.7.7" } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/node-authorization/Cargo.toml substrate/frame/node-authorization/Cargo.toml + index ac139853cd..a39b0ec4ef 100644 + --- substrate/frame/node-authorization/Cargo.toml + +++ substrate/frame/node-authorization/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/nomination-pools/Cargo.toml substrate/frame/nomination-pools/Cargo.toml + index cac092c98d..9830f31d5f 100644 + --- substrate/frame/nomination-pools/Cargo.toml + +++ substrate/frame/nomination-pools/Cargo.toml + @@ -34 +34 @@ sp-io = { path = "../../primitives/io", default-features = false } + -log = { version = "0.4.0", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/nomination-pools/fuzzer/Cargo.toml substrate/frame/nomination-pools/fuzzer/Cargo.toml + index 52f49b2845..c0d63a2685 100644 + --- substrate/frame/nomination-pools/fuzzer/Cargo.toml + +++ substrate/frame/nomination-pools/fuzzer/Cargo.toml + @@ -32 +32 @@ rand = { version = "0.8.5", features = ["small_rng"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/frame/nomination-pools/test-staking/Cargo.toml substrate/frame/nomination-pools/test-staking/Cargo.toml + index 845535ae04..9c7b12e4c6 100644 + --- substrate/frame/nomination-pools/test-staking/Cargo.toml + +++ substrate/frame/nomination-pools/test-staking/Cargo.toml + @@ -40 +40 @@ sp-tracing = { path = "../../../primitives/tracing" } + -log = { version = "0.4.0" } + +log = { workspace = true, default-features = true } + diff --git substrate/frame/offences/Cargo.toml substrate/frame/offences/Cargo.toml + index 73842c696a..e7f559086a 100644 + --- substrate/frame/offences/Cargo.toml + +++ substrate/frame/offences/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/offences/benchmarking/Cargo.toml substrate/frame/offences/benchmarking/Cargo.toml + index fc3fb076f1..8dcce84d25 100644 + --- substrate/frame/offences/benchmarking/Cargo.toml + +++ substrate/frame/offences/benchmarking/Cargo.toml + @@ -35 +35 @@ sp-std = { path = "../../../primitives/std", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/preimage/Cargo.toml substrate/frame/preimage/Cargo.toml + index 5951663d29..10a15f97bd 100644 + --- substrate/frame/preimage/Cargo.toml + +++ substrate/frame/preimage/Cargo.toml + @@ -24 +24 @@ sp-std = { path = "../../primitives/std", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/ranked-collective/Cargo.toml substrate/frame/ranked-collective/Cargo.toml + index 62e01df372..54e84c0b55 100644 + --- substrate/frame/ranked-collective/Cargo.toml + +++ substrate/frame/ranked-collective/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.16", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/referenda/Cargo.toml substrate/frame/referenda/Cargo.toml + index 0f8a92ff72..ad0e5993fc 100644 + --- substrate/frame/referenda/Cargo.toml + +++ substrate/frame/referenda/Cargo.toml + @@ -32 +32 @@ sp-std = { path = "../../primitives/std", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/salary/Cargo.toml substrate/frame/salary/Cargo.toml + index 90a44da1a1..ba57fd46ee 100644 + --- substrate/frame/salary/Cargo.toml + +++ substrate/frame/salary/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.16", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/sassafras/Cargo.toml substrate/frame/sassafras/Cargo.toml + index 5f4900b5a2..325a39bf59 100644 + --- substrate/frame/sassafras/Cargo.toml + +++ substrate/frame/sassafras/Cargo.toml + @@ -25 +25 @@ frame-system = { path = "../system", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/scheduler/Cargo.toml substrate/frame/scheduler/Cargo.toml + index bca17242d2..f50f6afdc0 100644 + --- substrate/frame/scheduler/Cargo.toml + +++ substrate/frame/scheduler/Cargo.toml + @@ -17 +17 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/session/Cargo.toml substrate/frame/session/Cargo.toml + index 91ffecbf71..de041307f7 100644 + --- substrate/frame/session/Cargo.toml + +++ substrate/frame/session/Cargo.toml + @@ -21 +21 @@ impl-trait-for-tuples = "0.2.2" + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/society/Cargo.toml substrate/frame/society/Cargo.toml + index 8b24f637f4..3dab082b39 100644 + --- substrate/frame/society/Cargo.toml + +++ substrate/frame/society/Cargo.toml + @@ -19 +19 @@ targets = ["x86_64-unknown-linux-gnu"] + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/staking/Cargo.toml substrate/frame/staking/Cargo.toml + index 2c3f50beae..5f82a32614 100644 + --- substrate/frame/staking/Cargo.toml + +++ substrate/frame/staking/Cargo.toml + @@ -36 +36 @@ frame-election-provider-support = { path = "../election-provider-support", defau + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/staking/reward-fn/Cargo.toml substrate/frame/staking/reward-fn/Cargo.toml + index 0b8903f287..5169db5072 100644 + --- substrate/frame/staking/reward-fn/Cargo.toml + +++ substrate/frame/staking/reward-fn/Cargo.toml + @@ -20 +20 @@ targets = ["x86_64-unknown-linux-gnu"] + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/state-trie-migration/Cargo.toml substrate/frame/state-trie-migration/Cargo.toml + index 1fb49e6256..83abf3615f 100644 + --- substrate/frame/state-trie-migration/Cargo.toml + +++ substrate/frame/state-trie-migration/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/statement/Cargo.toml substrate/frame/statement/Cargo.toml + index 58f8b40dc2..6827dbda96 100644 + --- substrate/frame/statement/Cargo.toml + +++ substrate/frame/statement/Cargo.toml + @@ -28 +28 @@ sp-core = { path = "../../primitives/core", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } diff --git substrate/frame/support/Cargo.toml substrate/frame/support/Cargo.toml - index 5caf993bb3..d98bcf54a7 100644 + index ad97ad5146..fd39e8397d 100644 --- substrate/frame/support/Cargo.toml +++ substrate/frame/support/Cargo.toml - @@ -32 +32 @@ sp-metadata-ir = { path = "../../primitives/metadata-ir", default-features = fal - -tt-call = "1.0.8" - +tt-call = { workspace = true } + @@ -44 +44 @@ smallvec = "1.11.0" + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/system/Cargo.toml substrate/frame/system/Cargo.toml + index d409460131..d25746dcde 100644 + --- substrate/frame/system/Cargo.toml + +++ substrate/frame/system/Cargo.toml + @@ -21 +21 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/timestamp/Cargo.toml substrate/frame/timestamp/Cargo.toml + index cd0737c6bb..28e57fcab0 100644 + --- substrate/frame/timestamp/Cargo.toml + +++ substrate/frame/timestamp/Cargo.toml + @@ -21 +21 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/tips/Cargo.toml substrate/frame/tips/Cargo.toml + index 900cd47e0d..65931bf2d5 100644 + --- substrate/frame/tips/Cargo.toml + +++ substrate/frame/tips/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/transaction-storage/Cargo.toml substrate/frame/transaction-storage/Cargo.toml + index c96aa91d54..8ae77cae79 100644 + --- substrate/frame/transaction-storage/Cargo.toml + +++ substrate/frame/transaction-storage/Cargo.toml + @@ -32 +32 @@ sp-transaction-storage-proof = { path = "../../primitives/transaction-storage-pr + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/uniques/Cargo.toml substrate/frame/uniques/Cargo.toml + index 8a5a180d75..4e5f21b3d8 100644 + --- substrate/frame/uniques/Cargo.toml + +++ substrate/frame/uniques/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/frame/vesting/Cargo.toml substrate/frame/vesting/Cargo.toml + index f81b7a122c..96938b95a2 100644 + --- substrate/frame/vesting/Cargo.toml + +++ substrate/frame/vesting/Cargo.toml + @@ -22 +22 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/primitives/api/Cargo.toml substrate/primitives/api/Cargo.toml + index cd882c7a05..3330d2a88d 100644 + --- substrate/primitives/api/Cargo.toml + +++ substrate/primitives/api/Cargo.toml + @@ -35 +35 @@ sp-metadata-ir = { path = "../metadata-ir", default-features = false, optional = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/primitives/api/test/Cargo.toml substrate/primitives/api/test/Cargo.toml + index b0975082c4..3a90553bbf 100644 + --- substrate/primitives/api/test/Cargo.toml + +++ substrate/primitives/api/test/Cargo.toml + @@ -34 +34 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/primitives/blockchain/Cargo.toml substrate/primitives/blockchain/Cargo.toml + index 176e9ed6dd..26ba41645e 100644 + --- substrate/primitives/blockchain/Cargo.toml + +++ substrate/primitives/blockchain/Cargo.toml + @@ -22 +22 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/primitives/consensus/common/Cargo.toml substrate/primitives/consensus/common/Cargo.toml + index 00c2fca5e2..cbca0d94d3 100644 + --- substrate/primitives/consensus/common/Cargo.toml + +++ substrate/primitives/consensus/common/Cargo.toml + @@ -22 +22 @@ futures = { version = "0.3.21", features = ["thread-pool"] } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/primitives/consensus/grandpa/Cargo.toml substrate/primitives/consensus/grandpa/Cargo.toml + index de02b18907..1398cb9356 100644 + --- substrate/primitives/consensus/grandpa/Cargo.toml + +++ substrate/primitives/consensus/grandpa/Cargo.toml + @@ -22 +22 @@ grandpa = { package = "finality-grandpa", version = "0.16.2", default-features = + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/primitives/core/Cargo.toml substrate/primitives/core/Cargo.toml + index f5914049f4..25c6925335 100644 + --- substrate/primitives/core/Cargo.toml + +++ substrate/primitives/core/Cargo.toml + @@ -21 +21 @@ scale-info = { version = "2.5.0", default-features = false, features = ["derive" + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/primitives/io/Cargo.toml substrate/primitives/io/Cargo.toml + index d2d56b8315..ab326c0925 100644 + --- substrate/primitives/io/Cargo.toml + +++ substrate/primitives/io/Cargo.toml + @@ -33 +33 @@ sp-tracing = { path = "../tracing", default-features = false } + -log = { version = "0.4.17", optional = true } + +log = { optional = true , workspace = true, default-features = true } + diff --git substrate/primitives/merkle-mountain-range/Cargo.toml substrate/primitives/merkle-mountain-range/Cargo.toml + index 59b48b1b83..b82fb61ef4 100644 + --- substrate/primitives/merkle-mountain-range/Cargo.toml + +++ substrate/primitives/merkle-mountain-range/Cargo.toml + @@ -20 +20 @@ scale-info = { version = "2.10.0", default-features = false, features = ["derive + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/primitives/runtime/Cargo.toml substrate/primitives/runtime/Cargo.toml + index f4b1158242..940fca54ab 100644 + --- substrate/primitives/runtime/Cargo.toml + +++ substrate/primitives/runtime/Cargo.toml + @@ -24 +24 @@ impl-trait-for-tuples = "0.2.2" + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/primitives/state-machine/Cargo.toml substrate/primitives/state-machine/Cargo.toml + index b63d5685a3..489209ecc3 100644 + --- substrate/primitives/state-machine/Cargo.toml + +++ substrate/primitives/state-machine/Cargo.toml + @@ -22 +22 @@ hash-db = { version = "0.16.0", default-features = false } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/primitives/wasm-interface/Cargo.toml substrate/primitives/wasm-interface/Cargo.toml + index ccd2a3043c..bb5afaf9a0 100644 + --- substrate/primitives/wasm-interface/Cargo.toml + +++ substrate/primitives/wasm-interface/Cargo.toml + @@ -22 +22 @@ impl-trait-for-tuples = "0.2.2" + -log = { version = "0.4.17", optional = true } + +log = { optional = true , workspace = true, default-features = true } + diff --git substrate/test-utils/runtime/Cargo.toml substrate/test-utils/runtime/Cargo.toml + index 589686c122..cdc94782ec 100644 + --- substrate/test-utils/runtime/Cargo.toml + +++ substrate/test-utils/runtime/Cargo.toml + @@ -54 +54 @@ array-bytes = { version = "6.1", optional = true } + -log = { version = "0.4.17", default-features = false } + +log = { workspace = true } + diff --git substrate/utils/binary-merkle-tree/Cargo.toml substrate/utils/binary-merkle-tree/Cargo.toml + index b0b870823f..6b8c78fedf 100644 + --- substrate/utils/binary-merkle-tree/Cargo.toml + +++ substrate/utils/binary-merkle-tree/Cargo.toml + @@ -16 +16 @@ array-bytes = { version = "6.1", optional = true } + -log = { version = "0.4", default-features = false, optional = true } + +log = { optional = true , workspace = true } + diff --git substrate/utils/frame/benchmarking-cli/Cargo.toml substrate/utils/frame/benchmarking-cli/Cargo.toml + index 0314e3035c..2af8e055cf 100644 + --- substrate/utils/frame/benchmarking-cli/Cargo.toml + +++ substrate/utils/frame/benchmarking-cli/Cargo.toml + @@ -29 +29 @@ linked-hash-map = "0.5.4" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/utils/frame/remote-externalities/Cargo.toml substrate/utils/frame/remote-externalities/Cargo.toml + index ff0b7572d3..0fee718d83 100644 + --- substrate/utils/frame/remote-externalities/Cargo.toml + +++ substrate/utils/frame/remote-externalities/Cargo.toml + @@ -20 +20 @@ codec = { package = "parity-scale-codec", version = "3.6.1" } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/utils/frame/rpc/client/Cargo.toml substrate/utils/frame/rpc/client/Cargo.toml + index a97bc77b00..d1959fe945 100644 + --- substrate/utils/frame/rpc/client/Cargo.toml + +++ substrate/utils/frame/rpc/client/Cargo.toml + @@ -23 +23 @@ sp-runtime = { path = "../../../../primitives/runtime" } + -log = "0.4" + +log = { workspace = true, default-features = true } + diff --git substrate/utils/frame/rpc/system/Cargo.toml substrate/utils/frame/rpc/system/Cargo.toml + index 3f06ffe2bc..8097a4bf3d 100644 + --- substrate/utils/frame/rpc/system/Cargo.toml + +++ substrate/utils/frame/rpc/system/Cargo.toml + @@ -22 +22 @@ futures = "0.3.21" + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/utils/frame/try-runtime/cli/Cargo.toml substrate/utils/frame/try-runtime/cli/Cargo.toml + index 1550a2cec4..1c8484f9a8 100644 + --- substrate/utils/frame/try-runtime/cli/Cargo.toml + +++ substrate/utils/frame/try-runtime/cli/Cargo.toml + @@ -43 +43 @@ hex = { version = "0.4.3", default-features = false } + -log = "0.4.17" + +log = { workspace = true, default-features = true } + diff --git substrate/utils/prometheus/Cargo.toml substrate/utils/prometheus/Cargo.toml + index 5ce943fbc5..2a09cb2bb5 100644 + --- substrate/utils/prometheus/Cargo.toml + +++ substrate/utils/prometheus/Cargo.toml + @@ -20 +20 @@ hyper = { version = "0.14.16", default-features = false, features = ["http1", "s + -log = "0.4.17" + +log = { workspace = true, default-features = true } diff --git a/tests/ui/config/v1/basic.yaml b/tests/ui/config/v1/basic.yaml index 98f2445..27d8b71 100644 --- a/tests/ui/config/v1/basic.yaml +++ b/tests/ui/config/v1/basic.yaml @@ -3,25 +3,25 @@ crates: cases: - cmd: run default stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: '' stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run my_version stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'my_version' [INFO] 1/1 --version @@ -38,7 +38,7 @@ cases: [INFO] 1/1 debug --no-benchmark - cmd: run both stdout: |+ - zepter 1.0.2 + zepter 1.1.0 Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 diff --git a/tests/ui/config/v1/finds_all.yaml b/tests/ui/config/v1/finds_all.yaml index 18aa925..25000f5 100644 --- a/tests/ui/config/v1/finds_all.yaml +++ b/tests/ui/config/v1/finds_all.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: '' stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -19,7 +19,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -35,7 +35,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -51,7 +51,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -67,7 +67,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -83,7 +83,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -99,7 +99,7 @@ cases: - [ '--version' ] - cmd: run default --config .cargo/polkadot.yaml stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -115,7 +115,7 @@ cases: - [ '--version' ] - cmd: run default -c .cargo/polkadot.yaml stdout: | - zepter 1.0.2 + zepter 1.1.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version diff --git a/tests/ui/config/v1/version_bin.yaml b/tests/ui/config/v1/version_bin.yaml index 02b5c36..5723865 100644 --- a/tests/ui/config/v1/version_bin.yaml +++ b/tests/ui/config/v1/version_bin.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: run default stderr: | - thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.0.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 + thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 - cmd: run default --check-cfg-compatibility=off @@ -11,7 +11,7 @@ cases: Error: Command '' failed with exit code 101 stderr: | [INFO] Running workflow 'default' - thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.0.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 + thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 1 configs: diff --git a/tests/ui/root-args/version.yaml b/tests/ui/root-args/version.yaml index 0047b51..22a936b 100644 --- a/tests/ui/root-args/version.yaml +++ b/tests/ui/root-args/version.yaml @@ -2,7 +2,7 @@ crates: [] cases: - cmd: --version stdout: | - zepter 1.0.2 + zepter 1.1.0 - cmd: -V stdout: | - zepter 1.0.2 + zepter 1.1.0 From 656a0d9e842644665665c85ffc6ddca5486f6b6b Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Sun, 11 Feb 2024 00:15:46 +0100 Subject: [PATCH 05/13] Version 1.1.1 (#78) * Fix sorting Signed-off-by: Oliver Tale-Yazdi * Update to 1.74 Signed-off-by: Oliver Tale-Yazdi * Update deps Signed-off-by: Oliver Tale-Yazdi * Bump more deps Signed-off-by: Oliver Tale-Yazdi * Adapt to breaking changes Signed-off-by: Oliver Tale-Yazdi * Make msrv check work Signed-off-by: Oliver Tale-Yazdi * Fixes Signed-off-by: Oliver Tale-Yazdi * Remove serde_json and cleanup Signed-off-by: Oliver Tale-Yazdi * Fixes Signed-off-by: Oliver Tale-Yazdi * Bump nightly to 1.76 Signed-off-by: Oliver Tale-Yazdi * fmg Signed-off-by: Oliver Tale-Yazdi * Clippy Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- .github/workflows/msrv.yml | 2 +- Cargo.lock | 341 ++++++++++----------- Cargo.toml | 26 +- README.md | 2 +- rust-toolchain.toml | 2 +- src/autofix.rs | 1 - src/cmd/debug.rs | 13 +- src/cmd/lint.rs | 63 ++-- src/cmd/mod.rs | 44 +-- src/cmd/transpose.rs | 12 +- src/config/mod.rs | 26 +- src/lib.rs | 11 + src/main.rs | 32 +- tests/integration/polkadot/issue-7261.yaml | 2 +- tests/integration/sdk/propagate.yaml | 6 +- tests/integration/sdk/transpose.yaml | 12 +- tests/integration/substrate/master-1.yaml | 98 +++--- tests/integration/substrate/master.yaml | 94 +++--- tests/ui/config/v1/basic.yaml | 18 +- tests/ui/config/v1/finds_all.yaml | 16 +- tests/ui/config/v1/version_bin.yaml | 6 +- tests/ui/config/v1/version_file.yaml | 3 +- tests/ui/fmt/help.yaml | 2 +- tests/ui/lint/never-enables/simple.yaml | 2 - tests/ui/root-args/help.yaml | 2 +- tests/ui/root-args/version.yaml | 4 +- 26 files changed, 413 insertions(+), 427 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index 1240d40..d39704c 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -25,4 +25,4 @@ jobs: - name: Install MSRV run: cargo install cargo-msrv --locked -q - name: Verify MSRV - run: cargo msrv verify + run: cargo msrv verify -- cargo install --locked --path . diff --git a/Cargo.lock b/Cargo.lock index bee260f..6742842 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.7" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -33,36 +33,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -100,15 +100,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bstr" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "regex-automata", @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -167,9 +167,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -178,15 +178,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ "clap_builder", "clap_derive", @@ -204,9 +204,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ "anstream", "anstyle", @@ -216,9 +216,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -228,9 +228,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -285,36 +285,28 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" @@ -341,6 +333,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "diff" version = "0.1.13" @@ -361,21 +359,31 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "env_filter" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] [[package]] name = "env_logger" -version = "0.10.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] @@ -402,9 +410,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -417,9 +425,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -427,15 +435,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -444,15 +452,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -461,15 +469,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -479,9 +487,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -497,9 +505,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -514,15 +522,19 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "half" -version = "1.8.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -532,9 +544,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "histo" @@ -553,9 +565,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown", @@ -563,13 +575,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", - "windows-sys 0.48.0", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -583,33 +595,24 @@ dependencies = [ [[package]] name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -622,15 +625,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -650,24 +653,15 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", @@ -677,18 +671,18 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -767,13 +761,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "3.0.4" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" dependencies = [ "anstyle", "difflib", - "itertools 0.11.0", "predicates-core", ] @@ -805,9 +798,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -853,9 +846,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -863,9 +856,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -882,9 +875,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -894,9 +887,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -911,9 +904,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "relative-path" -version = "1.9.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "rstest" @@ -955,11 +948,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -968,9 +961,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -1081,9 +1074,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "streaming-stats" @@ -1096,9 +1089,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "syn" @@ -1113,26 +1106,16 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] -[[package]] -name = "termcolor" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" -dependencies = [ - "winapi-util", -] - [[package]] name = "termtree" version = "0.4.1" @@ -1141,18 +1124,18 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", @@ -1177,9 +1160,9 @@ checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" dependencies = [ "indexmap", "toml_datetime", @@ -1262,9 +1245,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1272,9 +1255,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -1287,9 +1270,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1297,9 +1280,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -1310,15 +1293,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -1489,9 +1472,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.18" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] @@ -1504,7 +1487,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zepter" -version = "1.1.0" +version = "1.1.1" dependencies = [ "anyhow", "assert_cmd", @@ -1515,7 +1498,7 @@ dependencies = [ "env_logger", "glob", "histo", - "itertools 0.12.0", + "itertools 0.12.1", "lazy_static", "log", "pretty_assertions", diff --git a/Cargo.toml b/Cargo.toml index 3a0678f..28145bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "zepter" -version = "1.1.0" +version = "1.1.1" edition = "2021" authors = [ "Oliver Tale-Yazdi" ] description = "Analyze, Fix and Format features in your Rust workspace." license = "GPL-3.0-only" repository = "https://github.com/ggwpez/zepter" # Update the README if you change this: -rust-version = "1.70" +rust-version = "1.74" [[bin]] name = "zepter" @@ -21,23 +21,22 @@ required-features = [ "benchmarking" ] anyhow = { version = "1.0.79", optional = true } assert_cmd = { version = "2.0.13", optional = true } cargo_metadata = "0.18.1" -clap = { version = "4.4.18", features = ["derive", "cargo"] } +clap = { version = "4.5.0", features = ["derive", "cargo"] } colour = { version = "0.7.0", optional = true } criterion = { version = "0.5", optional = true } -env_logger = { version = "0.10.2", features = [ "auto-color", "humantime" ], optional = true } -histo = "1.0.0" -itertools = "0.12.0" +env_logger = { version = "0.11.1", features = [ "auto-color", "humantime" ], optional = true } +histo = { version = "1.0.0", optional = true } +itertools = "0.12.1" log = { version = "0.4.20", optional = true } semver = "1" serde = "1.0.196" -serde_json = "1.0.113" +serde_json = { version = "1.0.113", optional = true } serde_yaml = "0.9.31" -tempfile = { version = "3.9.0", optional = true } -toml_edit = "0.21.0" +tempfile = { version = "3.10.0", optional = true } +toml_edit = "0.22.4" tracing = { version = "0.1.40", optional = true } [dev-dependencies] -anyhow = "1.0.79" glob = "0.3.1" lazy_static = "1.4.0" pretty_assertions = "1.4.0" @@ -48,11 +47,10 @@ zepter = { path = ".", features = ["testing"] } [features] default = [ "logging" ] - logging = [ "dep:env_logger", "dep:log" ] -benchmarking = [ "dep:criterion" ] - -testing = [ "dep:anyhow", "dep:assert_cmd", "dep:colour", "dep:tempfile" ] +benchmarking = [ "dep:criterion", "dep:serde_json" ] +testing = [ "dep:anyhow", "dep:assert_cmd", "dep:colour", "dep:tempfile", "dep:serde_json" ] +debugging = [ "dep:histo" ] [profile.dev] opt-level = 3 diff --git a/README.md b/README.md index 2a08380..7f43d2b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Rust](https://github.com/ggwpez/zepter/actions/workflows/rust.yml/badge.svg)](https://github.com/ggwpez/zepter/actions/workflows/rust.yml) [![crates.io](https://img.shields.io/crates/v/zepter.svg)](https://crates.io/crates/zepter) -![MSRV](https://img.shields.io/badge/MSRV-1.70-informational) +![MSRV](https://img.shields.io/badge/MSRV-1.74-informational) [![docs.rs](https://img.shields.io/docsrs/zepter)](https://docs.rs/zepter/latest/zepter) Analyze, Fix and Format features in your Rust workspace. The goal of this tool is to have this CI ready to prevent common errors with Rust features. diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 0ccc416..15bfcc8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2023-07-24" +channel = "nightly-2024-01-10" components = [ "rustfmt", "clippy" ] profile = "minimal" diff --git a/src/autofix.rs b/src/autofix.rs index 9621cd4..f5d351e 100644 --- a/src/autofix.rs +++ b/src/autofix.rs @@ -466,7 +466,6 @@ impl AutoFixer { let dep = deps.get_mut(dname).unwrap(); Self::lift_some_dependency(dep, default_feats)?; - //deps.key_decor_mut(dname).unwrap().set_suffix(""); } Ok(()) } diff --git a/src/cmd/debug.rs b/src/cmd/debug.rs index 8178532..e94d1fa 100644 --- a/src/cmd/debug.rs +++ b/src/cmd/debug.rs @@ -1,11 +1,12 @@ // SPDX-License-Identifier: GPL-3.0-only // SPDX-FileCopyrightText: Oliver Tale-Yazdi -use super::{lint::CrateAndFeature, GlobalArgs}; -use crate::{cmd::lint::build_feature_dag, prelude::Dag}; +use super::GlobalArgs; +use crate::cmd::lint::build_feature_dag; +#[cfg(feature = "debugging")] +use crate::{cmd::lint::CrateAndFeature, prelude::Dag}; use cargo_metadata::Metadata; -use histo::Histogram; use std::time::{Duration, Instant}; #[derive(Debug, clap::Parser)] @@ -33,15 +34,19 @@ impl DebugCmd { println!("Num workspace members: {}", meta.workspace_members.len()); println!("Num dependencies: {}", meta.packages.len()); println!("DAG nodes: {}, links: {}", dag.num_nodes(), dag.num_edges()); + + #[cfg(feature = "debugging")] self.connectivity_buckets(&dag); + if !self.no_benchmark { let (took, points) = Self::measure(&meta); println!("DAG setup time: {:.2?} (avg from {} runs)", took, points); } } + #[cfg(feature = "debugging")] pub fn connectivity_buckets(&self, dag: &Dag) { - let mut histogram = Histogram::with_buckets(10); + let mut histogram = histo::Histogram::with_buckets(10); for node in dag.lhs_nodes() { histogram.add(dag.degree(node) as u64); diff --git a/src/cmd/lint.rs b/src/cmd/lint.rs index a61269b..ca26056 100644 --- a/src/cmd/lint.rs +++ b/src/cmd/lint.rs @@ -253,13 +253,25 @@ impl core::str::FromStr for IgnoreSetting { } impl LintCmd { - pub(crate) fn run(&self, global: &GlobalArgs) { + pub(crate) fn run(&self, global: &GlobalArgs) -> Result<(), String> { match &self.subcommand { SubCommand::PropagateFeature(cmd) => cmd.run(global), - SubCommand::NeverEnables(cmd) => cmd.run(global), - SubCommand::NeverImplies(cmd) => cmd.run(global), - SubCommand::WhyEnabled(cmd) => cmd.run(global), - SubCommand::OnlyEnables(cmd) => cmd.run(global), + SubCommand::NeverEnables(cmd) => { + cmd.run(global); + Ok(()) + }, + SubCommand::NeverImplies(cmd) => { + cmd.run(global); + Ok(()) + }, + SubCommand::WhyEnabled(cmd) => { + cmd.run(global); + Ok(()) + }, + SubCommand::OnlyEnables(cmd) => { + cmd.run(global); + Ok(()) + }, } } } @@ -402,13 +414,15 @@ impl NeverEnablesCmd { } impl PropagateFeatureCmd { - pub fn run(&self, global: &GlobalArgs) { - let meta = self.cargo_args.load_metadata().expect("Loads metadata"); + pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { + let meta = self.cargo_args.load_metadata()?; let dag = build_feature_dag(&meta, &meta.packages); for feature in self.features.iter() { self.run_feature(&meta, &dag, feature.clone(), global); } + + Ok(()) } fn run_feature( @@ -516,17 +530,14 @@ impl PropagateFeatureCmd { propagate_missing.entry(pkg.id.to_string()).or_default().insert(dep); } } - let faulty_crates: BTreeSet = propagate_missing - .keys() - .chain(feature_missing.keys()) - //.chain(feature_maybe_unused.iter()) - .cloned() - .collect(); - - let (mut errors, warnings) = (0, 0); - let mut fixes = 0; - for krate in faulty_crates { - let krate = lookup(&krate); + let faulty_crates: BTreeSet = + propagate_missing.keys().chain(feature_missing.keys()).cloned().collect(); + let mut faulty_crates = + faulty_crates.into_iter().map(|id| (lookup(&id), id)).collect::>(); + faulty_crates.sort_by(|(a, _), (b, _)| a.name.cmp(&b.name)); + + let (mut errors, mut fixes) = (0, 0); + for (krate, _) in faulty_crates { let in_workspace = meta.workspace_members.iter().any(|m| m == &krate.id); // check if we can modify in allowed_dir let krate_path = canonicalize(krate.manifest_path.clone().into_std_path_buf()).unwrap(); @@ -556,13 +567,13 @@ impl PropagateFeatureCmd { println!("crate {krate_str}\n feature '{}'", feature); if let Some(deps) = feature_missing.get(&krate.id.to_string()) { - let joined = - deps.iter().map(|dep| dep.display_name()).collect::>().join("\n "); + let mut named = deps.iter().map(RenamedPackage::display_name).collect::>(); + named.sort(); println!( " is required by {} dependenc{}:\n {}", deps.len(), if deps.len() == 1 { "y" } else { "ies" }, - joined + named.join("\n "), ); if self.fixer_args.enable && @@ -581,14 +592,14 @@ impl PropagateFeatureCmd { } if let Some(deps) = propagate_missing.get(&krate.id.to_string()) { - let joined = - deps.iter().map(|dep| dep.display_name()).collect::>().join("\n "); - println!(" must propagate to:\n {joined}"); + let mut named = deps.iter().map(RenamedPackage::display_name).collect::>(); + named.sort(); + println!(" must propagate to:\n {}", named.join("\n ")); if self.fixer_args.enable && self.fix_package.as_ref().map_or(true, |p| p == &krate.name) { - for dep in deps { + for dep in deps.iter() { let dep_name = dep.name(); if !self.fix_dependency.as_ref().map_or(true, |d| d == &dep_name) { continue @@ -618,7 +629,7 @@ impl PropagateFeatureCmd { } } } - if let Some(e) = error_stats(errors, warnings, fixes, self.fixer_args.enable, global) { + if let Some(e) = error_stats(errors, 0, fixes, self.fixer_args.enable, global) { println!("{}", e); } diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 8d69836..2131fca 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -94,10 +94,7 @@ impl Command { cmd.run(&self.global); Ok(()) }, - Some(SubCommand::Lint(cmd)) => { - cmd.run(&self.global); - Ok(()) - }, + Some(SubCommand::Lint(cmd)) => cmd.run(&self.global), Some(SubCommand::Format(cmd)) => { cmd.run(&self.global); Ok(()) @@ -181,7 +178,7 @@ impl GlobalArgs { } /// Arguments for how to load cargo metadata from a workspace. -#[derive(Debug, Clone, clap::Parser)] +#[derive(Debug, Clone, clap::Parser, PartialEq)] pub struct CargoArgs { /// Cargo manifest path or directory. /// @@ -205,18 +202,30 @@ pub struct CargoArgs { #[clap(long, global = true)] pub all_features: bool, - - #[clap(long = "debug-keep-meta")] - pub keep_meta: Option, } impl CargoArgs { + pub fn with_workspace(mut self, workspace: bool) -> Self { + self.workspace = workspace; + self + } + /// Load the metadata of the rust project. pub fn load_metadata(&self) -> Result { - self.load_metadata_unsorted() + let err = match self.load_metadata_unsorted() { + Ok(meta) => return Ok(meta), + Err(err) => err, + }; + + if check_for_locked_error(&err) { + Err("\nThe Cargo.lock file needs to be updated first since --locked is present.\n" + .to_string()) + } else { + Err(err) + } } - pub fn load_metadata_unsorted(&self) -> Result { + fn load_metadata_unsorted(&self) -> Result { let mut cmd = MetadataCommand::new(); if let Some(ref manifest_path) = self.manifest_path { @@ -240,17 +249,14 @@ impl CargoArgs { cmd.other_options(vec!["--locked".to_string()]); } - let meta = cmd.exec().map_err(|e| format!("Failed to load metadata: {e}"))?; - - if let Some(path) = &self.keep_meta { - std::fs::write(path, serde_json::to_string_pretty(&meta).unwrap()).unwrap(); - log::info!("Wrote metadata to {}", path.display()); - } - - Ok(meta) + cmd.exec().map_err(|e| format!("Failed to load metadata: {e}")) } } +fn check_for_locked_error(err: &str) -> bool { + err.contains("needs to be updated but --locked was passed to prevent this") +} + /// Resolve the dependency `dep` of `pkg` within the metadata. /// /// This checks whether the dependency is a workspace or external crate and resolves it accordingly. @@ -331,7 +337,7 @@ impl Ord for RenamedPackage { // Yikes... dafuq is this?! //bincode::serialize(self).unwrap().cmp(&bincode::serialize(other).unwrap()) - self.pkg.id.cmp(&other.pkg.id) + (&self.pkg.name, &self.pkg.id).cmp(&(&other.pkg.name, &other.pkg.id)) } } diff --git a/src/cmd/transpose.rs b/src/cmd/transpose.rs index c168410..9a82c7b 100644 --- a/src/cmd/transpose.rs +++ b/src/cmd/transpose.rs @@ -135,9 +135,7 @@ impl LiftToWorkspaceCmd { return Err("Cannot use --exact-version without --version-resolver=exact".to_string()) } - let mut args = self.cargo_args.clone(); - args.workspace = true; - let meta = args.load_metadata()?; + let meta = self.cargo_args.clone().with_workspace(true).load_metadata()?; log::debug!("Scanning workspace for '{}'", self.dependency); // version -> crate let mut by_version = HashMap::>::new(); @@ -240,7 +238,7 @@ impl LiftToWorkspaceCmd { fixer.add_workspace_dep(&dep, false)?; let mut modified = 0; - for (pkg, fixer) in fixers.values_mut() { + for (_pkg, fixer) in fixers.values_mut() { if !fixer.modified() { continue } @@ -249,7 +247,7 @@ impl LiftToWorkspaceCmd { if self.fix { fixer.save()?; } else { - log::debug!("Would modify {:?}", pkg.name); + log::debug!("Would modify {:?}", _pkg.name); } } if fixer.modified() { @@ -304,10 +302,8 @@ fn try_find_latest<'a, I: Iterator>(reqs: I) -> Result Result { if let Some(path) = &self.config { - let path = canonicalize(path).expect("Must canonicalize path"); + let path = canonicalize(path).err_to_str()?; if path.exists() { Ok(path) @@ -111,23 +111,21 @@ impl ConfigArgs { fn locate_workspace(&self) -> Result { let mut cmd = std::process::Command::new("cargo"); - cmd.arg("locate-project").args(["--workspace", "--offline", "--locked"]); + cmd.arg("locate-project").args([ + "--message-format", + "plain", + "--workspace", + "--offline", + "--locked", + ]); if let Some(path) = &self.manifest_path { cmd.arg("--manifest-path").arg(path); } - let output = cmd.output().expect("Failed to run `cargo locate-project`"); + let output = cmd.output().err_to_str()?; let path = output.stdout; - let path = - String::from_utf8(path).expect("Failed to parse output of `cargo locate-project`"); - let path: serde_json::Value = serde_json::from_str(&path).unwrap_or_else(|_| { - panic!( - "Failed to parse output of `cargo locate-project`: '{}'", - String::from_utf8_lossy(&output.stderr) - ) - }); - let path = path["root"].as_str().expect("Failed to parse output of `cargo locate-project`"); + let path = String::from_utf8(path).err_to_str()?; let path = PathBuf::from(path); - let root = path.parent().expect("Failed to get parent of workspace root"); + let root = path.parent().ok_or("Failed to find workspace root")?; Ok(root.into()) } diff --git a/src/lib.rs b/src/lib.rs index 4f0fdc7..8059ae8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -79,3 +79,14 @@ macro_rules! trace { } }; } + +/// Convert the error or a `Result` into a `String` error. +pub(crate) trait ErrToStr { + fn err_to_str(self) -> Result; +} + +impl ErrToStr for Result { + fn err_to_str(self) -> Result { + self.map_err(|e| format!("{}", e)) + } +} diff --git a/src/main.rs b/src/main.rs index 4741334..9b0ab7b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ use clap::Parser; use zepter::cmd::Command; -fn main() -> Result<(), String> { +fn main() -> Result<(), ()> { setup_logging(); // Need to remove this in case `cargo-zepter` is used: @@ -17,7 +17,7 @@ fn main() -> Result<(), String> { if let Err(err) = Command::parse_from(args).run() { eprintln!("{}", err); - Err("see log".into()) + Err(()) } else { Ok(()) } @@ -28,35 +28,17 @@ fn setup_logging() {} #[cfg(feature = "logging")] fn setup_logging() { - use env_logger::fmt::Color; use std::io::Write; env_logger::builder() .parse_env(env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "debug")) .format_timestamp(None) .format(|buf, record| { - let mut level_style = buf.style(); - level_style.set_bold(true); - - match record.level() { - log::Level::Error => { - level_style.set_color(Color::Red); - }, - log::Level::Warn => { - level_style.set_color(Color::Yellow); - }, - log::Level::Info => { - level_style.set_color(Color::White); - }, - log::Level::Debug => { - level_style.set_color(Color::Blue); - }, - log::Level::Trace => { - level_style.set_color(Color::Magenta); - }, - }; - - writeln!(buf, "[{}] {}", level_style.value(record.level()), record.args()) + let level_style = buf.default_level_style(record.level()).bold(); + let begin = level_style.render(); + let reset = level_style.render_reset(); + + writeln!(buf, "[{begin}{}{reset}] {}", record.level(), record.args()) }) .init(); } diff --git a/tests/integration/polkadot/issue-7261.yaml b/tests/integration/polkadot/issue-7261.yaml index 8cd65d9..04ded8e 100644 --- a/tests/integration/polkadot/issue-7261.yaml +++ b/tests/integration/polkadot/issue-7261.yaml @@ -7,8 +7,8 @@ cases: crate 'polkadot-test-runtime' feature 'std' must propagate to: - polkadot-runtime-parachains beefy-primitives (renamed from sp-consensus-beefy) + polkadot-runtime-parachains sp-mmr-primitives Found 3 issues and fixed 3 (all fixed). diff: "diff --git runtime/test-runtime/Cargo.toml runtime/test-runtime/Cargo.toml\nindex 6d38a0283d..97253325c5 100644\n--- runtime/test-runtime/Cargo.toml\n+++ runtime/test-runtime/Cargo.toml\n@@ -130,0 +131,3 @@ std = [\n+\t\"polkadot-runtime-parachains/std\",\n+\t\"beefy-primitives/std\",\n+\t\"sp-mmr-primitives/std\"\n" diff --git a/tests/integration/sdk/propagate.yaml b/tests/integration/sdk/propagate.yaml index 3bce609..4c99c70 100644 --- a/tests/integration/sdk/propagate.yaml +++ b/tests/integration/sdk/propagate.yaml @@ -750,8 +750,8 @@ cases: crate 'polkadot-node-metrics' feature 'runtime-benchmarks' must propagate to: - primitives (renamed from polkadot-primitives) polkadot-test-service + primitives (renamed from polkadot-primitives) sc-service crate 'polkadot-parachain' feature 'runtime-benchmarks' @@ -846,9 +846,9 @@ cases: pallet-timestamp pallet-vesting polkadot-parachain + polkadot-runtime-parachains primitives (renamed from polkadot-primitives) runtime-common (renamed from polkadot-runtime-common) - polkadot-runtime-parachains sp-runtime sp-staking xcm-executor @@ -905,9 +905,9 @@ cases: pallet-salary pallet-xcm polkadot-parachain - primitives (renamed from polkadot-primitives) polkadot-runtime-parachains polkadot-test-runtime + primitives (renamed from polkadot-primitives) sp-runtime crate 'xcm-executor' feature 'runtime-benchmarks' diff --git a/tests/integration/sdk/transpose.yaml b/tests/integration/sdk/transpose.yaml index d25f4c6..0ad4bd5 100644 --- a/tests/integration/sdk/transpose.yaml +++ b/tests/integration/sdk/transpose.yaml @@ -18,7 +18,7 @@ cases: Hint: cargo upgrade -p parity-scale-codec@3.6.5 - Error: "see log" + Error: () code: 1 - cmd: transpose dependency lift-to-workspace log stderr: | @@ -37,7 +37,7 @@ cases: Hint: cargo upgrade -p log@0.4.20 - Error: "see log" + Error: () code: 1 - cmd: transpose dependency lift-to-workspace log --version-resolver Unambiguous stderr: | @@ -52,7 +52,7 @@ cases: stderr: | [WARN] Unstable feature - do not rely on this! Held back modifications to 200 files; re-run with --fix to apply. - Error: "see log" + Error: () code: 1 - cmd: transpose dependency lift-to-workspace log --version-resolver exact stderr: | @@ -67,19 +67,19 @@ cases: stderr: | [WARN] Unstable feature - do not rely on this! Cannot use --exact-version without --version-resolver=exact - Error: "see log" + Error: () code: 1 - cmd: transpose dependency lift-to-workspace log --version-resolver exact --exact-version 0.4.20 stderr: | [WARN] Unstable feature - do not rely on this! Held back modifications to 200 files; re-run with --fix to apply. - Error: "see log" + Error: () code: 1 - cmd: zepter transpose dependency lift-to-workspace macro_magic stderr: | [WARN] Unstable feature - do not rely on this! Held back modifications to 3 files; re-run with --fix to apply. - Error: "see log" + Error: () code: 1 - cmd: zepter transpose dependency lift-to-workspace tt-call --version-resolver latest --fix stderr: | diff --git a/tests/integration/substrate/master-1.yaml b/tests/integration/substrate/master-1.yaml index b28454f..2a40391 100644 --- a/tests/integration/substrate/master-1.yaml +++ b/tests/integration/substrate/master-1.yaml @@ -69,8 +69,8 @@ cases: crate 'frame-support-test-compile-pass' feature 'runtime-benchmarks' is required by 3 dependencies: - renamed-frame-support (renamed from frame-support) frame-system + renamed-frame-support (renamed from frame-support) sp-runtime crate 'frame-support-test-pallet' feature 'runtime-benchmarks' @@ -1149,8 +1149,8 @@ cases: crate 'frame-support-test-compile-pass' feature 'runtime-benchmarks' is required by 3 dependencies: - renamed-frame-support (renamed from frame-support) frame-system + renamed-frame-support (renamed from frame-support) sp-runtime crate 'frame-support-test-pallet' feature 'runtime-benchmarks' @@ -2724,11 +2724,11 @@ cases: is required by 21 dependencies: chrono clap + codec (renamed from parity-scale-codec) frame-benchmarking frame-support frame-system log - codec (renamed from parity-scale-codec) rand sc-executor serde @@ -2755,9 +2755,9 @@ cases: feature 'std' is required by 9 dependencies: clap + codec (renamed from parity-scale-codec) frame-election-provider-support frame-support - codec (renamed from parity-scale-codec) rand scale-info sp-arithmetic @@ -2770,11 +2770,11 @@ cases: crate 'frame-remote-externalities' feature 'std' is required by 10 dependencies: + codec (renamed from parity-scale-codec) frame-support futures log pallet-elections-phragmen - codec (renamed from parity-scale-codec) serde sp-core sp-io @@ -3322,9 +3322,9 @@ cases: crate 'mmr-gadget' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-consensus-beefy sp-core @@ -3455,9 +3455,11 @@ cases: feature 'std' is required by 33 dependencies: clap + codec (renamed from parity-scale-codec) frame-system frame-system-rpc-runtime-api futures + grandpa-primitives (renamed from sp-consensus-grandpa) kitchensink-runtime log node-primitives @@ -3467,7 +3469,6 @@ cases: pallet-im-online pallet-timestamp pallet-transaction-payment - codec (renamed from parity-scale-codec) platforms rand regex @@ -3477,7 +3478,6 @@ cases: sp-api sp-authority-discovery sp-consensus-babe - grandpa-primitives (renamed from sp-consensus-grandpa) sp-core sp-inherents sp-io @@ -3490,6 +3490,7 @@ cases: crate 'node-executor' feature 'std' is required by 28 dependencies: + codec (renamed from parity-scale-codec) frame-benchmarking frame-support frame-system @@ -3505,7 +3506,6 @@ cases: pallet-timestamp pallet-transaction-payment pallet-treasury - codec (renamed from parity-scale-codec) sc-executor scale-info sp-application-crypto @@ -3567,6 +3567,7 @@ cases: crate 'node-testing' feature 'std' is required by 17 dependencies: + codec (renamed from parity-scale-codec) frame-system futures kitchensink-runtime @@ -3575,7 +3576,6 @@ cases: pallet-asset-tx-payment pallet-assets pallet-transaction-payment - codec (renamed from parity-scale-codec) sc-executor sp-api sp-block-builder @@ -3676,6 +3676,7 @@ cases: crate 'pallet-election-provider-e2e-test' feature 'std' is required by 19 dependencies: + codec (renamed from parity-scale-codec) frame-election-provider-support frame-support frame-system @@ -3686,7 +3687,6 @@ cases: pallet-session pallet-staking pallet-timestamp - codec (renamed from parity-scale-codec) scale-info sp-core sp-io @@ -3726,8 +3726,8 @@ cases: crate 'pallet-nomination-pools-benchmarking' feature 'std' must propagate to: - pallet-balances codec (renamed from parity-scale-codec) + pallet-balances scale-info crate 'pallet-nomination-pools-fuzzer' feature 'std' @@ -3743,6 +3743,7 @@ cases: crate 'pallet-nomination-pools-test-staking' feature 'std' is required by 17 dependencies: + codec (renamed from parity-scale-codec) frame-election-provider-support frame-support frame-system @@ -3752,7 +3753,6 @@ cases: pallet-nomination-pools pallet-staking pallet-timestamp - codec (renamed from parity-scale-codec) scale-info sp-core sp-io @@ -3791,8 +3791,8 @@ cases: crate 'pallet-transaction-payment-rpc' feature 'std' is required by 6 dependencies: - pallet-transaction-payment-rpc-runtime-api codec (renamed from parity-scale-codec) + pallet-transaction-payment-rpc-runtime-api sp-api sp-core sp-runtime @@ -4079,10 +4079,10 @@ cases: crate 'sc-authority-discovery' feature 'std' is required by 12 dependencies: + codec (renamed from parity-scale-codec) futures log multihash - codec (renamed from parity-scale-codec) prost rand sp-api @@ -4094,9 +4094,9 @@ cases: crate 'sc-basic-authorship' feature 'std' is required by 7 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-core sp-inherents @@ -4140,10 +4140,10 @@ cases: crate 'sc-client-api' feature 'std' is required by 15 dependencies: + codec (renamed from parity-scale-codec) fnv futures log - codec (renamed from parity-scale-codec) sc-executor sp-api sp-core @@ -4158,10 +4158,10 @@ cases: crate 'sc-client-db' feature 'std' is required by 11 dependencies: + codec (renamed from parity-scale-codec) hash-db kitchensink-runtime log - codec (renamed from parity-scale-codec) rand sp-arithmetic sp-core @@ -4183,9 +4183,9 @@ cases: crate 'sc-consensus-aura' feature 'std' is required by 14 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-application-crypto sp-block-builder @@ -4200,12 +4200,12 @@ cases: crate 'sc-consensus-babe' feature 'std' is required by 19 dependencies: + codec (renamed from parity-scale-codec) futures log num-bigint num-rational num-traits - codec (renamed from parity-scale-codec) rand_chacha scale-info sp-api @@ -4234,10 +4234,10 @@ cases: crate 'sc-consensus-beefy' feature 'std' is required by 15 dependencies: + codec (renamed from parity-scale-codec) fnv futures log - codec (renamed from parity-scale-codec) serde sp-api sp-application-crypto @@ -4252,9 +4252,9 @@ cases: crate 'sc-consensus-beefy-rpc' feature 'std' is required by 8 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) serde serde_json sp-consensus-beefy @@ -4298,9 +4298,9 @@ cases: crate 'sc-consensus-manual-seal' feature 'std' is required by 13 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) serde sp-api sp-consensus-aura @@ -4314,9 +4314,9 @@ cases: crate 'sc-consensus-pow' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-block-builder sp-consensus-pow @@ -4326,9 +4326,9 @@ cases: crate 'sc-consensus-slots' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-arithmetic sp-consensus-slots sp-core @@ -4344,10 +4344,10 @@ cases: feature 'std' is required by 10 dependencies: anyhow + codec (renamed from parity-scale-codec) libc log once_cell - codec (renamed from parity-scale-codec) rustix sc-runtime-test sp-io @@ -4370,10 +4370,10 @@ cases: feature 'std' is required by 16 dependencies: bytes + codec (renamed from parity-scale-codec) fnv futures log - codec (renamed from parity-scale-codec) rand serde serde_json @@ -4400,8 +4400,8 @@ cases: feature 'std' is required by 7 dependencies: bytes - futures codec (renamed from parity-scale-codec) + futures serde sp-consensus-grandpa sp-runtime @@ -4417,26 +4417,26 @@ cases: crate 'sc-network-light' feature 'std' is required by 6 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) prost sp-core sp-runtime crate 'sc-network-statement' feature 'std' is required by 5 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-runtime sp-statement-store crate 'sc-network-sync' feature 'std' is required by 10 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) prost sp-arithmetic sp-consensus-grandpa @@ -4458,18 +4458,18 @@ cases: crate 'sc-network-transactions' feature 'std' is required by 4 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-runtime crate 'sc-offchain' feature 'std' is required by 12 dependencies: bytes + codec (renamed from parity-scale-codec) fnv futures once_cell - codec (renamed from parity-scale-codec) rand sp-api sp-core @@ -4493,9 +4493,9 @@ cases: crate 'sc-rpc' feature 'std' is required by 13 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) serde_json sp-api sp-core @@ -4524,11 +4524,11 @@ cases: crate 'sc-rpc-spec-v2' feature 'std' is required by 12 dependencies: + codec (renamed from parity-scale-codec) futures futures-util hex log - codec (renamed from parity-scale-codec) serde serde_json sp-api @@ -4543,9 +4543,9 @@ cases: crate 'sc-service' feature 'std' is required by 22 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) rand sc-executor serde @@ -4584,15 +4584,15 @@ cases: crate 'sc-state-db' feature 'std' is required by 3 dependencies: - log codec (renamed from parity-scale-codec) + log sp-core crate 'sc-statement-store' feature 'std' is required by 8 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-core sp-runtime @@ -4654,10 +4654,10 @@ cases: crate 'sc-transaction-pool' feature 'std' is required by 11 dependencies: + codec (renamed from parity-scale-codec) futures log num-traits - codec (renamed from parity-scale-codec) serde sp-api sp-core @@ -4812,9 +4812,9 @@ cases: crate 'sp-blockchain' feature 'std' is required by 6 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-runtime sp-state-machine @@ -4990,9 +4990,9 @@ cases: crate 'substrate-frame-rpc-support' feature 'std' is required by 8 dependencies: + codec (renamed from parity-scale-codec) frame-support frame-system - codec (renamed from parity-scale-codec) scale-info serde sp-core @@ -5001,10 +5001,10 @@ cases: crate 'substrate-frame-rpc-system' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) frame-system-rpc-runtime-api futures log - codec (renamed from parity-scale-codec) sp-api sp-block-builder sp-core @@ -5024,8 +5024,8 @@ cases: crate 'substrate-state-trie-migration-rpc' feature 'std' is required by 10 dependencies: - log codec (renamed from parity-scale-codec) + log scale-info serde serde_json @@ -5037,8 +5037,8 @@ cases: crate 'substrate-test-client' feature 'std' is required by 9 dependencies: - futures codec (renamed from parity-scale-codec) + futures sc-executor serde serde_json @@ -5053,8 +5053,8 @@ cases: crate 'substrate-test-runtime-client' feature 'std' is required by 6 dependencies: - futures codec (renamed from parity-scale-codec) + futures sp-api sp-core sp-runtime @@ -5062,8 +5062,8 @@ cases: crate 'substrate-test-runtime-transaction-pool' feature 'std' is required by 3 dependencies: - futures codec (renamed from parity-scale-codec) + futures sp-runtime crate 'substrate-test-utils' feature 'std' @@ -5724,6 +5724,7 @@ cases: is required by 24 dependencies: frame-system frame-system-rpc-runtime-api + grandpa-primitives (renamed from sp-consensus-grandpa) kitchensink-runtime node-primitives pallet-asset-tx-payment @@ -5736,7 +5737,6 @@ cases: sp-api sp-authority-discovery sp-consensus-babe - grandpa-primitives (renamed from sp-consensus-grandpa) sp-core sp-inherents sp-io @@ -6569,8 +6569,8 @@ cases: crate 'frame-support-test-compile-pass' feature 'try-runtime' is required by 3 dependencies: - renamed-frame-support (renamed from frame-support) frame-system + renamed-frame-support (renamed from frame-support) sp-runtime crate 'frame-support-test-pallet' feature 'try-runtime' @@ -7674,8 +7674,8 @@ cases: crate 'frame-support-test-compile-pass' feature 'try-runtime' is required by 3 dependencies: - renamed-frame-support (renamed from frame-support) frame-system + renamed-frame-support (renamed from frame-support) sp-runtime crate 'frame-support-test-pallet' feature 'try-runtime' diff --git a/tests/integration/substrate/master.yaml b/tests/integration/substrate/master.yaml index c0fd7b5..eeda9b8 100644 --- a/tests/integration/substrate/master.yaml +++ b/tests/integration/substrate/master.yaml @@ -44,8 +44,8 @@ cases: crate 'frame-support-test-compile-pass' feature 'runtime-benchmarks' is required by 3 dependencies: - renamed-frame-support (renamed from frame-support) frame-system + renamed-frame-support (renamed from frame-support) sp-runtime crate 'frame-support-test-pallet' feature 'runtime-benchmarks' @@ -733,8 +733,8 @@ cases: crate 'frame-support-test-compile-pass' feature 'runtime-benchmarks' is required by 3 dependencies: - renamed-frame-support (renamed from frame-support) frame-system + renamed-frame-support (renamed from frame-support) sp-runtime crate 'frame-support-test-pallet' feature 'runtime-benchmarks' @@ -2018,11 +2018,11 @@ cases: is required by 22 dependencies: chrono clap + codec (renamed from parity-scale-codec) frame-benchmarking frame-support frame-system log - codec (renamed from parity-scale-codec) rand sc-executor serde @@ -2050,9 +2050,9 @@ cases: feature 'std' is required by 9 dependencies: clap + codec (renamed from parity-scale-codec) frame-election-provider-support frame-support - codec (renamed from parity-scale-codec) rand scale-info sp-arithmetic @@ -2061,9 +2061,9 @@ cases: crate 'frame-remote-externalities' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) serde sp-core sp-io @@ -2597,9 +2597,9 @@ cases: crate 'mmr-gadget' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-consensus-beefy sp-core @@ -2725,9 +2725,11 @@ cases: feature 'std' is required by 33 dependencies: clap + codec (renamed from parity-scale-codec) frame-system frame-system-rpc-runtime-api futures + grandpa-primitives (renamed from sp-consensus-grandpa) kitchensink-runtime log node-primitives @@ -2737,7 +2739,6 @@ cases: pallet-balances pallet-im-online pallet-timestamp - codec (renamed from parity-scale-codec) platforms rand regex @@ -2747,7 +2748,6 @@ cases: sp-api sp-authority-discovery sp-consensus-babe - grandpa-primitives (renamed from sp-consensus-grandpa) sp-core sp-inherents sp-io @@ -2760,6 +2760,7 @@ cases: crate 'node-executor' feature 'std' is required by 28 dependencies: + codec (renamed from parity-scale-codec) frame-benchmarking frame-support frame-system @@ -2775,7 +2776,6 @@ cases: pallet-timestamp pallet-transaction-payment pallet-treasury - codec (renamed from parity-scale-codec) sc-executor scale-info sp-application-crypto @@ -2836,6 +2836,7 @@ cases: crate 'node-testing' feature 'std' is required by 18 dependencies: + codec (renamed from parity-scale-codec) frame-system futures kitchensink-runtime @@ -2845,7 +2846,6 @@ cases: pallet-asset-conversion-tx-payment pallet-asset-tx-payment pallet-assets - codec (renamed from parity-scale-codec) sc-executor sp-api sp-block-builder @@ -2922,6 +2922,7 @@ cases: crate 'pallet-election-provider-e2e-test' feature 'std' is required by 19 dependencies: + codec (renamed from parity-scale-codec) frame-election-provider-support frame-support frame-system @@ -2932,7 +2933,6 @@ cases: pallet-session pallet-staking pallet-timestamp - codec (renamed from parity-scale-codec) scale-info sp-core sp-io @@ -2980,6 +2980,7 @@ cases: crate 'pallet-nomination-pools-test-staking' feature 'std' is required by 17 dependencies: + codec (renamed from parity-scale-codec) frame-election-provider-support frame-support frame-system @@ -2989,7 +2990,6 @@ cases: pallet-nomination-pools pallet-staking pallet-timestamp - codec (renamed from parity-scale-codec) scale-info sp-core sp-io @@ -3022,8 +3022,8 @@ cases: crate 'pallet-transaction-payment-rpc' feature 'std' is required by 6 dependencies: - pallet-transaction-payment-rpc-runtime-api codec (renamed from parity-scale-codec) + pallet-transaction-payment-rpc-runtime-api sp-api sp-core sp-runtime @@ -3316,10 +3316,10 @@ cases: crate 'sc-authority-discovery' feature 'std' is required by 12 dependencies: + codec (renamed from parity-scale-codec) futures log multihash - codec (renamed from parity-scale-codec) prost rand sp-api @@ -3331,9 +3331,9 @@ cases: crate 'sc-basic-authorship' feature 'std' is required by 7 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-core sp-inherents @@ -3377,10 +3377,10 @@ cases: crate 'sc-client-api' feature 'std' is required by 14 dependencies: + codec (renamed from parity-scale-codec) fnv futures log - codec (renamed from parity-scale-codec) sc-executor sp-api sp-core @@ -3394,10 +3394,10 @@ cases: crate 'sc-client-db' feature 'std' is required by 11 dependencies: + codec (renamed from parity-scale-codec) hash-db kitchensink-runtime log - codec (renamed from parity-scale-codec) rand sp-arithmetic sp-core @@ -3419,9 +3419,9 @@ cases: crate 'sc-consensus-aura' feature 'std' is required by 14 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-application-crypto sp-block-builder @@ -3436,12 +3436,12 @@ cases: crate 'sc-consensus-babe' feature 'std' is required by 19 dependencies: + codec (renamed from parity-scale-codec) futures log num-bigint num-rational num-traits - codec (renamed from parity-scale-codec) rand_chacha scale-info sp-api @@ -3470,10 +3470,10 @@ cases: crate 'sc-consensus-beefy' feature 'std' is required by 15 dependencies: + codec (renamed from parity-scale-codec) fnv futures log - codec (renamed from parity-scale-codec) serde sp-api sp-application-crypto @@ -3488,9 +3488,9 @@ cases: crate 'sc-consensus-beefy-rpc' feature 'std' is required by 8 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) serde serde_json sp-consensus-beefy @@ -3534,9 +3534,9 @@ cases: crate 'sc-consensus-manual-seal' feature 'std' is required by 13 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) serde sp-api sp-consensus-aura @@ -3550,9 +3550,9 @@ cases: crate 'sc-consensus-pow' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-block-builder sp-consensus-pow @@ -3562,9 +3562,9 @@ cases: crate 'sc-consensus-slots' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-arithmetic sp-consensus-slots sp-core @@ -3580,9 +3580,9 @@ cases: feature 'std' is required by 9 dependencies: anyhow + codec (renamed from parity-scale-codec) libc log - codec (renamed from parity-scale-codec) rustix sc-runtime-test sp-io @@ -3605,10 +3605,10 @@ cases: feature 'std' is required by 16 dependencies: bytes + codec (renamed from parity-scale-codec) fnv futures log - codec (renamed from parity-scale-codec) rand serde serde_json @@ -3634,8 +3634,8 @@ cases: crate 'sc-network-common' feature 'std' is required by 4 dependencies: - futures codec (renamed from parity-scale-codec) + futures sp-consensus-grandpa sp-runtime crate 'sc-network-gossip' @@ -3649,25 +3649,25 @@ cases: crate 'sc-network-light' feature 'std' is required by 6 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) prost sp-core sp-runtime crate 'sc-network-statement' feature 'std' is required by 4 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-statement-store crate 'sc-network-sync' feature 'std' is required by 10 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) prost sp-arithmetic sp-consensus-grandpa @@ -3688,19 +3688,19 @@ cases: crate 'sc-network-transactions' feature 'std' is required by 4 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-runtime crate 'sc-offchain' feature 'std' is required by 15 dependencies: bytes + codec (renamed from parity-scale-codec) fnv futures log once_cell - codec (renamed from parity-scale-codec) rand sp-api sp-core @@ -3717,9 +3717,9 @@ cases: crate 'sc-rpc' feature 'std' is required by 14 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) pretty_assertions serde_json sp-api @@ -3749,11 +3749,11 @@ cases: crate 'sc-rpc-spec-v2' feature 'std' is required by 13 dependencies: + codec (renamed from parity-scale-codec) futures futures-util hex log - codec (renamed from parity-scale-codec) pretty_assertions serde serde_json @@ -3765,9 +3765,9 @@ cases: crate 'sc-service' feature 'std' is required by 22 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) rand sc-executor serde @@ -3806,8 +3806,8 @@ cases: crate 'sc-state-db' feature 'std' is required by 3 dependencies: - log codec (renamed from parity-scale-codec) + log sp-core crate 'sc-statement-store' feature 'std' @@ -3871,9 +3871,9 @@ cases: crate 'sc-transaction-pool' feature 'std' is required by 10 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) serde sp-api sp-core @@ -3884,9 +3884,9 @@ cases: crate 'sc-transaction-pool-api' feature 'std' is required by 7 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) serde serde_json sp-core @@ -4011,9 +4011,9 @@ cases: crate 'sp-api-test' feature 'std' is required by 10 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) scale-info sp-api sp-core @@ -4040,9 +4040,9 @@ cases: crate 'sp-blockchain' feature 'std' is required by 6 dependencies: + codec (renamed from parity-scale-codec) futures log - codec (renamed from parity-scale-codec) sp-api sp-runtime sp-state-machine @@ -4204,9 +4204,9 @@ cases: crate 'substrate-frame-rpc-support' feature 'std' is required by 8 dependencies: + codec (renamed from parity-scale-codec) frame-support frame-system - codec (renamed from parity-scale-codec) scale-info serde sp-core @@ -4215,10 +4215,10 @@ cases: crate 'substrate-frame-rpc-system' feature 'std' is required by 9 dependencies: + codec (renamed from parity-scale-codec) frame-system-rpc-runtime-api futures log - codec (renamed from parity-scale-codec) sp-api sp-block-builder sp-core @@ -4249,8 +4249,8 @@ cases: crate 'substrate-test-client' feature 'std' is required by 9 dependencies: - futures codec (renamed from parity-scale-codec) + futures sc-executor serde serde_json @@ -4274,8 +4274,8 @@ cases: crate 'substrate-test-runtime-transaction-pool' feature 'std' is required by 3 dependencies: - futures codec (renamed from parity-scale-codec) + futures sp-runtime crate 'substrate-test-utils' feature 'std' @@ -4926,6 +4926,7 @@ cases: is required by 24 dependencies: frame-system frame-system-rpc-runtime-api + grandpa-primitives (renamed from sp-consensus-grandpa) kitchensink-runtime node-primitives pallet-asset-conversion-tx-payment @@ -4938,7 +4939,6 @@ cases: sp-api sp-authority-discovery sp-consensus-babe - grandpa-primitives (renamed from sp-consensus-grandpa) sp-core sp-inherents sp-io @@ -5678,8 +5678,8 @@ cases: crate 'frame-support-test-compile-pass' feature 'try-runtime' is required by 3 dependencies: - renamed-frame-support (renamed from frame-support) frame-system + renamed-frame-support (renamed from frame-support) sp-runtime crate 'frame-support-test-pallet' feature 'try-runtime' @@ -6255,8 +6255,8 @@ cases: crate 'frame-support-test-compile-pass' feature 'try-runtime' is required by 3 dependencies: - renamed-frame-support (renamed from frame-support) frame-system + renamed-frame-support (renamed from frame-support) sp-runtime crate 'frame-support-test-pallet' feature 'try-runtime' diff --git a/tests/ui/config/v1/basic.yaml b/tests/ui/config/v1/basic.yaml index 27d8b71..3e16468 100644 --- a/tests/ui/config/v1/basic.yaml +++ b/tests/ui/config/v1/basic.yaml @@ -3,47 +3,43 @@ crates: cases: - cmd: run default stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: '' stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run my_version stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'my_version' [INFO] 1/1 --version - cmd: run my_debug - stdout: |+ + stdout: | Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 - # Number of samples = 0 - stderr: | [INFO] Running workflow 'my_debug' [WARN] Unstable feature - do not rely on this! [INFO] 1/1 debug --no-benchmark - cmd: run both - stdout: |+ - zepter 1.1.0 + stdout: | + zepter 1.1.1 Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 - # Number of samples = 0 - stderr: | [INFO] Running workflow 'both' [INFO] 1/2 --version diff --git a/tests/ui/config/v1/finds_all.yaml b/tests/ui/config/v1/finds_all.yaml index 25000f5..9bf2b15 100644 --- a/tests/ui/config/v1/finds_all.yaml +++ b/tests/ui/config/v1/finds_all.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: '' stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -19,7 +19,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -35,7 +35,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -51,7 +51,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -67,7 +67,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -83,7 +83,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -99,7 +99,7 @@ cases: - [ '--version' ] - cmd: run default --config .cargo/polkadot.yaml stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -115,7 +115,7 @@ cases: - [ '--version' ] - cmd: run default -c .cargo/polkadot.yaml stdout: | - zepter 1.1.0 + zepter 1.1.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version diff --git a/tests/ui/config/v1/version_bin.yaml b/tests/ui/config/v1/version_bin.yaml index 5723865..31aa6ab 100644 --- a/tests/ui/config/v1/version_bin.yaml +++ b/tests/ui/config/v1/version_bin.yaml @@ -3,7 +3,8 @@ crates: cases: - cmd: run default stderr: | - thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 + thread 'main' panicked at src/cmd/run.rs:27:46: + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.1. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 - cmd: run default --check-cfg-compatibility=off @@ -11,7 +12,8 @@ cases: Error: Command '' failed with exit code 101 stderr: | [INFO] Running workflow 'default' - thread 'main' panicked at 'Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`."', src/cmd/run.rs:27:46 + thread 'main' panicked at src/cmd/run.rs:27:46: + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.1. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 1 configs: diff --git a/tests/ui/config/v1/version_file.yaml b/tests/ui/config/v1/version_file.yaml index 9f250be..2f2392b 100644 --- a/tests/ui/config/v1/version_file.yaml +++ b/tests/ui/config/v1/version_file.yaml @@ -3,7 +3,8 @@ crates: cases: - cmd: run default stderr: | - thread 'main' panicked at 'Invalid config file: "Can only parse workflow files with version '1'"', src/cmd/run.rs:27:46 + thread 'main' panicked at src/cmd/run.rs:27:46: + Invalid config file: "Can only parse workflow files with version '1'" note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 configs: diff --git a/tests/ui/fmt/help.yaml b/tests/ui/fmt/help.yaml index 1ff3cb4..058eb8a 100644 --- a/tests/ui/fmt/help.yaml +++ b/tests/ui/fmt/help.yaml @@ -3,4 +3,4 @@ cases: - cmd: format --help stdout: "Format the features in your manifest files\n\nUsage: zepter format [OPTIONS] \n\nCommands:\n features Format the content of each feature in the crate manifest\n help Print this message or the help of the given subcommand(s)\n\nOptions:\n -q, --quiet\n Only print errors. Supersedes `--log`\n\n --log \n Log level to use\n \n [default: info]\n\n --color\n Use ANSI terminal colors\n\n --exit-code-zero\n Try to exit with code zero if the intended check failed.\n \n Will still return 1 in case of an actual error (eg. failed to find some file) or a panic\n (aka software bug).\n\n --fix-hint \n Dont print any hints on how to fix the error.\n \n This is mostly used internally when dispatching, workflows since they come with their\n hints.\n \n [default: on]\n\n Possible values:\n - on: Prints some hint that is (hopefully) helpful\n - off: Prints no hint at all\n\n -h, --help\n Print help (see a summary with '-h')\n" - cmd: format features --help - stdout: "Format the content of each feature in the crate manifest\n\nUsage: zepter format features [OPTIONS]\n\nOptions:\n --manifest-path \n Cargo manifest path or directory.\n \n For directories it appends a `Cargo.toml`.\n\n --workspace\n Whether to only consider workspace crates\n\n --offline\n Whether to use offline mode\n\n --locked\n Whether to use all the locked dependencies from the `Cargo.lock`.\n \n Otherwise it may update some dependencies. For CI usage its a good idea to use it.\n\n --all-features\n \n\n --debug-keep-meta \n \n\n --no-workspace\n Include dependencies in the formatting check.\n \n They will not be modified, unless their path is included in `--modify-paths`.\n\n -q, --quiet\n Only print errors. Supersedes `--log`\n\n --log \n Log level to use\n \n [default: info]\n\n --modify-paths \n Paths that are allowed to be modified by the formatter\n\n -c, --check\n DEPRECATED AND IGNORED\n\n --color\n Use ANSI terminal colors\n\n --exit-code-zero\n Try to exit with code zero if the intended check failed.\n \n Will still return 1 in case of an actual error (eg. failed to find some file) or a panic\n (aka software bug).\n\n -f, --fix\n Fix the formatting errors automatically\n\n --fix-hint \n Dont print any hints on how to fix the error.\n \n This is mostly used internally when dispatching, workflows since they come with their\n hints.\n \n [default: on]\n\n Possible values:\n - on: Prints some hint that is (hopefully) helpful\n - off: Prints no hint at all\n\n --line-width \n The maximal length of a line for a feature\n \n [default: 80]\n\n --mode-per-feature \n Set the formatting mode for a specific feature.\n \n Can be specified multiple times. Example:\n `--mode-per-feature default:sort,default:canonicalize`\n\n --ignore-feature \n Ignore a specific feature across all crates.\n \n This is equivalent to `--mode-per-feature FEATURE:none`.\n\n --print-paths\n Also print the paths of the offending Cargo.toml files\n\n -h, --help\n Print help (see a summary with '-h')\n" + stdout: "Format the content of each feature in the crate manifest\n\nUsage: zepter format features [OPTIONS]\n\nOptions:\n --manifest-path \n Cargo manifest path or directory.\n \n For directories it appends a `Cargo.toml`.\n\n --workspace\n Whether to only consider workspace crates\n\n --offline\n Whether to use offline mode\n\n --locked\n Whether to use all the locked dependencies from the `Cargo.lock`.\n \n Otherwise it may update some dependencies. For CI usage its a good idea to use it.\n\n --all-features\n \n\n --no-workspace\n Include dependencies in the formatting check.\n \n They will not be modified, unless their path is included in `--modify-paths`.\n\n --modify-paths \n Paths that are allowed to be modified by the formatter\n\n -q, --quiet\n Only print errors. Supersedes `--log`\n\n -c, --check\n DEPRECATED AND IGNORED\n\n --log \n Log level to use\n \n [default: info]\n\n --color\n Use ANSI terminal colors\n\n -f, --fix\n Fix the formatting errors automatically\n\n --exit-code-zero\n Try to exit with code zero if the intended check failed.\n \n Will still return 1 in case of an actual error (eg. failed to find some file) or a panic\n (aka software bug).\n\n --line-width \n The maximal length of a line for a feature\n \n [default: 80]\n\n --fix-hint \n Dont print any hints on how to fix the error.\n \n This is mostly used internally when dispatching, workflows since they come with their\n hints.\n \n [default: on]\n\n Possible values:\n - on: Prints some hint that is (hopefully) helpful\n - off: Prints no hint at all\n\n --mode-per-feature \n Set the formatting mode for a specific feature.\n \n Can be specified multiple times. Example:\n `--mode-per-feature default:sort,default:canonicalize`\n\n --ignore-feature \n Ignore a specific feature across all crates.\n \n This is equivalent to `--mode-per-feature FEATURE:none`.\n\n --print-paths\n Also print the paths of the offending Cargo.toml files\n\n -h, --help\n Print help (see a summary with '-h')\n" diff --git a/tests/ui/lint/never-enables/simple.yaml b/tests/ui/lint/never-enables/simple.yaml index 9419ab5..3a007bf 100644 --- a/tests/ui/lint/never-enables/simple.yaml +++ b/tests/ui/lint/never-enables/simple.yaml @@ -27,6 +27,4 @@ cases: enables feature "G1" on dependencies: B - cmd: lint never-enables --precondition F0 --stays-disabled G1 - stdout: '' - cmd: lint never-enables --precondition F1 --stays-disabled G0 - stdout: '' diff --git a/tests/ui/root-args/help.yaml b/tests/ui/root-args/help.yaml index df72b83..07d1f36 100644 --- a/tests/ui/root-args/help.yaml +++ b/tests/ui/root-args/help.yaml @@ -5,4 +5,4 @@ cases: - cmd: lint --help stdout: "Lint your feature usage by analyzing crate metadata\n\nUsage: zepter lint [OPTIONS] \n\nCommands:\n propagate-feature Check whether features are properly propagated\n never-enables A specific feature never enables a specific other feature\n never-implies A specific feature never implies a specific other feature\n only-enables A specific feature is only implied by a specific set of other features\n why-enabled Arguments for how to load cargo metadata from a workspace\n help Print this message or the help of the given subcommand(s)\n\nOptions:\n -q, --quiet\n Only print errors. Supersedes `--log`\n\n --log \n Log level to use\n \n [default: info]\n\n --color\n Use ANSI terminal colors\n\n --exit-code-zero\n Try to exit with code zero if the intended check failed.\n \n Will still return 1 in case of an actual error (eg. failed to find some file) or a panic\n (aka software bug).\n\n --fix-hint \n Dont print any hints on how to fix the error.\n \n This is mostly used internally when dispatching, workflows since they come with their\n hints.\n \n [default: on]\n\n Possible values:\n - on: Prints some hint that is (hopefully) helpful\n - off: Prints no hint at all\n\n -h, --help\n Print help (see a summary with '-h')\n" - cmd: lint propagate-feature --help - stdout: "Check whether features are properly propagated\n\nUsage: zepter lint propagate-feature [OPTIONS] --features \n\nOptions:\n --manifest-path \n Cargo manifest path or directory.\n \n For directories it appends a `Cargo.toml`.\n\n --workspace\n Whether to only consider workspace crates\n\n --offline\n Whether to use offline mode\n\n --locked\n Whether to use all the locked dependencies from the `Cargo.lock`.\n \n Otherwise it may update some dependencies. For CI usage its a good idea to use it.\n\n --all-features\n \n\n --debug-keep-meta \n \n\n --features \n The feature to check\n\n -q, --quiet\n Only print errors. Supersedes `--log`\n\n --log \n Log level to use\n \n [default: info]\n\n -p, --packages [...]\n The packages to check. If empty, all packages are checked\n\n --color\n Use ANSI terminal colors\n\n --feature-enables-dep \n The auto-fixer will enables the feature of the dependencies as non-optional.\n \n This can be used in case that a dependency should not be enabled like `dep?/feature` but\n like `dep/feature` instead. In this case you would pass `--feature-enables-dep\n feature:dep`. The option can be passed multiple times, or multiple key-value pairs can be\n passed at once by separating them with a comma like: `--feature-enables-dep\n feature:dep,feature2:dep2`. (TODO: Duplicate entries are undefined).\n\n --exit-code-zero\n Try to exit with code zero if the intended check failed.\n \n Will still return 1 in case of an actual error (eg. failed to find some file) or a panic\n (aka software bug).\n\n --left-side-feature-missing \n Overwrite the behaviour when the left side dependency is missing the feature.\n \n This can be used to ignore missing features, treat them as warning or error. A \"missing\n feature\" here means that if `A` has a dependency `B` which has a feature `F`, and the\n propagation is checked then normally it would error if `A` is not forwarding `F` to `B`.\n Now this option modifies the behaviour if `A` does not have the feature in the first place.\n The default behaviour is to require `A` to also have `F`.\n \n [default: fix]\n\n Possible values:\n - ignore: Ignore this behaviour\n - report: Only report but do not fix\n - fix: Fix if `--fix` is passed\n\n --fix-hint \n Dont print any hints on how to fix the error.\n \n This is mostly used internally when dispatching, workflows since they come with their\n hints.\n \n [default: on]\n\n Possible values:\n - on: Prints some hint that is (hopefully) helpful\n - off: Prints no hint at all\n\n --ignore-missing-propagate \n Ignore single missing links in the feature propagation chain.\n\n --left-side-outside-workspace \n How to handle the case that the LHS is outside the workspace.\n \n [default: fix]\n\n Possible values:\n - ignore: Ignore this behaviour\n - report: Only report but do not fix\n - fix: Fix if `--fix` is passed\n\n --dep-kinds \n How to handle dev-dependencies.\n \n [default: normal:check,dev:check,build:check]\n\n --show-version\n Show crate versions in the output\n\n --show-path\n Show crate manifest paths in the output\n\n --fix\n Try to automatically fix the problems\n\n --modify-paths \n \n\n --fix-dependency \n Fix only issues with this package as dependency\n\n --fix-package \n Fix only issues with this package as feature source\n\n -h, --help\n Print help (see a summary with '-h')\n" + stdout: "Check whether features are properly propagated\n\nUsage: zepter lint propagate-feature [OPTIONS] --features \n\nOptions:\n --manifest-path \n Cargo manifest path or directory.\n \n For directories it appends a `Cargo.toml`.\n\n --workspace\n Whether to only consider workspace crates\n\n --offline\n Whether to use offline mode\n\n --locked\n Whether to use all the locked dependencies from the `Cargo.lock`.\n \n Otherwise it may update some dependencies. For CI usage its a good idea to use it.\n\n --all-features\n \n\n --features \n The feature to check\n\n -p, --packages [...]\n The packages to check. If empty, all packages are checked\n\n -q, --quiet\n Only print errors. Supersedes `--log`\n\n --feature-enables-dep \n The auto-fixer will enables the feature of the dependencies as non-optional.\n \n This can be used in case that a dependency should not be enabled like `dep?/feature` but\n like `dep/feature` instead. In this case you would pass `--feature-enables-dep\n feature:dep`. The option can be passed multiple times, or multiple key-value pairs can be\n passed at once by separating them with a comma like: `--feature-enables-dep\n feature:dep,feature2:dep2`. (TODO: Duplicate entries are undefined).\n\n --log \n Log level to use\n \n [default: info]\n\n --color\n Use ANSI terminal colors\n\n --left-side-feature-missing \n Overwrite the behaviour when the left side dependency is missing the feature.\n \n This can be used to ignore missing features, treat them as warning or error. A \"missing\n feature\" here means that if `A` has a dependency `B` which has a feature `F`, and the\n propagation is checked then normally it would error if `A` is not forwarding `F` to `B`.\n Now this option modifies the behaviour if `A` does not have the feature in the first place.\n The default behaviour is to require `A` to also have `F`.\n \n [default: fix]\n\n Possible values:\n - ignore: Ignore this behaviour\n - report: Only report but do not fix\n - fix: Fix if `--fix` is passed\n\n --exit-code-zero\n Try to exit with code zero if the intended check failed.\n \n Will still return 1 in case of an actual error (eg. failed to find some file) or a panic\n (aka software bug).\n\n --ignore-missing-propagate \n Ignore single missing links in the feature propagation chain.\n\n --fix-hint \n Dont print any hints on how to fix the error.\n \n This is mostly used internally when dispatching, workflows since they come with their\n hints.\n \n [default: on]\n\n Possible values:\n - on: Prints some hint that is (hopefully) helpful\n - off: Prints no hint at all\n\n --left-side-outside-workspace \n How to handle the case that the LHS is outside the workspace.\n \n [default: fix]\n\n Possible values:\n - ignore: Ignore this behaviour\n - report: Only report but do not fix\n - fix: Fix if `--fix` is passed\n\n --dep-kinds \n How to handle dev-dependencies.\n \n [default: normal:check,dev:check,build:check]\n\n --show-version\n Show crate versions in the output\n\n --show-path\n Show crate manifest paths in the output\n\n --fix\n Try to automatically fix the problems\n\n --modify-paths \n \n\n --fix-dependency \n Fix only issues with this package as dependency\n\n --fix-package \n Fix only issues with this package as feature source\n\n -h, --help\n Print help (see a summary with '-h')\n" diff --git a/tests/ui/root-args/version.yaml b/tests/ui/root-args/version.yaml index 22a936b..65fd0bf 100644 --- a/tests/ui/root-args/version.yaml +++ b/tests/ui/root-args/version.yaml @@ -2,7 +2,7 @@ crates: [] cases: - cmd: --version stdout: | - zepter 1.1.0 + zepter 1.1.1 - cmd: -V stdout: | - zepter 1.1.0 + zepter 1.1.1 From 054bd3d1a65a13c7aa1e87ad5ff52f6dfa92f05f Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 16 Feb 2024 15:01:29 +0100 Subject: [PATCH 06/13] Fixes (#79) * Fix sorting Signed-off-by: Oliver Tale-Yazdi * Update to 1.74 Signed-off-by: Oliver Tale-Yazdi * Update deps Signed-off-by: Oliver Tale-Yazdi * Bump more deps Signed-off-by: Oliver Tale-Yazdi * Adapt to breaking changes Signed-off-by: Oliver Tale-Yazdi * Make msrv check work Signed-off-by: Oliver Tale-Yazdi * Fixes Signed-off-by: Oliver Tale-Yazdi * Remove serde_json and cleanup Signed-off-by: Oliver Tale-Yazdi * Fixes Signed-off-by: Oliver Tale-Yazdi * Bump nightly to 1.76 Signed-off-by: Oliver Tale-Yazdi * fmg Signed-off-by: Oliver Tale-Yazdi * Clippy Signed-off-by: Oliver Tale-Yazdi * Bump to 1.1.2 Signed-off-by: Oliver Tale-Yazdi * Bump to 1.1.2 Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- Cargo.lock | 2 +- Cargo.toml | 2 +- tests/ui/config/v1/basic.yaml | 10 +++++----- tests/ui/config/v1/finds_all.yaml | 16 ++++++++-------- tests/ui/config/v1/version_bin.yaml | 4 ++-- tests/ui/root-args/version.yaml | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6742842..11e9cfd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1487,7 +1487,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zepter" -version = "1.1.1" +version = "1.1.2" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index 28145bb..8712fac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zepter" -version = "1.1.1" +version = "1.1.2" edition = "2021" authors = [ "Oliver Tale-Yazdi" ] description = "Analyze, Fix and Format features in your Rust workspace." diff --git a/tests/ui/config/v1/basic.yaml b/tests/ui/config/v1/basic.yaml index 3e16468..57802b5 100644 --- a/tests/ui/config/v1/basic.yaml +++ b/tests/ui/config/v1/basic.yaml @@ -3,25 +3,25 @@ crates: cases: - cmd: run default stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: '' stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run my_version stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'my_version' [INFO] 1/1 --version @@ -36,7 +36,7 @@ cases: [INFO] 1/1 debug --no-benchmark - cmd: run both stdout: | - zepter 1.1.1 + zepter 1.1.2 Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 diff --git a/tests/ui/config/v1/finds_all.yaml b/tests/ui/config/v1/finds_all.yaml index 9bf2b15..363a88b 100644 --- a/tests/ui/config/v1/finds_all.yaml +++ b/tests/ui/config/v1/finds_all.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: '' stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -19,7 +19,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -35,7 +35,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -51,7 +51,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -67,7 +67,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -83,7 +83,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -99,7 +99,7 @@ cases: - [ '--version' ] - cmd: run default --config .cargo/polkadot.yaml stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -115,7 +115,7 @@ cases: - [ '--version' ] - cmd: run default -c .cargo/polkadot.yaml stdout: | - zepter 1.1.1 + zepter 1.1.2 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version diff --git a/tests/ui/config/v1/version_bin.yaml b/tests/ui/config/v1/version_bin.yaml index 31aa6ab..fb3d175 100644 --- a/tests/ui/config/v1/version_bin.yaml +++ b/tests/ui/config/v1/version_bin.yaml @@ -4,7 +4,7 @@ cases: - cmd: run default stderr: | thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.1. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 - cmd: run default --check-cfg-compatibility=off @@ -13,7 +13,7 @@ cases: stderr: | [INFO] Running workflow 'default' thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.1. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 1 configs: diff --git a/tests/ui/root-args/version.yaml b/tests/ui/root-args/version.yaml index 65fd0bf..73b9942 100644 --- a/tests/ui/root-args/version.yaml +++ b/tests/ui/root-args/version.yaml @@ -2,7 +2,7 @@ crates: [] cases: - cmd: --version stdout: | - zepter 1.1.1 + zepter 1.1.2 - cmd: -V stdout: | - zepter 1.1.1 + zepter 1.1.2 From 6409d9ff5dd93df72cf74e59c5faeefd311dec58 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 16 Feb 2024 16:17:57 +0100 Subject: [PATCH 07/13] Cleanup code (#80) * Move files Signed-off-by: Oliver Tale-Yazdi * Refactor code Signed-off-by: Oliver Tale-Yazdi * Cleanup code Signed-off-by: Oliver Tale-Yazdi * Update UI tests Signed-off-by: Oliver Tale-Yazdi * fixup Signed-off-by: Oliver Tale-Yazdi * Add test Signed-off-by: Oliver Tale-Yazdi * Fix test Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- Cargo.lock | 2 +- Cargo.toml | 2 +- .../lift_to_workspace.rs} | 356 +++++++----------- src/cmd/transpose/mod.rs | 154 ++++++++ tests/integration/sdk/transpose.yaml | 134 ++++++- tests/ui/config/v1/basic.yaml | 10 +- tests/ui/config/v1/finds_all.yaml | 16 +- tests/ui/config/v1/version_bin.yaml | 4 +- tests/ui/root-args/version.yaml | 4 +- 9 files changed, 431 insertions(+), 251 deletions(-) rename src/cmd/{transpose.rs => transpose/lift_to_workspace.rs} (54%) create mode 100644 src/cmd/transpose/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 11e9cfd..f824bfb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1487,7 +1487,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zepter" -version = "1.1.2" +version = "1.2.0" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index 8712fac..6a45922 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zepter" -version = "1.1.2" +version = "1.2.0" edition = "2021" authors = [ "Oliver Tale-Yazdi" ] description = "Analyze, Fix and Format features in your Rust workspace." diff --git a/src/cmd/transpose.rs b/src/cmd/transpose/lift_to_workspace.rs similarity index 54% rename from src/cmd/transpose.rs rename to src/cmd/transpose/lift_to_workspace.rs index 9a82c7b..9e77a3f 100644 --- a/src/cmd/transpose.rs +++ b/src/cmd/transpose/lift_to_workspace.rs @@ -1,94 +1,27 @@ // SPDX-License-Identifier: GPL-3.0-only // SPDX-FileCopyrightText: Oliver Tale-Yazdi -use super::GlobalArgs; -use crate::{autofix::*, cmd::resolve_dep, grammar::*, log}; - -use cargo_metadata::{Dependency as Dep, DependencyKind, Package}; -use itertools::Itertools; -use semver::{Op, Version, VersionReq}; -use std::{ - collections::{BTreeMap as Map, HashMap}, - fs::canonicalize, +use crate::log; +use crate::{ + cmd::{ + transpose::{canonicalize, AutoFixer, Dep, Op, Version, VersionReq}, + CargoArgs, GlobalArgs, + }, + grammar::{plural, plural_or}, }; - -/// Transpose dependencies in the workspace. -#[derive(Debug, clap::Parser)] -pub struct TransposeCmd { - #[clap(subcommand)] - subcommand: TransposeSubCmd, -} - -impl TransposeCmd { - pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { - match &self.subcommand { - TransposeSubCmd::Dependency(cmd) => cmd.run(global), - TransposeSubCmd::Features(cmd) => { - cmd.run(global); - Ok(()) - }, - } - } -} - -/// Sub-commands of the [Transpose](TransposeCmd) command. -#[derive(Debug, clap::Subcommand)] -pub enum TransposeSubCmd { - #[clap(alias = "dep", alias = "d")] - Dependency(DependencyCmd), - #[clap(alias = "f")] - Features(FeaturesCmd), -} - -#[derive(Debug, clap::Parser)] -pub struct DependencyCmd { - #[clap(subcommand)] - subcommand: DependencySubCmd, -} - -impl DependencyCmd { - pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { - match &self.subcommand { - DependencySubCmd::LiftToWorkspace(cmd) => cmd.run(global), - } - } -} - -#[derive(Debug, clap::Parser)] -pub struct FeaturesCmd { - #[clap(subcommand)] - subcommand: FeaturesSubCmd, -} - -impl FeaturesCmd { - pub fn run(&self, global: &GlobalArgs) { - match &self.subcommand { - FeaturesSubCmd::StripDevOnly(cmd) => cmd.run(global), - } - } -} - -#[derive(Debug, clap::Subcommand)] -pub enum DependencySubCmd { - #[clap(alias = "lift", alias = "l")] - LiftToWorkspace(LiftToWorkspaceCmd), -} - -#[derive(Debug, clap::Subcommand)] -pub enum FeaturesSubCmd { - /// Strip out dev dependencies. - StripDevOnly(StripDevDepsCmd), -} +use cargo_metadata::Package; +use itertools::Itertools; +use std::collections::{BTreeMap as Map, HashMap}; /// Lift up a dependency to the workspace and reference it from all packages. #[derive(Debug, clap::Parser)] pub struct LiftToWorkspaceCmd { #[allow(missing_docs)] #[clap(flatten)] - cargo_args: super::CargoArgs, + cargo_args: CargoArgs, #[clap(index(1))] - dependency: String, + dependencies: Vec, /// Instead of dry-running, actually modify the files. #[clap(long)] @@ -116,42 +49,137 @@ pub enum VersionResolveMode { Latest, } -#[derive(Debug, clap::Parser)] -pub struct StripDevDepsCmd { - #[allow(missing_docs)] - #[clap(flatten)] - cargo_args: super::CargoArgs, - - /// Only consider these packages. - #[clap(long, short = 'p', value_delimiter = ',', verbatim_doc_comment)] - packages: Option>, -} - impl LiftToWorkspaceCmd { pub fn run(&self, g: &GlobalArgs) -> Result<(), String> { g.warn_unstable(); + self.validate_args()?; + + let meta = self.cargo_args.clone().with_workspace(true).load_metadata()?; + let mut fixers = Map::new(); + + for dep in &self.dependencies { + self.run_for_dependency(g, &meta, dep, &mut fixers)?; + } + self.try_apply_changes(&mut fixers) + } + + fn validate_args(&self) -> Result<(), String> { if self.exact_version.is_some() && self.version_resolver != VersionResolveMode::Exact { return Err("Cannot use --exact-version without --version-resolver=exact".to_string()) } + Ok(()) + } - let meta = self.cargo_args.clone().with_workspace(true).load_metadata()?; - log::debug!("Scanning workspace for '{}'", self.dependency); - // version -> crate - let mut by_version = HashMap::>::new(); + fn try_apply_changes( + &self, + fixers: &mut Map, AutoFixer)>, + ) -> Result<(), String> { + let mut modified = 0; + for (_pkg, fixer) in fixers.values_mut() { + if !fixer.modified() { + continue + } + + modified += 1; + if self.fix { + fixer.save()?; + } else if let Some(_pkg) = _pkg { + log::debug!("Would modify {:?}", _pkg.name); + } else { + log::debug!("Would modify the workspace"); + } + } + if modified > 0 && !self.fix { + let s = plural(modified); + Err(format!( + "Held back modifications to {modified} file{s}. Re-run with --fix to apply." + )) + } else { + Ok(()) + } + } + + fn run_for_dependency( + &self, + g: &GlobalArgs, + meta: &cargo_metadata::Metadata, + dep: &str, + fixers: &mut Map, AutoFixer)>, + ) -> Result<(), String> { + let by_version = Self::build_version_index(meta, dep); + let versions = by_version.keys().collect::>(); + let best_version = self.find_best_version(g, dep, &versions, &by_version)?; + log::info!( + "Selected '{} {}'", //: N={}, D={}, B={})", + dep, + &best_version, + ); + + for (pkg, dep) in by_version.values().flatten() { + let krate_path = canonicalize(pkg.manifest_path.clone().into_std_path_buf()).unwrap(); + let allowed_dir = canonicalize(meta.workspace_root.as_std_path()).unwrap(); + + if !krate_path.starts_with(&allowed_dir) { + log::info!( + "Skipping path outside of the workspace: {:?} (not in {:?})", + krate_path.display(), + allowed_dir.display() + ); + continue + } + + fixers.entry(pkg.name.clone()).or_insert_with(|| { + (Some(pkg.clone()), AutoFixer::from_manifest(&krate_path).unwrap()) + }); + let (_, fixer) = fixers.get_mut(&pkg.name).unwrap(); + + let default_feats = dep.uses_default_features.then_some(true); + fixer.lift_dependency(&dep.name, default_feats)?; + } + + // Now create fixer for the root package + let root_manifest_path = meta.workspace_root.join("Cargo.toml"); + fixers.entry("workspace".to_string()).or_insert_with(|| { + (None, AutoFixer::from_manifest(&root_manifest_path.into_std_path_buf()).unwrap()) + }); + let (_, workspace_fixer) = fixers.get_mut("workspace").unwrap(); + + let mut dep = by_version.values().next().unwrap().first().unwrap().1.clone(); + dep.req = best_version.parse().unwrap(); + // We always add `default-features = false` into the workspace: + workspace_fixer.add_workspace_dep(&dep, false)?; + + Ok(()) + } + + /// Index what versions of a crate are used in the workspace. + fn build_version_index( + meta: &cargo_metadata::Metadata, + name: &str, + ) -> HashMap> { + let mut by_version = HashMap::>::new(); for pkg in meta.packages.iter() { for dep in pkg.dependencies.iter() { - if dep.name != self.dependency { + if dep.name != name { continue } by_version.entry(dep.req.clone()).or_default().push((pkg.clone(), dep.clone())); } } + by_version + } - let versions = by_version.keys().collect::>(); - let best_version = match self.version_resolver { + fn find_best_version( + &self, + g: &GlobalArgs, + name: &str, + versions: &[&VersionReq], + by_version: &HashMap>, + ) -> Result { + let found = match self.version_resolver { VersionResolveMode::Exact => self.exact_version.clone().expect("Checked by clippy"), VersionResolveMode::Latest => try_find_latest(by_version.keys())?.to_string(), VersionResolveMode::Unambiguous => { @@ -187,11 +215,11 @@ impl LiftToWorkspaceCmd { }, }; - let hint = format!("cargo upgrade -p {}@{version_hint}", &self.dependency); + let hint = format!("cargo upgrade -p {}@{version_hint}", name); return Err(format!( "\nFound {} different versions of '{}' in the workspace:\n\n{err}\nHint: {}\n", versions.len(), - &self.dependency, + name, g.bold(&hint), )) } else { @@ -199,74 +227,7 @@ impl LiftToWorkspaceCmd { } }, }; - - log::info!( - "Selected '{} {}'", //: N={}, D={}, B={})", - &self.dependency, - &best_version, - ); - - let mut fixers = Map::new(); - for (pkg, dep) in by_version.values().flatten() { - let krate_path = canonicalize(pkg.manifest_path.clone().into_std_path_buf()).unwrap(); - let allowed_dir = canonicalize(meta.workspace_root.as_std_path()).unwrap(); - - if !krate_path.starts_with(&allowed_dir) { - log::info!( - "Skipping path outside of the workspace: {:?} (not in {:?})", - krate_path.display(), - allowed_dir.display() - ); - continue - } - - fixers - .entry(pkg.name.clone()) - .or_insert_with(|| (pkg, AutoFixer::from_manifest(&krate_path).unwrap())); - let (_, fixer) = fixers.get_mut(&pkg.name).unwrap(); - - let default_feats = dep.uses_default_features.then_some(true); - fixer.lift_dependency(&dep.name, default_feats)?; - } - - // Now create fixer for the root package - let root_manifest_path = meta.workspace_root.join("Cargo.toml"); - let mut fixer = AutoFixer::from_manifest(&root_manifest_path.into_std_path_buf())?; - let mut dep = by_version.values().next().unwrap().first().unwrap().1.clone(); - dep.req = best_version.parse().unwrap(); - // We always add `default-features = false` into the workspace: - fixer.add_workspace_dep(&dep, false)?; - - let mut modified = 0; - for (_pkg, fixer) in fixers.values_mut() { - if !fixer.modified() { - continue - } - - modified += 1; - if self.fix { - fixer.save()?; - } else { - log::debug!("Would modify {:?}", _pkg.name); - } - } - if fixer.modified() { - modified += 1; - log::debug!("Would modify the workspace"); - - if self.fix { - fixer.save()?; - } - } - - if modified > 0 && !self.fix { - let s = plural(modified); - Err(format!( - "Held back modifications to {modified} file{s}; re-run with --fix to apply." - )) - } else { - Ok(()) - } + Ok(found) } } @@ -298,64 +259,3 @@ fn try_find_latest<'a, I: Iterator>(reqs: I) -> Result>(); - - for dep in only_dev.iter() { - // Account for renamed crates: - let Some(dep) = resolve_dep(pkg, dep, &meta) else { - eprintln!("Could not resolve dependency '{}'", g.red(&dep.name)); - std::process::exit(1); - }; - - fixer.remove_feature(&format!("{}/", dep.name())); - fixer.remove_feature(&format!("{}?/", dep.name())); - } - - if fixer.modified() { - fixers.insert(pkg.name.clone(), fixer); - } - } - - for fixer in fixers.values_mut() { - fixer.save().unwrap(); - } - } -} diff --git a/src/cmd/transpose/mod.rs b/src/cmd/transpose/mod.rs new file mode 100644 index 0000000..2634977 --- /dev/null +++ b/src/cmd/transpose/mod.rs @@ -0,0 +1,154 @@ +// SPDX-License-Identifier: GPL-3.0-only +// SPDX-FileCopyrightText: Oliver Tale-Yazdi + +mod lift_to_workspace; + +use super::GlobalArgs; +use crate::{ + autofix::*, + cmd::{resolve_dep, transpose::lift_to_workspace::LiftToWorkspaceCmd}, +}; + +use cargo_metadata::{Dependency as Dep, DependencyKind}; +use semver::{Op, Version, VersionReq}; +use std::{collections::BTreeMap as Map, fs::canonicalize}; + +/// Transpose dependencies in the workspace. +#[derive(Debug, clap::Parser)] +pub struct TransposeCmd { + #[clap(subcommand)] + subcommand: TransposeSubCmd, +} + +impl TransposeCmd { + pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { + match &self.subcommand { + TransposeSubCmd::Dependency(cmd) => cmd.run(global), + TransposeSubCmd::Features(cmd) => { + cmd.run(global); + Ok(()) + }, + } + } +} + +/// Sub-commands of the [Transpose](TransposeCmd) command. +#[derive(Debug, clap::Subcommand)] +pub enum TransposeSubCmd { + #[clap(alias = "dep", alias = "d")] + Dependency(DependencyCmd), + #[clap(alias = "f")] + Features(FeaturesCmd), +} + +#[derive(Debug, clap::Parser)] +pub struct DependencyCmd { + #[clap(subcommand)] + subcommand: DependencySubCmd, +} + +impl DependencyCmd { + pub fn run(&self, global: &GlobalArgs) -> Result<(), String> { + match &self.subcommand { + DependencySubCmd::LiftToWorkspace(cmd) => cmd.run(global), + } + } +} + +#[derive(Debug, clap::Parser)] +pub struct FeaturesCmd { + #[clap(subcommand)] + subcommand: FeaturesSubCmd, +} + +impl FeaturesCmd { + pub fn run(&self, global: &GlobalArgs) { + match &self.subcommand { + FeaturesSubCmd::StripDevOnly(cmd) => cmd.run(global), + } + } +} + +#[derive(Debug, clap::Subcommand)] +pub enum DependencySubCmd { + #[clap(alias = "lift", alias = "l")] + LiftToWorkspace(LiftToWorkspaceCmd), +} + +#[derive(Debug, clap::Subcommand)] +pub enum FeaturesSubCmd { + /// Strip out dev dependencies. + StripDevOnly(StripDevDepsCmd), +} + +#[derive(Debug, clap::Parser)] +pub struct StripDevDepsCmd { + #[allow(missing_docs)] + #[clap(flatten)] + cargo_args: super::CargoArgs, + + /// Only consider these packages. + #[clap(long, short = 'p', value_delimiter = ',', verbatim_doc_comment)] + packages: Option>, +} + +impl StripDevDepsCmd { + pub fn run(&self, g: &GlobalArgs) { + g.warn_unstable(); + let meta = self.cargo_args.load_metadata().expect("Loads metadata"); + + let kind = DependencyKind::Development; + // Allowed dir that we can write to. + let allowed_dir = canonicalize(meta.workspace_root.as_std_path()).unwrap(); + + for name in self.packages.iter().flatten() { + if !meta.packages.iter().any(|p| p.name == *name) { + eprintln!("Could not find package named '{}'", g.red(name)); + std::process::exit(1); + } + } + + let mut fixers = Map::new(); + for pkg in meta.packages.iter() { + if let Some(packages) = &self.packages { + if !packages.contains(&pkg.name) { + continue + } + } + + // Are we allowed to modify this file path? + let krate_path = canonicalize(pkg.manifest_path.clone().into_std_path_buf()).unwrap(); + if !krate_path.starts_with(&allowed_dir) { + continue + } + let mut fixer = AutoFixer::from_manifest(&krate_path).unwrap(); + + // Find all dependencies that are only used as dev dependencies in this package. + let devs = pkg.dependencies.iter().filter(|d| d.kind == kind); + let only_dev = devs + .filter(|dev| { + pkg.dependencies.iter().filter(|d| d.name == dev.name).all(|d| d.kind == kind) + }) + .collect::>(); + + for dep in only_dev.iter() { + // Account for renamed crates: + let Some(dep) = resolve_dep(pkg, dep, &meta) else { + eprintln!("Could not resolve dependency '{}'", g.red(&dep.name)); + std::process::exit(1); + }; + + fixer.remove_feature(&format!("{}/", dep.name())); + fixer.remove_feature(&format!("{}?/", dep.name())); + } + + if fixer.modified() { + fixers.insert(pkg.name.clone(), fixer); + } + } + + for fixer in fixers.values_mut() { + fixer.save().unwrap(); + } + } +} diff --git a/tests/integration/sdk/transpose.yaml b/tests/integration/sdk/transpose.yaml index 0ad4bd5..553cbcf 100644 --- a/tests/integration/sdk/transpose.yaml +++ b/tests/integration/sdk/transpose.yaml @@ -51,7 +51,7 @@ cases: - cmd: transpose dependency lift-to-workspace log --version-resolver latest stderr: | [WARN] Unstable feature - do not rely on this! - Held back modifications to 200 files; re-run with --fix to apply. + Held back modifications to 200 files. Re-run with --fix to apply. Error: () code: 1 - cmd: transpose dependency lift-to-workspace log --version-resolver exact @@ -59,7 +59,7 @@ cases: error: the following required arguments were not provided: --exact-version - Usage: zepter transpose dependency lift-to-workspace --exact-version --version-resolver --manifest-path --log --offline + Usage: zepter transpose dependency lift-to-workspace --exact-version --version-resolver --manifest-path --log --offline ... For more information, try '--help'. code: 2 @@ -72,15 +72,141 @@ cases: - cmd: transpose dependency lift-to-workspace log --version-resolver exact --exact-version 0.4.20 stderr: | [WARN] Unstable feature - do not rely on this! - Held back modifications to 200 files; re-run with --fix to apply. + Held back modifications to 200 files. Re-run with --fix to apply. Error: () code: 1 - cmd: zepter transpose dependency lift-to-workspace macro_magic stderr: | [WARN] Unstable feature - do not rely on this! - Held back modifications to 3 files; re-run with --fix to apply. + Held back modifications to 3 files. Re-run with --fix to apply. Error: () code: 1 +- cmd: zepter transpose dependency lift-to-workspace --version-resolver latest --fix docify tt-call + stderr: | + [WARN] Unstable feature - do not rely on this! + diff: | + diff --git Cargo.toml Cargo.toml + index e807171b24..9520d7ded5 100644 + --- Cargo.toml + +++ Cargo.toml + @@ -537,0 +538,2 @@ polkavm-derive = "0.8.0" + +docify = { version = "0.2.7", default-features = false } + +tt-call = { version = "1.0.8", default-features = false } + diff --git docs/sdk/Cargo.toml docs/sdk/Cargo.toml + index c998a60148..69001efd3f 100644 + --- docs/sdk/Cargo.toml + +++ docs/sdk/Cargo.toml + @@ -26 +26 @@ simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/client/chain-spec/Cargo.toml substrate/client/chain-spec/Cargo.toml + index 9ab12dc2ad..1142993886 100644 + --- substrate/client/chain-spec/Cargo.toml + +++ substrate/client/chain-spec/Cargo.toml + @@ -37 +37 @@ array-bytes = { version = "6.1" } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/Cargo.toml substrate/frame/Cargo.toml + index 9419eb1597..c9fad44fd9 100644 + --- substrate/frame/Cargo.toml + +++ substrate/frame/Cargo.toml + @@ -50 +50 @@ frame-system-rpc-runtime-api = { default-features = false, path = "../frame/syst + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/bags-list/Cargo.toml substrate/frame/bags-list/Cargo.toml + index b8ab099a06..312fd9dabd 100644 + --- substrate/frame/bags-list/Cargo.toml + +++ substrate/frame/bags-list/Cargo.toml + @@ -37 +37 @@ log = { version = "0.4.17", default-features = false } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/balances/Cargo.toml substrate/frame/balances/Cargo.toml + index e47e916a27..d6913feda6 100644 + --- substrate/frame/balances/Cargo.toml + +++ substrate/frame/balances/Cargo.toml + @@ -27 +27 @@ sp-std = { path = "../../primitives/std", default-features = false } + -docify = "0.2.6" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/fast-unstake/Cargo.toml substrate/frame/fast-unstake/Cargo.toml + index 5d0a5410f8..ff876efc70 100644 + --- substrate/frame/fast-unstake/Cargo.toml + +++ substrate/frame/fast-unstake/Cargo.toml + @@ -33 +33 @@ frame-benchmarking = { path = "../benchmarking", default-features = false, optio + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/paged-list/Cargo.toml substrate/frame/paged-list/Cargo.toml + index 6a2af120f3..81c1fc7b71 100644 + --- substrate/frame/paged-list/Cargo.toml + +++ substrate/frame/paged-list/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/safe-mode/Cargo.toml substrate/frame/safe-mode/Cargo.toml + index 0c59740bef..0f92b88f6a 100644 + --- substrate/frame/safe-mode/Cargo.toml + +++ substrate/frame/safe-mode/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.2.2", default-features = + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/scheduler/Cargo.toml substrate/frame/scheduler/Cargo.toml + index bca17242d2..f56f20a4d3 100644 + --- substrate/frame/scheduler/Cargo.toml + +++ substrate/frame/scheduler/Cargo.toml + @@ -26 +26 @@ sp-weights = { path = "../../primitives/weights", default-features = false } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/sudo/Cargo.toml substrate/frame/sudo/Cargo.toml + index 409104aeca..427d2c532b 100644 + --- substrate/frame/sudo/Cargo.toml + +++ substrate/frame/sudo/Cargo.toml + @@ -28 +28 @@ sp-std = { path = "../../primitives/std", default-features = false } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/support/Cargo.toml substrate/frame/support/Cargo.toml + index ad97ad5146..7947bfdab5 100644 + --- substrate/frame/support/Cargo.toml + +++ substrate/frame/support/Cargo.toml + @@ -36 +36 @@ sp-metadata-ir = { path = "../../primitives/metadata-ir", default-features = fal + -tt-call = "1.0.8" + +tt-call = { workspace = true, default-features = true } + @@ -50 +50 @@ serde_json = { version = "1.0.111", default-features = false, features = ["alloc + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/system/Cargo.toml substrate/frame/system/Cargo.toml + index d409460131..af67af608c 100644 + --- substrate/frame/system/Cargo.toml + +++ substrate/frame/system/Cargo.toml + @@ -31 +31 @@ sp-weights = { path = "../../primitives/weights", default-features = false, feat + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/timestamp/Cargo.toml substrate/frame/timestamp/Cargo.toml + index cd0737c6bb..8e1d4cc709 100644 + --- substrate/frame/timestamp/Cargo.toml + +++ substrate/frame/timestamp/Cargo.toml + @@ -33 +33 @@ sp-timestamp = { path = "../../primitives/timestamp", default-features = false } + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/treasury/Cargo.toml substrate/frame/treasury/Cargo.toml + index 2dc603e9f9..21656344d1 100644 + --- substrate/frame/treasury/Cargo.toml + +++ substrate/frame/treasury/Cargo.toml + @@ -23 +23 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/frame/tx-pause/Cargo.toml substrate/frame/tx-pause/Cargo.toml + index ace2172454..1e7939774d 100644 + --- substrate/frame/tx-pause/Cargo.toml + +++ substrate/frame/tx-pause/Cargo.toml + @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.2.2", default-features = + -docify = "0.2.7" + +docify = { workspace = true, default-features = true } + diff --git substrate/primitives/runtime/Cargo.toml substrate/primitives/runtime/Cargo.toml + index f4b1158242..7ee6da716d 100644 + --- substrate/primitives/runtime/Cargo.toml + +++ substrate/primitives/runtime/Cargo.toml + @@ -35 +35 @@ sp-weights = { path = "../weights", default-features = false } + -docify = { version = "0.2.7" } + +docify = { workspace = true, default-features = true } - cmd: zepter transpose dependency lift-to-workspace tt-call --version-resolver latest --fix stderr: | [WARN] Unstable feature - do not rely on this! diff --git a/tests/ui/config/v1/basic.yaml b/tests/ui/config/v1/basic.yaml index 57802b5..c423a95 100644 --- a/tests/ui/config/v1/basic.yaml +++ b/tests/ui/config/v1/basic.yaml @@ -3,25 +3,25 @@ crates: cases: - cmd: run default stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: '' stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run my_version stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'my_version' [INFO] 1/1 --version @@ -36,7 +36,7 @@ cases: [INFO] 1/1 debug --no-benchmark - cmd: run both stdout: | - zepter 1.1.2 + zepter 1.2.0 Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 diff --git a/tests/ui/config/v1/finds_all.yaml b/tests/ui/config/v1/finds_all.yaml index 363a88b..f595905 100644 --- a/tests/ui/config/v1/finds_all.yaml +++ b/tests/ui/config/v1/finds_all.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: '' stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -19,7 +19,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -35,7 +35,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -51,7 +51,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -67,7 +67,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -83,7 +83,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -99,7 +99,7 @@ cases: - [ '--version' ] - cmd: run default --config .cargo/polkadot.yaml stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -115,7 +115,7 @@ cases: - [ '--version' ] - cmd: run default -c .cargo/polkadot.yaml stdout: | - zepter 1.1.2 + zepter 1.2.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version diff --git a/tests/ui/config/v1/version_bin.yaml b/tests/ui/config/v1/version_bin.yaml index fb3d175..fb4b088 100644 --- a/tests/ui/config/v1/version_bin.yaml +++ b/tests/ui/config/v1/version_bin.yaml @@ -4,7 +4,7 @@ cases: - cmd: run default stderr: | thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.2.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 - cmd: run default --check-cfg-compatibility=off @@ -13,7 +13,7 @@ cases: stderr: | [INFO] Running workflow 'default' thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.1.2. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.2.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 1 configs: diff --git a/tests/ui/root-args/version.yaml b/tests/ui/root-args/version.yaml index 73b9942..cd0df82 100644 --- a/tests/ui/root-args/version.yaml +++ b/tests/ui/root-args/version.yaml @@ -2,7 +2,7 @@ crates: [] cases: - cmd: --version stdout: | - zepter 1.1.2 + zepter 1.2.0 - cmd: -V stdout: | - zepter 1.1.2 + zepter 1.2.0 From eb1bd05be2a284915e32901024e59f7548379cbe Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 16 Feb 2024 19:28:08 +0100 Subject: [PATCH 08/13] Improve `transpose` command (#81) * Nicer print and refactor Signed-off-by: Oliver Tale-Yazdi * Improve transpose command Signed-off-by: Oliver Tale-Yazdi * Bump to 1.3.0 Signed-off-by: Oliver Tale-Yazdi * clippy Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- Cargo.lock | 3 +- Cargo.toml | 3 +- src/autofix.rs | 10 +- src/cmd/mod.rs | 19 +++- src/cmd/transpose/lift_to_workspace.rs | 130 ++++++++++++++++------- src/tests.rs | 16 +-- tests/integration/sdk/transpose.yaml | 139 ++++++++++--------------- tests/ui/config/v1/basic.yaml | 10 +- tests/ui/config/v1/finds_all.yaml | 16 +-- tests/ui/config/v1/version_bin.yaml | 4 +- tests/ui/root-args/version.yaml | 4 +- 11 files changed, 200 insertions(+), 154 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f824bfb..7904ec0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1487,7 +1487,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zepter" -version = "1.2.0" +version = "1.3.0" dependencies = [ "anyhow", "assert_cmd", @@ -1503,6 +1503,7 @@ dependencies = [ "log", "pretty_assertions", "rand", + "regex", "rstest", "semver", "serde", diff --git a/Cargo.toml b/Cargo.toml index 6a45922..f608c5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zepter" -version = "1.2.0" +version = "1.3.0" edition = "2021" authors = [ "Oliver Tale-Yazdi" ] description = "Analyze, Fix and Format features in your Rust workspace." @@ -28,6 +28,7 @@ env_logger = { version = "0.11.1", features = [ "auto-color", "humantime" ], opt histo = { version = "1.0.0", optional = true } itertools = "0.12.1" log = { version = "0.4.20", optional = true } +regex = "1.10.3" semver = "1" serde = "1.0.196" serde_json = { version = "1.0.113", optional = true } diff --git a/src/autofix.rs b/src/autofix.rs index f5d351e..3d40634 100644 --- a/src/autofix.rs +++ b/src/autofix.rs @@ -26,11 +26,11 @@ pub struct AutoFixer { } impl AutoFixer { - pub fn from_manifest(manifest: &Path) -> Result { - let raw = std::fs::read_to_string(manifest) + pub fn from_manifest>(manifest: P) -> Result { + let raw = std::fs::read_to_string(&manifest) .map_err(|e| format!("Failed to read manifest: {e}"))?; let doc = raw.parse::().map_err(|e| format!("Failed to parse manifest: {e}"))?; - Ok(Self { raw, manifest: Some(manifest.to_path_buf()), doc: Some(doc) }) + Ok(Self { raw, manifest: Some(manifest.as_ref().to_path_buf()), doc: Some(doc) }) } pub fn from_raw(raw: &str) -> Result { @@ -567,7 +567,9 @@ impl AutoFixer { } t.insert("version", Value::String(Formatted::new(version_str))); - t.insert("default-features", Value::Boolean(Formatted::new(default_feats))); + if !default_feats { + t.insert("default-features", Value::Boolean(Formatted::new(default_feats))); + } deps.insert(dep_name, Item::Value(Value::InlineTable(t))); diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index 2131fca..153b490 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -10,9 +10,10 @@ pub mod run; pub mod trace; pub mod transpose; -use crate::log; +use crate::{log, ErrToStr}; use cargo_metadata::{Dependency, Metadata, MetadataCommand, Package, Resolve}; +use std::{fs::canonicalize, path::Path}; /// See out how Rust dependencies and features are enabled. #[derive(Debug, clap::Parser)] @@ -363,3 +364,19 @@ where let pos = s.find(':').ok_or_else(|| format!("invalid KEY=value: no `:` found in `{s}`"))?; Ok((s[..pos].parse()?, s[pos + 1..].parse()?)) } + +pub(crate) fn check_can_modify>(root: P, modify: P) -> Result { + let root = canonicalize(root).err_to_str()?; + let modify = canonicalize(modify).err_to_str()?; + + if !modify.starts_with(&root) { + format!( + "Path is outside of the workspace: {:?} (not in {:?})", + modify.display(), + root.display() + ); + Ok(false) + } else { + Ok(true) + } +} diff --git a/src/cmd/transpose/lift_to_workspace.rs b/src/cmd/transpose/lift_to_workspace.rs index 9e77a3f..e20798e 100644 --- a/src/cmd/transpose/lift_to_workspace.rs +++ b/src/cmd/transpose/lift_to_workspace.rs @@ -1,17 +1,19 @@ // SPDX-License-Identifier: GPL-3.0-only // SPDX-FileCopyrightText: Oliver Tale-Yazdi -use crate::log; use crate::{ cmd::{ - transpose::{canonicalize, AutoFixer, Dep, Op, Version, VersionReq}, + check_can_modify, + transpose::{AutoFixer, Dep, Op, Version, VersionReq}, CargoArgs, GlobalArgs, }, grammar::{plural, plural_or}, + log, ErrToStr, }; + use cargo_metadata::Package; use itertools::Itertools; -use std::collections::{BTreeMap as Map, HashMap}; +use std::collections::{BTreeMap as Map, BTreeSet, HashMap}; /// Lift up a dependency to the workspace and reference it from all packages. #[derive(Debug, clap::Parser)] @@ -34,6 +36,10 @@ pub struct LiftToWorkspaceCmd { /// The exact version to use for the whole workspace. #[clap(long)] exact_version: Option, + + /// Ignore errors and continue with the next dependency. + #[clap(long)] + ignore_errors: bool, } /// How to determine which version to use for the whole workspace. @@ -45,8 +51,8 @@ pub enum VersionResolveMode { Exact, /// The latest version that was seen in the workspace. /// - /// This is *not* the latest version from crates-io. - Latest, + /// The highest version number that it found. + Highest, } impl LiftToWorkspaceCmd { @@ -57,8 +63,34 @@ impl LiftToWorkspaceCmd { let meta = self.cargo_args.clone().with_workspace(true).load_metadata()?; let mut fixers = Map::new(); - for dep in &self.dependencies { - self.run_for_dependency(g, &meta, dep, &mut fixers)?; + // TODO optimize to not be O^3 + let mut dependencies = BTreeSet::<&str>::new(); + let mut regex_lookup = Map::new(); + for filter in self.dependencies.iter() { + if let Some(regex) = filter.strip_prefix("regex:") { + regex_lookup.insert(regex, regex::Regex::new(regex).err_to_str()?); + } + } + + for pkg in meta.packages.iter() { + for dep in pkg.dependencies.iter() { + if regex_lookup.values().any(|r| r.is_match(&dep.name)) || + self.dependencies.contains(&dep.name) + { + dependencies.insert(&dep.name); + } + } + } + + log::info!("Scanning for {} dependencies in the workspace.", dependencies.len()); + for dep in &dependencies { + match self.run_for_dependency(g, &meta, dep, &mut fixers) { + Ok(()) => (), + Err(e) if self.ignore_errors => { + log::error!("Failed to lift up '{}': {}", dep, e); + }, + Err(e) => return Err(format!("Failed to lift up '{}': {}", dep, e)), + } } self.try_apply_changes(&mut fixers) @@ -96,6 +128,7 @@ impl LiftToWorkspaceCmd { "Held back modifications to {modified} file{s}. Re-run with --fix to apply." )) } else { + log::info!("Modified {} manifest{}.", modified, plural(modified)); Ok(()) } } @@ -104,52 +137,66 @@ impl LiftToWorkspaceCmd { &self, g: &GlobalArgs, meta: &cargo_metadata::Metadata, - dep: &str, + name: &str, fixers: &mut Map, AutoFixer)>, ) -> Result<(), String> { - let by_version = Self::build_version_index(meta, dep); + let by_version = Self::build_version_index(meta, name); let versions = by_version.keys().collect::>(); - let best_version = self.find_best_version(g, dep, &versions, &by_version)?; + let best_version = self.find_best_version(g, name, &versions, &by_version)?; - log::info!( - "Selected '{} {}'", //: N={}, D={}, B={})", - dep, - &best_version, - ); + let mut all_use_default_features = true; + for (pkg, dep) in by_version.values().flatten() { + if !check_can_modify(&meta.workspace_root, &pkg.manifest_path)? { + continue + } + + all_use_default_features &= dep.uses_default_features; + } + + // We default in the workspace to enabling them if all packages use them but otherwise turn + // them off. + let workspace_default_features_enabled = all_use_default_features; for (pkg, dep) in by_version.values().flatten() { - let krate_path = canonicalize(pkg.manifest_path.clone().into_std_path_buf()).unwrap(); - let allowed_dir = canonicalize(meta.workspace_root.as_std_path()).unwrap(); - - if !krate_path.starts_with(&allowed_dir) { - log::info!( - "Skipping path outside of the workspace: {:?} (not in {:?})", - krate_path.display(), - allowed_dir.display() - ); + if !check_can_modify(&meta.workspace_root, &pkg.manifest_path)? { continue } fixers.entry(pkg.name.clone()).or_insert_with(|| { - (Some(pkg.clone()), AutoFixer::from_manifest(&krate_path).unwrap()) + (Some(pkg.clone()), AutoFixer::from_manifest(&pkg.manifest_path).unwrap()) }); let (_, fixer) = fixers.get_mut(&pkg.name).unwrap(); - let default_feats = dep.uses_default_features.then_some(true); - fixer.lift_dependency(&dep.name, default_feats)?; + if dep.uses_default_features != workspace_default_features_enabled { + fixer.lift_dependency(&dep.name, Some(dep.uses_default_features))?; + } else { + fixer.lift_dependency(&dep.name, None)?; + } } // Now create fixer for the root package let root_manifest_path = meta.workspace_root.join("Cargo.toml"); - fixers.entry("workspace".to_string()).or_insert_with(|| { - (None, AutoFixer::from_manifest(&root_manifest_path.into_std_path_buf()).unwrap()) - }); - let (_, workspace_fixer) = fixers.get_mut("workspace").unwrap(); + fixers + .entry("magic:workspace".to_string()) + .or_insert_with(|| (None, AutoFixer::from_manifest(&root_manifest_path).unwrap())); + let (_, workspace_fixer) = fixers.get_mut("magic:workspace").unwrap(); let mut dep = by_version.values().next().unwrap().first().unwrap().1.clone(); dep.req = best_version.parse().unwrap(); - // We always add `default-features = false` into the workspace: - workspace_fixer.add_workspace_dep(&dep, false)?; + + workspace_fixer.add_workspace_dep(&dep, workspace_default_features_enabled)?; + + #[cfg(feature = "logging")] + { + let total_changes = by_version.values().map(|v| v.len()).sum::(); + let v = format!("{} {}", name, &best_version); + log::info!( + "Selected {} for lift up in {} crate{}.", + g.bold(&v), + total_changes, + plural(total_changes) + ); + } Ok(()) } @@ -181,7 +228,7 @@ impl LiftToWorkspaceCmd { ) -> Result { let found = match self.version_resolver { VersionResolveMode::Exact => self.exact_version.clone().expect("Checked by clippy"), - VersionResolveMode::Latest => try_find_latest(by_version.keys())?.to_string(), + VersionResolveMode::Highest => try_find_latest(by_version.keys())?, VersionResolveMode::Unambiguous => { if versions.len() > 1 { let str_width = versions.iter().map(|v| v.to_string().len()).max().unwrap(); @@ -208,7 +255,7 @@ impl LiftToWorkspaceCmd { } let version_hint = match try_find_latest(by_version.keys()) { - Ok(latest) => latest.to_string(), + Ok(latest) => latest, Err(_e) => { log::warn!("Could not find determine latest common version: {}", _e); "version".to_string() @@ -231,7 +278,16 @@ impl LiftToWorkspaceCmd { } } -fn try_find_latest<'a, I: Iterator>(reqs: I) -> Result { +fn try_find_latest<'a, I: Iterator>(reqs: I) -> Result { + let reqs = reqs.collect::>(); + + if reqs.is_empty() { + return Err("No versions found".to_string()) + } + if reqs.iter().all(|r| r == &reqs[0]) { + return Ok(reqs[0].to_string()) + } + let mut versions = Vec::::new(); // Try to convert each to a version. This is done as best-effort: @@ -257,5 +313,5 @@ fn try_find_latest<'a, I: Iterator>(reqs: I) -> Result { res.unwrap(); - pretty_assertions::assert_str_eq!(fixer.to_string(), modify.unwrap_or(input)); + pretty_assertions::assert_str_eq!(modify.unwrap_or(input), fixer.to_string()); }, Err(modify) => { assert_eq!(res, Err(modify.into())); diff --git a/tests/integration/sdk/transpose.yaml b/tests/integration/sdk/transpose.yaml index 553cbcf..807cdd0 100644 --- a/tests/integration/sdk/transpose.yaml +++ b/tests/integration/sdk/transpose.yaml @@ -3,52 +3,21 @@ repo: ref: 7df1ae3b8111d534cce108b2b405b6a33fcdedc3 cases: - cmd: transpose dependency lift-to-workspace parity-scale-codec - stderr: | - [WARN] Unstable feature - do not rely on this! - - Found 7 different versions of 'parity-scale-codec' in the workspace: - - ^3.6.1: 260 times (frame-support, sp-api, sp-core, …) - ^3.0.0: 58 times (pallet-broker, bridge-hub-common, cumulus-primitives-core, …) - ^3.1.5: 20 times (bridge-runtime-common, bp-header-chain, bp-runtime, …) - ^3.4.0: 6 times (emulated-integration-tests-common, asset-hub-rococo-integration-tests, asset-hub-westend-integration-tests, …) - ^3.2.2: 6 times (pallet-asset-conversion-tx-payment, pallet-safe-mode, pallet-tx-pause, …) - ^3.6.4: 4 times (cumulus-relay-chain-interface, polkadot-node-core-prospective-parachains, cumulus-relay-chain-rpc-interface, …) - ^3.6.5: 1 time (polkadot-sdk-docs) - - Hint: cargo upgrade -p parity-scale-codec@3.6.5 - - Error: () + stderr: "[WARN] Unstable feature - do not rely on this!\nFailed to lift up 'parity-scale-codec': \nFound 7 different versions of 'parity-scale-codec' in the workspace:\n\n ^3.6.1: 260 times (frame-support, sp-api, sp-core, …)\n ^3.0.0: 58 times (pallet-broker, bridge-hub-common, cumulus-primitives-core, …)\n ^3.1.5: 20 times (bridge-runtime-common, bp-header-chain, bp-runtime, …)\n ^3.4.0: 6 times (emulated-integration-tests-common, asset-hub-rococo-integration-tests, asset-hub-westend-integration-tests, …)\n ^3.2.2: 6 times (pallet-asset-conversion-tx-payment, pallet-safe-mode, pallet-tx-pause, …)\n ^3.6.4: 4 times (cumulus-relay-chain-interface, polkadot-node-core-prospective-parachains, cumulus-relay-chain-rpc-interface, …)\n ^3.6.5: 1 time (polkadot-sdk-docs)\n\nHint: cargo upgrade -p parity-scale-codec@3.6.5\n\nError: ()\n" code: 1 - cmd: transpose dependency lift-to-workspace log - stderr: | - [WARN] Unstable feature - do not rely on this! - - Found 8 different versions of 'log' in the workspace: - - ^0.4.17: 142 times (frame-support, sp-api, sp-core, …) - ^0.4.20: 37 times (bridge-runtime-common, pallet-bridge-grandpa, pallet-bridge-messages, …) - ^0.4 : 7 times (sc-utils, binary-merkle-tree, pallet-contracts, …) - ^0.4.16: 4 times (sc-network-light, pallet-salary, pallet-ranked-collective, …) - ^0.4.14: 4 times (pallet-alliance, pallet-elections-phragmen, pallet-glutton, …) - ^0.4.19: 2 times (bp-runtime, parachains-common) - ^0.4.0 : 2 times (pallet-nomination-pools, pallet-nomination-pools-test-staking) - ^0.4.8 : 1 time (sc-consensus-grandpa-rpc) - - Hint: cargo upgrade -p log@0.4.20 - - Error: () + stderr: "[WARN] Unstable feature - do not rely on this!\nFailed to lift up 'log': \nFound 8 different versions of 'log' in the workspace:\n\n ^0.4.17: 142 times (frame-support, sp-api, sp-core, …)\n ^0.4.20: 37 times (bridge-runtime-common, pallet-bridge-grandpa, pallet-bridge-messages, …)\n ^0.4 : 7 times (sc-utils, binary-merkle-tree, pallet-contracts, …)\n ^0.4.16: 4 times (sc-network-light, pallet-salary, pallet-ranked-collective, …)\n ^0.4.14: 4 times (pallet-alliance, pallet-elections-phragmen, pallet-glutton, …)\n ^0.4.19: 2 times (bp-runtime, parachains-common)\n ^0.4.0 : 2 times (pallet-nomination-pools, pallet-nomination-pools-test-staking)\n ^0.4.8 : 1 time (sc-consensus-grandpa-rpc)\n\nHint: cargo upgrade -p log@0.4.20\n\nError: ()\n" code: 1 - cmd: transpose dependency lift-to-workspace log --version-resolver Unambiguous stderr: | error: invalid value 'Unambiguous' for '--version-resolver ' - [possible values: unambiguous, exact, latest] + [possible values: unambiguous, exact, highest] tip: a similar value exists: 'unambiguous' For more information, try '--help'. code: 2 -- cmd: transpose dependency lift-to-workspace log --version-resolver latest +- cmd: transpose dependency lift-to-workspace log --version-resolver highest stderr: | [WARN] Unstable feature - do not rely on this! Held back modifications to 200 files. Re-run with --fix to apply. @@ -81,176 +50,176 @@ cases: Held back modifications to 3 files. Re-run with --fix to apply. Error: () code: 1 -- cmd: zepter transpose dependency lift-to-workspace --version-resolver latest --fix docify tt-call +- cmd: zepter transpose dependency lift-to-workspace --version-resolver highest --fix docify tt-call stderr: | [WARN] Unstable feature - do not rely on this! diff: | diff --git Cargo.toml Cargo.toml - index e807171b24..9520d7ded5 100644 + index e807171b24..b881f00e95 100644 --- Cargo.toml +++ Cargo.toml @@ -537,0 +538,2 @@ polkavm-derive = "0.8.0" - +docify = { version = "0.2.7", default-features = false } - +tt-call = { version = "1.0.8", default-features = false } + +docify = { version = "0.2.7" } + +tt-call = { version = "1.0.8" } diff --git docs/sdk/Cargo.toml docs/sdk/Cargo.toml - index c998a60148..69001efd3f 100644 + index c998a60148..d17eb1af01 100644 --- docs/sdk/Cargo.toml +++ docs/sdk/Cargo.toml @@ -26 +26 @@ simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/client/chain-spec/Cargo.toml substrate/client/chain-spec/Cargo.toml - index 9ab12dc2ad..1142993886 100644 + index 9ab12dc2ad..fb403a0acd 100644 --- substrate/client/chain-spec/Cargo.toml +++ substrate/client/chain-spec/Cargo.toml @@ -37 +37 @@ array-bytes = { version = "6.1" } -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/Cargo.toml substrate/frame/Cargo.toml - index 9419eb1597..c9fad44fd9 100644 + index 9419eb1597..816470562a 100644 --- substrate/frame/Cargo.toml +++ substrate/frame/Cargo.toml @@ -50 +50 @@ frame-system-rpc-runtime-api = { default-features = false, path = "../frame/syst -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/bags-list/Cargo.toml substrate/frame/bags-list/Cargo.toml - index b8ab099a06..312fd9dabd 100644 + index b8ab099a06..e2d734eaea 100644 --- substrate/frame/bags-list/Cargo.toml +++ substrate/frame/bags-list/Cargo.toml @@ -37 +37 @@ log = { version = "0.4.17", default-features = false } -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/balances/Cargo.toml substrate/frame/balances/Cargo.toml - index e47e916a27..d6913feda6 100644 + index e47e916a27..0869c00db7 100644 --- substrate/frame/balances/Cargo.toml +++ substrate/frame/balances/Cargo.toml @@ -27 +27 @@ sp-std = { path = "../../primitives/std", default-features = false } -docify = "0.2.6" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/fast-unstake/Cargo.toml substrate/frame/fast-unstake/Cargo.toml - index 5d0a5410f8..ff876efc70 100644 + index 5d0a5410f8..4fd32b75b1 100644 --- substrate/frame/fast-unstake/Cargo.toml +++ substrate/frame/fast-unstake/Cargo.toml @@ -33 +33 @@ frame-benchmarking = { path = "../benchmarking", default-features = false, optio -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/paged-list/Cargo.toml substrate/frame/paged-list/Cargo.toml - index 6a2af120f3..81c1fc7b71 100644 + index 6a2af120f3..0ecdc0fbed 100644 --- substrate/frame/paged-list/Cargo.toml +++ substrate/frame/paged-list/Cargo.toml @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/safe-mode/Cargo.toml substrate/frame/safe-mode/Cargo.toml - index 0c59740bef..0f92b88f6a 100644 + index 0c59740bef..ad415209b2 100644 --- substrate/frame/safe-mode/Cargo.toml +++ substrate/frame/safe-mode/Cargo.toml @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.2.2", default-features = -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/scheduler/Cargo.toml substrate/frame/scheduler/Cargo.toml - index bca17242d2..f56f20a4d3 100644 + index bca17242d2..bdaf873ef2 100644 --- substrate/frame/scheduler/Cargo.toml +++ substrate/frame/scheduler/Cargo.toml @@ -26 +26 @@ sp-weights = { path = "../../primitives/weights", default-features = false } -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/sudo/Cargo.toml substrate/frame/sudo/Cargo.toml - index 409104aeca..427d2c532b 100644 + index 409104aeca..3e5b2647a5 100644 --- substrate/frame/sudo/Cargo.toml +++ substrate/frame/sudo/Cargo.toml @@ -28 +28 @@ sp-std = { path = "../../primitives/std", default-features = false } -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/support/Cargo.toml substrate/frame/support/Cargo.toml - index ad97ad5146..7947bfdab5 100644 + index ad97ad5146..4e45862f5c 100644 --- substrate/frame/support/Cargo.toml +++ substrate/frame/support/Cargo.toml @@ -36 +36 @@ sp-metadata-ir = { path = "../../primitives/metadata-ir", default-features = fal -tt-call = "1.0.8" - +tt-call = { workspace = true, default-features = true } + +tt-call = { workspace = true } @@ -50 +50 @@ serde_json = { version = "1.0.111", default-features = false, features = ["alloc -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/system/Cargo.toml substrate/frame/system/Cargo.toml - index d409460131..af67af608c 100644 + index d409460131..3e0131677a 100644 --- substrate/frame/system/Cargo.toml +++ substrate/frame/system/Cargo.toml @@ -31 +31 @@ sp-weights = { path = "../../primitives/weights", default-features = false, feat -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/timestamp/Cargo.toml substrate/frame/timestamp/Cargo.toml - index cd0737c6bb..8e1d4cc709 100644 + index cd0737c6bb..c21dc9b66a 100644 --- substrate/frame/timestamp/Cargo.toml +++ substrate/frame/timestamp/Cargo.toml @@ -33 +33 @@ sp-timestamp = { path = "../../primitives/timestamp", default-features = false } -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/treasury/Cargo.toml substrate/frame/treasury/Cargo.toml - index 2dc603e9f9..21656344d1 100644 + index 2dc603e9f9..f7a3844789 100644 --- substrate/frame/treasury/Cargo.toml +++ substrate/frame/treasury/Cargo.toml @@ -23 +23 @@ codec = { package = "parity-scale-codec", version = "3.6.1", default-features = -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/frame/tx-pause/Cargo.toml substrate/frame/tx-pause/Cargo.toml - index ace2172454..1e7939774d 100644 + index ace2172454..52759d0b90 100644 --- substrate/frame/tx-pause/Cargo.toml +++ substrate/frame/tx-pause/Cargo.toml @@ -19 +19 @@ codec = { package = "parity-scale-codec", version = "3.2.2", default-features = -docify = "0.2.7" - +docify = { workspace = true, default-features = true } + +docify = { workspace = true } diff --git substrate/primitives/runtime/Cargo.toml substrate/primitives/runtime/Cargo.toml - index f4b1158242..7ee6da716d 100644 + index f4b1158242..e77d9bb8eb 100644 --- substrate/primitives/runtime/Cargo.toml +++ substrate/primitives/runtime/Cargo.toml @@ -35 +35 @@ sp-weights = { path = "../weights", default-features = false } -docify = { version = "0.2.7" } - +docify = { workspace = true, default-features = true } -- cmd: zepter transpose dependency lift-to-workspace tt-call --version-resolver latest --fix + +docify = { workspace = true } +- cmd: zepter transpose dependency lift-to-workspace tt-call --version-resolver highest --fix stderr: | [WARN] Unstable feature - do not rely on this! code: 0 diff: | diff --git Cargo.toml Cargo.toml - index e807171b24..9bf53ed414 100644 + index e807171b24..997e43ec6c 100644 --- Cargo.toml +++ Cargo.toml @@ -537,0 +538 @@ polkavm-derive = "0.8.0" - +tt-call = { version = "1.0.8", default-features = false } + +tt-call = { version = "1.0.8" } diff --git substrate/frame/support/Cargo.toml substrate/frame/support/Cargo.toml - index ad97ad5146..d7b4a66ebd 100644 + index ad97ad5146..035c83ce17 100644 --- substrate/frame/support/Cargo.toml +++ substrate/frame/support/Cargo.toml @@ -36 +36 @@ sp-metadata-ir = { path = "../../primitives/metadata-ir", default-features = fal -tt-call = "1.0.8" - +tt-call = { workspace = true, default-features = true } -- cmd: zepter transpose dependency lift-to-workspace macro_magic --version-resolver latest --fix + +tt-call = { workspace = true } +- cmd: zepter transpose dependency lift-to-workspace macro_magic --version-resolver highest --fix stderr: | [WARN] Unstable feature - do not rely on this! code: 0 diff: | diff --git Cargo.toml Cargo.toml - index e807171b24..de52367e86 100644 + index e807171b24..5adc76a484 100644 --- Cargo.toml +++ Cargo.toml @@ -537,0 +538 @@ polkavm-derive = "0.8.0" - +macro_magic = { version = "0.5.0", default-features = false } + +macro_magic = { version = "0.5.0" } diff --git substrate/frame/support/Cargo.toml substrate/frame/support/Cargo.toml - index ad97ad5146..c4ebb255f2 100644 + index ad97ad5146..0434db31d4 100644 --- substrate/frame/support/Cargo.toml +++ substrate/frame/support/Cargo.toml @@ -37 +37 @@ tt-call = "1.0.8" -macro_magic = "0.5.0" - +macro_magic = { workspace = true, default-features = true } + +macro_magic = { workspace = true } diff --git substrate/frame/support/procedural/Cargo.toml substrate/frame/support/procedural/Cargo.toml - index d77f6595db..6a58a6e136 100644 + index d77f6595db..e2ff98fd7c 100644 --- substrate/frame/support/procedural/Cargo.toml +++ substrate/frame/support/procedural/Cargo.toml @@ -29 +29 @@ frame-support-procedural-tools = { path = "tools" } -macro_magic = { version = "0.5.0", features = ["proc_support"] } - +macro_magic = { features = ["proc_support"] , workspace = true, default-features = true } -- cmd: transpose dependency lift-to-workspace log --version-resolver latest --fix + +macro_magic = { features = ["proc_support"] , workspace = true } +- cmd: transpose dependency lift-to-workspace log --version-resolver highest --fix stderr: | [WARN] Unstable feature - do not rely on this! code: 0 diff --git a/tests/ui/config/v1/basic.yaml b/tests/ui/config/v1/basic.yaml index c423a95..fb8562f 100644 --- a/tests/ui/config/v1/basic.yaml +++ b/tests/ui/config/v1/basic.yaml @@ -3,25 +3,25 @@ crates: cases: - cmd: run default stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: '' stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run my_version stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'my_version' [INFO] 1/1 --version @@ -36,7 +36,7 @@ cases: [INFO] 1/1 debug --no-benchmark - cmd: run both stdout: | - zepter 1.2.0 + zepter 1.3.0 Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 diff --git a/tests/ui/config/v1/finds_all.yaml b/tests/ui/config/v1/finds_all.yaml index f595905..7ecae44 100644 --- a/tests/ui/config/v1/finds_all.yaml +++ b/tests/ui/config/v1/finds_all.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: '' stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -19,7 +19,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -35,7 +35,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -51,7 +51,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -67,7 +67,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -83,7 +83,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -99,7 +99,7 @@ cases: - [ '--version' ] - cmd: run default --config .cargo/polkadot.yaml stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -115,7 +115,7 @@ cases: - [ '--version' ] - cmd: run default -c .cargo/polkadot.yaml stdout: | - zepter 1.2.0 + zepter 1.3.0 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version diff --git a/tests/ui/config/v1/version_bin.yaml b/tests/ui/config/v1/version_bin.yaml index fb4b088..53f3dc0 100644 --- a/tests/ui/config/v1/version_bin.yaml +++ b/tests/ui/config/v1/version_bin.yaml @@ -4,7 +4,7 @@ cases: - cmd: run default stderr: | thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.2.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.3.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 - cmd: run default --check-cfg-compatibility=off @@ -13,7 +13,7 @@ cases: stderr: | [INFO] Running workflow 'default' thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.2.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.3.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 1 configs: diff --git a/tests/ui/root-args/version.yaml b/tests/ui/root-args/version.yaml index cd0df82..47468eb 100644 --- a/tests/ui/root-args/version.yaml +++ b/tests/ui/root-args/version.yaml @@ -2,7 +2,7 @@ crates: [] cases: - cmd: --version stdout: | - zepter 1.2.0 + zepter 1.3.0 - cmd: -V stdout: | - zepter 1.2.0 + zepter 1.3.0 From 769cd3549a70179a24b1fbb42935bd7436afa5e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 00:39:10 +0100 Subject: [PATCH 09/13] Bump the known_good_semver group with 6 updates (#82) Bumps the known_good_semver group with 6 updates: | Package | From | To | | --- | --- | --- | | [anyhow](https://github.com/dtolnay/anyhow) | `1.0.79` | `1.0.80` | | [clap](https://github.com/clap-rs/clap) | `4.5.0` | `4.5.1` | | [env_logger](https://github.com/rust-cli/env_logger) | `0.11.1` | `0.11.2` | | [semver](https://github.com/dtolnay/semver) | `1.0.21` | `1.0.22` | | [serde_yaml](https://github.com/dtolnay/serde-yaml) | `0.9.31` | `0.9.32` | | [toml_edit](https://github.com/toml-rs/toml) | `0.22.4` | `0.22.6` | Updates `anyhow` from 1.0.79 to 1.0.80 - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.79...1.0.80) Updates `clap` from 4.5.0 to 4.5.1 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.0...clap_complete-v4.5.1) Updates `env_logger` from 0.11.1 to 0.11.2 - [Release notes](https://github.com/rust-cli/env_logger/releases) - [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.1...v0.11.2) Updates `semver` from 1.0.21 to 1.0.22 - [Release notes](https://github.com/dtolnay/semver/releases) - [Commits](https://github.com/dtolnay/semver/compare/1.0.21...1.0.22) Updates `serde_yaml` from 0.9.31 to 0.9.32 - [Release notes](https://github.com/dtolnay/serde-yaml/releases) - [Commits](https://github.com/dtolnay/serde-yaml/compare/0.9.31...0.9.32) Updates `toml_edit` from 0.22.4 to 0.22.6 - [Commits](https://github.com/toml-rs/toml/compare/v0.22.4...v0.22.6) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: env_logger dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: serde_yaml dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 32 ++++++++++++++++---------------- Cargo.toml | 10 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7904ec0..4d4f425 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "assert_cmd" @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.0" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", @@ -204,9 +204,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.0" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", @@ -375,9 +375,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" dependencies = [ "anstream", "anstyle", @@ -982,9 +982,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] @@ -1022,9 +1022,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.31" +version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" +checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ "indexmap", "itoa", @@ -1160,9 +1160,9 @@ checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.22.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ "indexmap", "toml_datetime", @@ -1472,9 +1472,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.39" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "d90f4e0f530c4c69f62b80d839e9ef3855edc9cba471a160c4d692deed62b401" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index f608c5f..ed4dc59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,13 +18,13 @@ harness = false required-features = [ "benchmarking" ] [dependencies] -anyhow = { version = "1.0.79", optional = true } +anyhow = { version = "1.0.80", optional = true } assert_cmd = { version = "2.0.13", optional = true } cargo_metadata = "0.18.1" -clap = { version = "4.5.0", features = ["derive", "cargo"] } +clap = { version = "4.5.1", features = ["derive", "cargo"] } colour = { version = "0.7.0", optional = true } criterion = { version = "0.5", optional = true } -env_logger = { version = "0.11.1", features = [ "auto-color", "humantime" ], optional = true } +env_logger = { version = "0.11.2", features = [ "auto-color", "humantime" ], optional = true } histo = { version = "1.0.0", optional = true } itertools = "0.12.1" log = { version = "0.4.20", optional = true } @@ -32,9 +32,9 @@ regex = "1.10.3" semver = "1" serde = "1.0.196" serde_json = { version = "1.0.113", optional = true } -serde_yaml = "0.9.31" +serde_yaml = "0.9.32" tempfile = { version = "3.10.0", optional = true } -toml_edit = "0.22.4" +toml_edit = "0.22.6" tracing = { version = "0.1.40", optional = true } [dev-dependencies] From 4ec87d3f0a11b5668bf66c3357ab880392b5317e Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Thu, 29 Feb 2024 00:09:59 +0100 Subject: [PATCH 10/13] Add source location filtering (#84) * Add source location filtering Signed-off-by: Oliver Tale-Yazdi * Delete old test Signed-off-by: Oliver Tale-Yazdi * Update UI test lockfiles Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/cmd/transpose/lift_to_workspace.rs | 47 +++++++++++++++++++------- tests/integration/orml/release.yaml | 26 -------------- tests/integration/sdk/transpose.yaml | 6 ++-- tests/ui/config/v1/basic.yaml | 10 +++--- tests/ui/config/v1/finds_all.yaml | 16 ++++----- tests/ui/config/v1/version_bin.yaml | 4 +-- tests/ui/root-args/version.yaml | 4 +-- 9 files changed, 57 insertions(+), 60 deletions(-) delete mode 100644 tests/integration/orml/release.yaml diff --git a/Cargo.lock b/Cargo.lock index 4d4f425..9df0453 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1487,7 +1487,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zepter" -version = "1.3.0" +version = "1.3.1" dependencies = [ "anyhow", "assert_cmd", diff --git a/Cargo.toml b/Cargo.toml index ed4dc59..4013c6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zepter" -version = "1.3.0" +version = "1.3.1" edition = "2021" authors = [ "Oliver Tale-Yazdi" ] description = "Analyze, Fix and Format features in your Rust workspace." diff --git a/src/cmd/transpose/lift_to_workspace.rs b/src/cmd/transpose/lift_to_workspace.rs index e20798e..36db339 100644 --- a/src/cmd/transpose/lift_to_workspace.rs +++ b/src/cmd/transpose/lift_to_workspace.rs @@ -30,8 +30,12 @@ pub struct LiftToWorkspaceCmd { fix: bool, /// How to determine which version to use for the whole workspace. - #[clap(long, value_enum, default_value_t = VersionResolveMode::Unambiguous, requires_if("exact", "exact_version"))] - version_resolver: VersionResolveMode, + #[clap(long, alias = "version-resolver", value_enum, default_value_t = VersionSelectorMode::Unambiguous, requires_if("exact", "exact_version"))] + version_selector: VersionSelectorMode, + + /// Optionally only check dependencies with this source location. + #[clap(long, value_enum)] + source_location: Option, /// The exact version to use for the whole workspace. #[clap(long)] @@ -44,7 +48,7 @@ pub struct LiftToWorkspaceCmd { /// How to determine which version to use for the whole workspace. #[derive(Debug, Clone, PartialEq, clap::ValueEnum)] -pub enum VersionResolveMode { +pub enum VersionSelectorMode { /// The version must be unambiguous - eg. there is only one version in the workspace. Unambiguous, /// A specific version. @@ -55,6 +59,14 @@ pub enum VersionResolveMode { Highest, } +#[derive(Debug, Clone, PartialEq, clap::ValueEnum)] +pub enum SourceLocationSelector { + /// The dependency is referenced via a `path`. + Local, + /// Either git or a registry. + Remote, +} + impl LiftToWorkspaceCmd { pub fn run(&self, g: &GlobalArgs) -> Result<(), String> { g.warn_unstable(); @@ -74,11 +86,22 @@ impl LiftToWorkspaceCmd { for pkg in meta.packages.iter() { for dep in pkg.dependencies.iter() { - if regex_lookup.values().any(|r| r.is_match(&dep.name)) || - self.dependencies.contains(&dep.name) + if !regex_lookup.values().any(|r| r.is_match(&dep.name)) && + !self.dependencies.contains(&dep.name) { - dependencies.insert(&dep.name); + continue; } + + if let Some(location_filter) = &self.source_location { + let is_local = dep.path.is_some(); + match location_filter { + SourceLocationSelector::Local if !is_local => continue, + SourceLocationSelector::Remote if is_local => continue, + _ => (), + } + } + + dependencies.insert(&dep.name); } } @@ -97,8 +120,8 @@ impl LiftToWorkspaceCmd { } fn validate_args(&self) -> Result<(), String> { - if self.exact_version.is_some() && self.version_resolver != VersionResolveMode::Exact { - return Err("Cannot use --exact-version without --version-resolver=exact".to_string()) + if self.exact_version.is_some() && self.version_selector != VersionSelectorMode::Exact { + return Err("Cannot use --exact-version without --version-selector=exact".to_string()) } Ok(()) } @@ -226,10 +249,10 @@ impl LiftToWorkspaceCmd { versions: &[&VersionReq], by_version: &HashMap>, ) -> Result { - let found = match self.version_resolver { - VersionResolveMode::Exact => self.exact_version.clone().expect("Checked by clippy"), - VersionResolveMode::Highest => try_find_latest(by_version.keys())?, - VersionResolveMode::Unambiguous => { + let found = match self.version_selector { + VersionSelectorMode::Exact => self.exact_version.clone().expect("Checked by clippy"), + VersionSelectorMode::Highest => try_find_latest(by_version.keys())?, + VersionSelectorMode::Unambiguous => { if versions.len() > 1 { let str_width = versions.iter().map(|v| v.to_string().len()).max().unwrap(); let mut err = String::new(); diff --git a/tests/integration/orml/release.yaml b/tests/integration/orml/release.yaml deleted file mode 100644 index f7fd2d5..0000000 --- a/tests/integration/orml/release.yaml +++ /dev/null @@ -1,26 +0,0 @@ -repo: - name: ggwpez/orml - ref: a5ed349b767d01b33e06c718c302d344fa16f816 -cases: -- cmd: transpose features strip-dev-only -p asdf - stderr: | - [WARN] Unstable feature - do not rely on this! - Could not find package named 'asdf' - code: 1 -- cmd: transpose features strip-dev-only -p orml-asset-registry,asdf - stderr: | - [WARN] Unstable feature - do not rely on this! - Could not find package named 'asdf' - code: 1 -- cmd: transpose features strip-dev-only - stderr: | - [WARN] Unstable feature - do not rely on this! - diff: "diff --git asset-registry/Cargo.toml asset-registry/Cargo.toml\nindex e09add88bf..6621f773d1 100644\n--- asset-registry/Cargo.toml\n+++ asset-registry/Cargo.toml\n@@ -62,5 +61,0 @@ std = [\n-\t\"cumulus-pallet-dmp-queue/std\",\n-\t\"cumulus-pallet-parachain-system/std\",\n-\t\"cumulus-pallet-xcm/std\",\n-\t\"cumulus-pallet-xcmp-queue/std\",\n-\t\"cumulus-primitives-core/std\",\n@@ -71,3 +65,0 @@ std = [\n-\t\"orml-xcm-support/std\",\n-\t\"pallet-balances/std\",\n-\t\"pallet-message-queue/std\",\n@@ -75 +66,0 @@ std = [\n-\t\"parachain-info/std\",\n@@ -77,3 +67,0 @@ std = [\n-\t\"polkadot-parachain-primitives/std\",\n-\t\"polkadot-runtime-common/std\",\n-\t\"polkadot-runtime-parachains/std\",\n@@ -82 +69,0 @@ std = [\n-\t\"sp-core/std\",\n@@ -91,2 +77,0 @@ runtime-benchmarks = [\n-\t\"cumulus-pallet-parachain-system/runtime-benchmarks\",\n-\t\"cumulus-pallet-xcmp-queue/runtime-benchmarks\",\n@@ -95,4 +79,0 @@ runtime-benchmarks = [\n-\t\"orml-tokens/runtime-benchmarks\",\n-\t\"orml-xtokens/runtime-benchmarks\",\n-\t\"pallet-balances/runtime-benchmarks\",\n-\t\"pallet-message-queue/runtime-benchmarks\",\n@@ -100,3 +80,0 @@ runtime-benchmarks = [\n-\t\"polkadot-parachain-primitives/runtime-benchmarks\",\n-\t\"polkadot-runtime-common/runtime-benchmarks\",\n-\t\"polkadot-runtime-parachains/runtime-benchmarks\",\n@@ -108,4 +85,0 @@ try-runtime = [\n-\t\"cumulus-pallet-dmp-queue/try-runtime\",\n-\t\"cumulus-pallet-parachain-system/try-runtime\",\n-\t\"cumulus-pallet-xcm/try-runtime\",\n-\t\"cumulus-pallet-xcmp-queue/try-runtime\",\n@@ -114,5 +87,0 @@ try-runtime = [\n-\t\"orml-tokens/try-runtime\",\n-\t\"orml-xcm/try-runtime\",\n-\t\"orml-xtokens/try-runtime\",\n-\t\"pallet-balances/try-runtime\",\n-\t\"pallet-message-queue/try-runtime\",\n@@ -120,3 +88,0 @@ try-runtime = [\n-\t\"parachain-info/try-runtime\",\n-\t\"polkadot-runtime-common/try-runtime\",\n-\t\"polkadot-runtime-parachains/try-runtime\",\ndiff --git auction/Cargo.toml auction/Cargo.toml\nindex 77bfc8e9af..52da5ff859 100644\n--- auction/Cargo.toml\n+++ auction/Cargo.toml\n@@ -35,2 +34,0 @@ std = [\n-\t\"sp-core/std\",\n-\t\"sp-io/std\",\ndiff --git authority/Cargo.toml authority/Cargo.toml\nindex 7f77db4e0e..9973a1cf08 100644\n--- authority/Cargo.toml\n+++ authority/Cargo.toml\n@@ -33,3 +32,0 @@ std = [\n-\t\"pallet-preimage/std\",\n-\t\"pallet-root-testing/std\",\n-\t\"pallet-scheduler/std\",\n@@ -47,2 +43,0 @@ runtime-benchmarks = [\n-\t\"pallet-preimage/runtime-benchmarks\",\n-\t\"pallet-scheduler/runtime-benchmarks\",\n@@ -54,3 +48,0 @@ try-runtime = [\n-\t\"pallet-preimage/try-runtime\",\n-\t\"pallet-root-testing/try-runtime\",\n-\t\"pallet-scheduler/try-runtime\",\ndiff --git benchmarking/Cargo.toml benchmarking/Cargo.toml\nindex 2d71513f2a..ae9348e32f 100644\n--- benchmarking/Cargo.toml\n+++ benchmarking/Cargo.toml\n@@ -36 +35,0 @@ std = [\n-\t\"frame-system/std\",\ndiff --git currencies/Cargo.toml currencies/Cargo.toml\nindex 23e7dbd77c..7935d0dfdb 100644\n--- currencies/Cargo.toml\n+++ currencies/Cargo.toml\n@@ -37 +36,0 @@ std = [\n-\t\"pallet-balances/std\",\n@@ -41 +39,0 @@ std = [\n-\t\"sp-core/std\",\n@@ -49,2 +46,0 @@ try-runtime = [\n-\t\"orml_tokens/try-runtime\",\n-\t\"pallet-balances/try-runtime\",\ndiff --git nft/Cargo.toml nft/Cargo.toml\nindex 116a9ec838..acdb3b8be9 100644\n--- nft/Cargo.toml\n+++ nft/Cargo.toml\n@@ -32,2 +31,0 @@ std = [\n-\t\"sp-core/std\",\n-\t\"sp-io/std\",\ndiff --git oracle/Cargo.toml oracle/Cargo.toml\nindex e5183dfd89..e556559b55 100644\n--- oracle/Cargo.toml\n+++ oracle/Cargo.toml\n@@ -39 +38,0 @@ std = [\n-\t\"sp-core/std\",\ndiff --git parameters/Cargo.toml parameters/Cargo.toml\nindex 7f6847d360..f478122507 100644\n--- parameters/Cargo.toml\n+++ parameters/Cargo.toml\n@@ -37 +36,0 @@ std = [\n-\t\"sp-io/std\",\ndiff --git payments/Cargo.toml payments/Cargo.toml\nindex 16f8201c4f..b8b372d1f4 100644\n--- payments/Cargo.toml\n+++ payments/Cargo.toml\n@@ -38 +37,0 @@ std = [\n-\t'orml-tokens/std',\n@@ -42,2 +40,0 @@ std = [\n-\t\"sp-core/std\",\n-\t\"sp-io/std\",\n@@ -50 +46,0 @@ try-runtime = [\n-\t\"orml-tokens/try-runtime\",\ndiff --git tokens/Cargo.toml tokens/Cargo.toml\nindex 4c3f716ea6..9243b2a414 100644\n--- tokens/Cargo.toml\n+++ tokens/Cargo.toml\n@@ -38,2 +37,0 @@ std = [\n-\t\"pallet-elections-phragmen/std\",\n-\t\"pallet-treasury/std\",\n@@ -44,2 +41,0 @@ std = [\n-\t\"sp-core/std\",\n-\t\"sp-io/std\",\n@@ -47 +42,0 @@ std = [\n-\t\"sp-staking/std\",\n@@ -53,2 +47,0 @@ runtime-benchmarks = [\n-\t\"pallet-elections-phragmen/runtime-benchmarks\",\n-\t\"pallet-treasury/runtime-benchmarks\",\n@@ -56 +48,0 @@ runtime-benchmarks = [\n-\t\"sp-staking/runtime-benchmarks\",\n@@ -61,2 +52,0 @@ try-runtime = [\n-\t\"pallet-elections-phragmen/try-runtime\",\n-\t\"pallet-treasury/try-runtime\",\ndiff --git unknown-tokens/Cargo.toml unknown-tokens/Cargo.toml\nindex 8a73a3ff04..30132fda34 100644\n--- unknown-tokens/Cargo.toml\n+++ unknown-tokens/Cargo.toml\n@@ -38,3 +37,0 @@ std = [\n-\t\"sp-core/std\",\n-\t\"sp-io/std\",\n-\t\"sp-runtime/std\",\n@@ -47 +43,0 @@ try-runtime = [\n-\t\"sp-runtime/try-runtime\",\ndiff --git utilities/Cargo.toml utilities/Cargo.toml\nindex 597648ecb6..04a018d321 100644\n--- utilities/Cargo.toml\n+++ utilities/Cargo.toml\n@@ -30 +29,0 @@ std = [\n-\t\"frame-system/std\",\ndiff --git vesting/Cargo.toml vesting/Cargo.toml\nindex 1e3516f00e..7dcafb04f3 100644\n--- vesting/Cargo.toml\n+++ vesting/Cargo.toml\n@@ -30 +29,0 @@ std = [\n-\t\"pallet-balances/std\",\n@@ -34 +32,0 @@ std = [\n-\t\"sp-core/std\",\n@@ -42 +39,0 @@ runtime-benchmarks = [\n-\t\"pallet-balances/runtime-benchmarks\",\n@@ -48 +44,0 @@ try-runtime = [\n-\t\"pallet-balances/try-runtime\",\ndiff --git xcm/Cargo.toml xcm/Cargo.toml\nindex 72a58f204d..f7db2af60e 100644\n--- xcm/Cargo.toml\n+++ xcm/Cargo.toml\n@@ -33 +32,0 @@ std = [\n-\t\"xcm-executor/std\",\ndiff --git xtokens/Cargo.toml xtokens/Cargo.toml\nindex 8502bf6bb3..30b767e776 100644\n--- xtokens/Cargo.toml\n+++ xtokens/Cargo.toml\n@@ -63,4 +62,0 @@ std = [\n-\t\"cumulus-pallet-dmp-queue/std\",\n-\t\"cumulus-pallet-parachain-system/std\",\n-\t\"cumulus-pallet-xcm/std\",\n-\t\"cumulus-pallet-xcmp-queue/std\",\n@@ -73,2 +68,0 @@ std = [\n-\t\"pallet-balances/std\",\n-\t\"pallet-message-queue/std\",\n@@ -76 +69,0 @@ std = [\n-\t\"parachain-info/std\",\n@@ -78,3 +70,0 @@ std = [\n-\t\"polkadot-parachain-primitives/std\",\n-\t\"polkadot-runtime-common/std\",\n-\t\"polkadot-runtime-parachains/std\",\n@@ -83 +72,0 @@ std = [\n-\t\"sp-core/std\",\n@@ -87 +75,0 @@ std = [\n-\t\"xcm-builder/std\",\n@@ -92,2 +79,0 @@ runtime-benchmarks = [\n-\t\"cumulus-pallet-parachain-system/runtime-benchmarks\",\n-\t\"cumulus-pallet-xcmp-queue/runtime-benchmarks\",\n@@ -96,3 +81,0 @@ runtime-benchmarks = [\n-\t\"orml-tokens/runtime-benchmarks\",\n-\t\"pallet-balances/runtime-benchmarks\",\n-\t\"pallet-message-queue/runtime-benchmarks\",\n@@ -100,3 +82,0 @@ runtime-benchmarks = [\n-\t\"polkadot-parachain-primitives/runtime-benchmarks\",\n-\t\"polkadot-runtime-common/runtime-benchmarks\",\n-\t\"polkadot-runtime-parachains/runtime-benchmarks\",\n@@ -104 +83,0 @@ runtime-benchmarks = [\n-\t\"xcm-builder/runtime-benchmarks\",\n@@ -108,4 +86,0 @@ try-runtime = [\n-\t\"cumulus-pallet-dmp-queue/try-runtime\",\n-\t\"cumulus-pallet-parachain-system/try-runtime\",\n-\t\"cumulus-pallet-xcm/try-runtime\",\n-\t\"cumulus-pallet-xcmp-queue/try-runtime\",\n@@ -114,4 +88,0 @@ try-runtime = [\n-\t\"orml-tokens/try-runtime\",\n-\t\"orml-xcm/try-runtime\",\n-\t\"pallet-balances/try-runtime\",\n-\t\"pallet-message-queue/try-runtime\",\n@@ -119,3 +89,0 @@ try-runtime = [\n-\t\"parachain-info/try-runtime\",\n-\t\"polkadot-runtime-common/try-runtime\",\n-\t\"polkadot-runtime-parachains/try-runtime\",\n" -- cmd: transpose features strip-dev-only -p orml-asset-registry - stderr: | - [WARN] Unstable feature - do not rely on this! - diff: "diff --git asset-registry/Cargo.toml asset-registry/Cargo.toml\nindex e09add88bf..6621f773d1 100644\n--- asset-registry/Cargo.toml\n+++ asset-registry/Cargo.toml\n@@ -62,5 +61,0 @@ std = [\n-\t\"cumulus-pallet-dmp-queue/std\",\n-\t\"cumulus-pallet-parachain-system/std\",\n-\t\"cumulus-pallet-xcm/std\",\n-\t\"cumulus-pallet-xcmp-queue/std\",\n-\t\"cumulus-primitives-core/std\",\n@@ -71,3 +65,0 @@ std = [\n-\t\"orml-xcm-support/std\",\n-\t\"pallet-balances/std\",\n-\t\"pallet-message-queue/std\",\n@@ -75 +66,0 @@ std = [\n-\t\"parachain-info/std\",\n@@ -77,3 +67,0 @@ std = [\n-\t\"polkadot-parachain-primitives/std\",\n-\t\"polkadot-runtime-common/std\",\n-\t\"polkadot-runtime-parachains/std\",\n@@ -82 +69,0 @@ std = [\n-\t\"sp-core/std\",\n@@ -91,2 +77,0 @@ runtime-benchmarks = [\n-\t\"cumulus-pallet-parachain-system/runtime-benchmarks\",\n-\t\"cumulus-pallet-xcmp-queue/runtime-benchmarks\",\n@@ -95,4 +79,0 @@ runtime-benchmarks = [\n-\t\"orml-tokens/runtime-benchmarks\",\n-\t\"orml-xtokens/runtime-benchmarks\",\n-\t\"pallet-balances/runtime-benchmarks\",\n-\t\"pallet-message-queue/runtime-benchmarks\",\n@@ -100,3 +80,0 @@ runtime-benchmarks = [\n-\t\"polkadot-parachain-primitives/runtime-benchmarks\",\n-\t\"polkadot-runtime-common/runtime-benchmarks\",\n-\t\"polkadot-runtime-parachains/runtime-benchmarks\",\n@@ -108,4 +85,0 @@ try-runtime = [\n-\t\"cumulus-pallet-dmp-queue/try-runtime\",\n-\t\"cumulus-pallet-parachain-system/try-runtime\",\n-\t\"cumulus-pallet-xcm/try-runtime\",\n-\t\"cumulus-pallet-xcmp-queue/try-runtime\",\n@@ -114,5 +87,0 @@ try-runtime = [\n-\t\"orml-tokens/try-runtime\",\n-\t\"orml-xcm/try-runtime\",\n-\t\"orml-xtokens/try-runtime\",\n-\t\"pallet-balances/try-runtime\",\n-\t\"pallet-message-queue/try-runtime\",\n@@ -120,3 +88,0 @@ try-runtime = [\n-\t\"parachain-info/try-runtime\",\n-\t\"polkadot-runtime-common/try-runtime\",\n-\t\"polkadot-runtime-parachains/try-runtime\",\n" -- cmd: transpose features strip-dev-only -p orml-asset-registry,orml-xtokens - stderr: | - [WARN] Unstable feature - do not rely on this! - diff: "diff --git asset-registry/Cargo.toml asset-registry/Cargo.toml\nindex e09add88bf..6621f773d1 100644\n--- asset-registry/Cargo.toml\n+++ asset-registry/Cargo.toml\n@@ -62,5 +61,0 @@ std = [\n-\t\"cumulus-pallet-dmp-queue/std\",\n-\t\"cumulus-pallet-parachain-system/std\",\n-\t\"cumulus-pallet-xcm/std\",\n-\t\"cumulus-pallet-xcmp-queue/std\",\n-\t\"cumulus-primitives-core/std\",\n@@ -71,3 +65,0 @@ std = [\n-\t\"orml-xcm-support/std\",\n-\t\"pallet-balances/std\",\n-\t\"pallet-message-queue/std\",\n@@ -75 +66,0 @@ std = [\n-\t\"parachain-info/std\",\n@@ -77,3 +67,0 @@ std = [\n-\t\"polkadot-parachain-primitives/std\",\n-\t\"polkadot-runtime-common/std\",\n-\t\"polkadot-runtime-parachains/std\",\n@@ -82 +69,0 @@ std = [\n-\t\"sp-core/std\",\n@@ -91,2 +77,0 @@ runtime-benchmarks = [\n-\t\"cumulus-pallet-parachain-system/runtime-benchmarks\",\n-\t\"cumulus-pallet-xcmp-queue/runtime-benchmarks\",\n@@ -95,4 +79,0 @@ runtime-benchmarks = [\n-\t\"orml-tokens/runtime-benchmarks\",\n-\t\"orml-xtokens/runtime-benchmarks\",\n-\t\"pallet-balances/runtime-benchmarks\",\n-\t\"pallet-message-queue/runtime-benchmarks\",\n@@ -100,3 +80,0 @@ runtime-benchmarks = [\n-\t\"polkadot-parachain-primitives/runtime-benchmarks\",\n-\t\"polkadot-runtime-common/runtime-benchmarks\",\n-\t\"polkadot-runtime-parachains/runtime-benchmarks\",\n@@ -108,4 +85,0 @@ try-runtime = [\n-\t\"cumulus-pallet-dmp-queue/try-runtime\",\n-\t\"cumulus-pallet-parachain-system/try-runtime\",\n-\t\"cumulus-pallet-xcm/try-runtime\",\n-\t\"cumulus-pallet-xcmp-queue/try-runtime\",\n@@ -114,5 +87,0 @@ try-runtime = [\n-\t\"orml-tokens/try-runtime\",\n-\t\"orml-xcm/try-runtime\",\n-\t\"orml-xtokens/try-runtime\",\n-\t\"pallet-balances/try-runtime\",\n-\t\"pallet-message-queue/try-runtime\",\n@@ -120,3 +88,0 @@ try-runtime = [\n-\t\"parachain-info/try-runtime\",\n-\t\"polkadot-runtime-common/try-runtime\",\n-\t\"polkadot-runtime-parachains/try-runtime\",\ndiff --git xtokens/Cargo.toml xtokens/Cargo.toml\nindex 8502bf6bb3..30b767e776 100644\n--- xtokens/Cargo.toml\n+++ xtokens/Cargo.toml\n@@ -63,4 +62,0 @@ std = [\n-\t\"cumulus-pallet-dmp-queue/std\",\n-\t\"cumulus-pallet-parachain-system/std\",\n-\t\"cumulus-pallet-xcm/std\",\n-\t\"cumulus-pallet-xcmp-queue/std\",\n@@ -73,2 +68,0 @@ std = [\n-\t\"pallet-balances/std\",\n-\t\"pallet-message-queue/std\",\n@@ -76 +69,0 @@ std = [\n-\t\"parachain-info/std\",\n@@ -78,3 +70,0 @@ std = [\n-\t\"polkadot-parachain-primitives/std\",\n-\t\"polkadot-runtime-common/std\",\n-\t\"polkadot-runtime-parachains/std\",\n@@ -83 +72,0 @@ std = [\n-\t\"sp-core/std\",\n@@ -87 +75,0 @@ std = [\n-\t\"xcm-builder/std\",\n@@ -92,2 +79,0 @@ runtime-benchmarks = [\n-\t\"cumulus-pallet-parachain-system/runtime-benchmarks\",\n-\t\"cumulus-pallet-xcmp-queue/runtime-benchmarks\",\n@@ -96,3 +81,0 @@ runtime-benchmarks = [\n-\t\"orml-tokens/runtime-benchmarks\",\n-\t\"pallet-balances/runtime-benchmarks\",\n-\t\"pallet-message-queue/runtime-benchmarks\",\n@@ -100,3 +82,0 @@ runtime-benchmarks = [\n-\t\"polkadot-parachain-primitives/runtime-benchmarks\",\n-\t\"polkadot-runtime-common/runtime-benchmarks\",\n-\t\"polkadot-runtime-parachains/runtime-benchmarks\",\n@@ -104 +83,0 @@ runtime-benchmarks = [\n-\t\"xcm-builder/runtime-benchmarks\",\n@@ -108,4 +86,0 @@ try-runtime = [\n-\t\"cumulus-pallet-dmp-queue/try-runtime\",\n-\t\"cumulus-pallet-parachain-system/try-runtime\",\n-\t\"cumulus-pallet-xcm/try-runtime\",\n-\t\"cumulus-pallet-xcmp-queue/try-runtime\",\n@@ -114,4 +88,0 @@ try-runtime = [\n-\t\"orml-tokens/try-runtime\",\n-\t\"orml-xcm/try-runtime\",\n-\t\"pallet-balances/try-runtime\",\n-\t\"pallet-message-queue/try-runtime\",\n@@ -119,3 +89,0 @@ try-runtime = [\n-\t\"parachain-info/try-runtime\",\n-\t\"polkadot-runtime-common/try-runtime\",\n-\t\"polkadot-runtime-parachains/try-runtime\",\n" diff --git a/tests/integration/sdk/transpose.yaml b/tests/integration/sdk/transpose.yaml index 807cdd0..5bf3aaf 100644 --- a/tests/integration/sdk/transpose.yaml +++ b/tests/integration/sdk/transpose.yaml @@ -10,7 +10,7 @@ cases: code: 1 - cmd: transpose dependency lift-to-workspace log --version-resolver Unambiguous stderr: | - error: invalid value 'Unambiguous' for '--version-resolver ' + error: invalid value 'Unambiguous' for '--version-selector ' [possible values: unambiguous, exact, highest] tip: a similar value exists: 'unambiguous' @@ -28,14 +28,14 @@ cases: error: the following required arguments were not provided: --exact-version - Usage: zepter transpose dependency lift-to-workspace --exact-version --version-resolver --manifest-path --log --offline ... + Usage: zepter transpose dependency lift-to-workspace --exact-version --version-selector --manifest-path --log --offline ... For more information, try '--help'. code: 2 - cmd: transpose dependency lift-to-workspace log --exact-version 0.4.20 stderr: | [WARN] Unstable feature - do not rely on this! - Cannot use --exact-version without --version-resolver=exact + Cannot use --exact-version without --version-selector=exact Error: () code: 1 - cmd: transpose dependency lift-to-workspace log --version-resolver exact --exact-version 0.4.20 diff --git a/tests/ui/config/v1/basic.yaml b/tests/ui/config/v1/basic.yaml index fb8562f..895b37b 100644 --- a/tests/ui/config/v1/basic.yaml +++ b/tests/ui/config/v1/basic.yaml @@ -3,25 +3,25 @@ crates: cases: - cmd: run default stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: '' stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version - cmd: run my_version stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'my_version' [INFO] 1/1 --version @@ -36,7 +36,7 @@ cases: [INFO] 1/1 debug --no-benchmark - cmd: run both stdout: | - zepter 1.3.0 + zepter 1.3.1 Num workspace members: 1 Num dependencies: 1 DAG nodes: 0, links: 0 diff --git a/tests/ui/config/v1/finds_all.yaml b/tests/ui/config/v1/finds_all.yaml index 7ecae44..ae10dcd 100644 --- a/tests/ui/config/v1/finds_all.yaml +++ b/tests/ui/config/v1/finds_all.yaml @@ -3,7 +3,7 @@ crates: cases: - cmd: '' stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -19,7 +19,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -35,7 +35,7 @@ cases: - [ '--version' ] - cmd: '' stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -51,7 +51,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -67,7 +67,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -83,7 +83,7 @@ cases: - [ '--version' ] - cmd: run default stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -99,7 +99,7 @@ cases: - [ '--version' ] - cmd: run default --config .cargo/polkadot.yaml stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version @@ -115,7 +115,7 @@ cases: - [ '--version' ] - cmd: run default -c .cargo/polkadot.yaml stdout: | - zepter 1.3.0 + zepter 1.3.1 stderr: | [INFO] Running workflow 'default' [INFO] 1/1 --version diff --git a/tests/ui/config/v1/version_bin.yaml b/tests/ui/config/v1/version_bin.yaml index 53f3dc0..5566f77 100644 --- a/tests/ui/config/v1/version_bin.yaml +++ b/tests/ui/config/v1/version_bin.yaml @@ -4,7 +4,7 @@ cases: - cmd: run default stderr: | thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.3.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.3.1. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 101 - cmd: run default --check-cfg-compatibility=off @@ -13,7 +13,7 @@ cases: stderr: | [INFO] Running workflow 'default' thread 'main' panicked at src/cmd/run.rs:27:46: - Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.3.0. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." + Invalid config file: "Config file version is too new. The file requires at least version 2.0.0, but the current version is 1.3.1. Please update Zepter or ignore this check with `--check-cfg-compatibility=off`." note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace code: 1 configs: diff --git a/tests/ui/root-args/version.yaml b/tests/ui/root-args/version.yaml index 47468eb..2a0c114 100644 --- a/tests/ui/root-args/version.yaml +++ b/tests/ui/root-args/version.yaml @@ -2,7 +2,7 @@ crates: [] cases: - cmd: --version stdout: | - zepter 1.3.0 + zepter 1.3.1 - cmd: -V stdout: | - zepter 1.3.0 + zepter 1.3.1 From 7c7c82c005c5f2cf12fb89e0024b705e99e353e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 00:37:53 +0100 Subject: [PATCH 11/13] Bump the known_good_semver group with 5 updates (#85) Bumps the known_good_semver group with 5 updates: | Package | From | To | | --- | --- | --- | | [assert_cmd](https://github.com/assert-rs/assert_cmd) | `2.0.13` | `2.0.14` | | [log](https://github.com/rust-lang/log) | `0.4.20` | `0.4.21` | | [serde](https://github.com/serde-rs/serde) | `1.0.196` | `1.0.197` | | [serde_json](https://github.com/serde-rs/json) | `1.0.113` | `1.0.114` | | [tempfile](https://github.com/Stebalien/tempfile) | `3.10.0` | `3.10.1` | Updates `assert_cmd` from 2.0.13 to 2.0.14 - [Changelog](https://github.com/assert-rs/assert_cmd/blob/master/CHANGELOG.md) - [Commits](https://github.com/assert-rs/assert_cmd/compare/v2.0.13...v2.0.14) Updates `log` from 0.4.20 to 0.4.21 - [Release notes](https://github.com/rust-lang/log/releases) - [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/log/compare/0.4.20...0.4.21) Updates `serde` from 1.0.196 to 1.0.197 - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.196...v1.0.197) Updates `serde_json` from 1.0.113 to 1.0.114 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.113...v1.0.114) Updates `tempfile` from 3.10.0 to 3.10.1 - [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md) - [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.0...v3.10.1) --- updated-dependencies: - dependency-name: assert_cmd dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: log dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver - dependency-name: tempfile dependency-type: direct:production update-type: version-update:semver-patch dependency-group: known_good_semver ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 24 ++++++++++++------------ Cargo.toml | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9df0453..731c8ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,9 +73,9 @@ checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "assert_cmd" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00ad3f3a942eee60335ab4342358c161ee296829e0d16ff42fc1d6cb07815467" +checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8" dependencies = [ "anstyle", "bstr", @@ -647,9 +647,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" @@ -991,18 +991,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -1011,9 +1011,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -1106,9 +1106,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", diff --git a/Cargo.toml b/Cargo.toml index 4013c6f..494f4a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ required-features = [ "benchmarking" ] [dependencies] anyhow = { version = "1.0.80", optional = true } -assert_cmd = { version = "2.0.13", optional = true } +assert_cmd = { version = "2.0.14", optional = true } cargo_metadata = "0.18.1" clap = { version = "4.5.1", features = ["derive", "cargo"] } colour = { version = "0.7.0", optional = true } @@ -27,13 +27,13 @@ criterion = { version = "0.5", optional = true } env_logger = { version = "0.11.2", features = [ "auto-color", "humantime" ], optional = true } histo = { version = "1.0.0", optional = true } itertools = "0.12.1" -log = { version = "0.4.20", optional = true } +log = { version = "0.4.21", optional = true } regex = "1.10.3" semver = "1" -serde = "1.0.196" -serde_json = { version = "1.0.113", optional = true } +serde = "1.0.197" +serde_json = { version = "1.0.114", optional = true } serde_yaml = "0.9.32" -tempfile = { version = "3.10.0", optional = true } +tempfile = { version = "3.10.1", optional = true } toml_edit = "0.22.6" tracing = { version = "0.1.40", optional = true } @@ -43,7 +43,7 @@ lazy_static = "1.4.0" pretty_assertions = "1.4.0" rand = "0.8.5" rstest = "0.18.2" -serde = "1.0.196" +serde = "1.0.197" zepter = { path = ".", features = ["testing"] } [features] From d820f85341f403564c85b3822a394c0a2f1ab1ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 21:40:29 +0000 Subject: [PATCH 12/13] Bump mio from 0.8.10 to 0.8.11 (#86) Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11. - [Release notes](https://github.com/tokio-rs/mio/releases) - [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11) --- updated-dependencies: - dependency-name: mio dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 731c8ac..aa90d5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -659,9 +659,9 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", From dbcce3cc6494a7bf3676bec297240c1b53d85a64 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Wed, 6 Mar 2024 13:31:52 +0100 Subject: [PATCH 13/13] Fix `lift-to-workspace` (#87) * Add source location filtering Signed-off-by: Oliver Tale-Yazdi * Delete old test Signed-off-by: Oliver Tale-Yazdi * Update UI test lockfiles Signed-off-by: Oliver Tale-Yazdi * Fix issue with lift-to-workspace Signed-off-by: Oliver Tale-Yazdi * Clippy Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi --- src/autofix.rs | 25 ++++++++++++----------- src/cmd/transpose/lift_to_workspace.rs | 4 ++-- src/lib.rs | 11 ++++++++++ src/tests.rs | 12 +++++------ tests/integration/runtimes/transpose.yaml | 7 +++++++ 5 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 tests/integration/runtimes/transpose.yaml diff --git a/src/autofix.rs b/src/autofix.rs index 3d40634..ec4ffdd 100644 --- a/src/autofix.rs +++ b/src/autofix.rs @@ -4,7 +4,7 @@ //! Automatically fix problems by modifying `Cargo.toml` files. use crate::{cmd::fmt::Mode, log}; -use cargo_metadata::Dependency; +use cargo_metadata::{Dependency, DependencyKind}; use std::{ collections::BTreeMap as Map, path::{Path, PathBuf}, @@ -450,23 +450,24 @@ impl AutoFixer { pub fn lift_dependency( &mut self, dname: &str, + kind: &DependencyKind, default_feats: Option, ) -> Result<(), String> { + let kind = crate::kind_to_str(kind); let doc: &mut Document = self.doc.as_mut().unwrap(); - for kind in &["dependencies", "dev-dependencies", "build-dependencies"] { - if !doc.contains_table(kind) { - continue - } - let deps: &mut Table = doc[kind].as_table_mut().unwrap(); - - if !deps.contains_key(dname) { - continue - } + if !doc.contains_table(kind) { + return Ok(()) + } + let deps: &mut Table = doc[&kind].as_table_mut().unwrap(); - let dep = deps.get_mut(dname).unwrap(); - Self::lift_some_dependency(dep, default_feats)?; + if !deps.contains_key(dname) { + return Ok(()) } + + let dep = deps.get_mut(dname).unwrap(); + Self::lift_some_dependency(dep, default_feats)?; + Ok(()) } diff --git a/src/cmd/transpose/lift_to_workspace.rs b/src/cmd/transpose/lift_to_workspace.rs index 36db339..4a1a6ee 100644 --- a/src/cmd/transpose/lift_to_workspace.rs +++ b/src/cmd/transpose/lift_to_workspace.rs @@ -191,9 +191,9 @@ impl LiftToWorkspaceCmd { let (_, fixer) = fixers.get_mut(&pkg.name).unwrap(); if dep.uses_default_features != workspace_default_features_enabled { - fixer.lift_dependency(&dep.name, Some(dep.uses_default_features))?; + fixer.lift_dependency(&dep.name, &dep.kind, Some(dep.uses_default_features))?; } else { - fixer.lift_dependency(&dep.name, None)?; + fixer.lift_dependency(&dep.name, &dep.kind, None)?; } } diff --git a/src/lib.rs b/src/lib.rs index 8059ae8..7567b35 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,3 +90,14 @@ impl ErrToStr for Result { self.map_err(|e| format!("{}", e)) } } + +use cargo_metadata::DependencyKind; + +pub(crate) fn kind_to_str(kind: &DependencyKind) -> &'static str { + match kind { + DependencyKind::Development => "dev-dependencies", + DependencyKind::Build => "build-dependencies", + DependencyKind::Normal => "dependencies", + _ => unreachable!(), + } +} diff --git a/src/tests.rs b/src/tests.rs index adb2ce9..1f55685 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -5,11 +5,10 @@ use crate::{ autofix::AutoFixer, - cmd::fmt::{ - Mode, - Mode::{Canonicalize, Dedub, Sort}, - }, + cmd::fmt::Mode::{self, Canonicalize, Dedub, Sort}, + kind_to_str, }; +use cargo_metadata::DependencyKind::*; use rstest::*; use std::{collections::BTreeMap as Map, vec}; @@ -1363,10 +1362,11 @@ fn lift_to_workspace_works( #[case] default: Option, #[case] output: Result, &str>, ) { - for table in ["dependencies", "dev-dependencies", "build-dependencies"] { + for kind in [Normal, Build, Development] { + let table = kind_to_str(&kind); let input = &input.replace("dependencies", table); let mut fixer = AutoFixer::from_raw(input).unwrap(); - let res = fixer.lift_dependency("log", default); + let res = fixer.lift_dependency("log", &kind, default); match output { Ok(modify) => { diff --git a/tests/integration/runtimes/transpose.yaml b/tests/integration/runtimes/transpose.yaml new file mode 100644 index 0000000..06667ed --- /dev/null +++ b/tests/integration/runtimes/transpose.yaml @@ -0,0 +1,7 @@ +repo: + name: polkadot-fellows/runtimes + ref: 71ddd5fb0d3bebb90731f921e793b007697d1a6c +cases: +- cmd: transpose dependency lift-to-workspace "regex:bridge-runtime-common" --version-resolver unambiguous + stderr: | + [WARN] Unstable feature - do not rely on this!