Skip to content

Commit

Permalink
fix: add quiet verbosity around resolve and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alcolmenar committed Aug 10, 2023
1 parent a64ed39 commit 72e66fb
Show file tree
Hide file tree
Showing 21 changed files with 11 additions and 27 deletions.
12 changes: 11 additions & 1 deletion src/bin/cargo/commands/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {

// Reload the workspace since we've changed dependencies
let ws = args.workspace(config)?;
let (_, resolve) = resolve_ws(&ws)?;
let resolve = {
// HACK: Avoid unused patch warnings by temporarily changing the verbosity.
// In rare cases, this might cause index update messages to not show up
let verbosity = ws.config().shell().verbosity();
ws.config()
.shell()
.set_verbosity(cargo::core::Verbosity::Quiet);
let resolve = resolve_ws(&ws);
ws.config().shell().set_verbosity(verbosity);
resolve?.1
};

// Attempt to gc unused patches and re-resolve if anything is removed
if gc_unused_patches(&workspace, &resolve)? {
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/avoid_empty_tables/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing clippy from dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/build/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing semver from build-dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/dev/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing regex from dev-dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/gc_keep_used_patch/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing serde_derive from dependencies
Updating `dummy-registry` index
7 changes: 0 additions & 7 deletions tests/testsuite/cargo_remove/gc_patch/stderr.log
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
Removing bar from dependencies
Updating git repository `[ROOTURL]/bar[..]`
Updating git repository `[ROOTURL]/bar[..]`
Updating `dummy-registry` index
warning: Patch `bar v0.1.0 ([..])` was not used in the crate graph.
Perhaps you misspelled the source URL being patched.
Possible URLs for `[patch.<URL>]`:
[ROOT]/bar2
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/gc_profile/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing toml from dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/gc_replace/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing toml from dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/multiple_deps/stderr.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Removing docopt from dependencies
Removing semver from dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/multiple_dev/stderr.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Removing regex from dev-dependencies
Removing serde from dev-dependencies
Updating `dummy-registry` index
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing serde from dev-dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/optional_feature/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing semver from dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/package/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing docopt from dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/remove_basic/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing docopt from dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/target/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing dbus from dependencies for target `x86_64-unknown-linux-gnu`
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/target_build/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing semver from build-dependencies for target `x86_64-unknown-linux-gnu`
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/target_dev/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing ncurses from dev-dependencies for target `x86_64-unknown-linux-gnu`
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/update_lock_file/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing rustc-serialize from dependencies
Updating `dummy-registry` index
1 change: 0 additions & 1 deletion tests/testsuite/cargo_remove/workspace/stderr.log
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing semver from build-dependencies
Updating `dummy-registry` index
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing semver from build-dependencies
Updating `dummy-registry` index
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Removing semver from build-dependencies
Updating `dummy-registry` index

0 comments on commit 72e66fb

Please sign in to comment.