Skip to content

Commit

Permalink
removed breaking changes related to command
Browse files Browse the repository at this point in the history
  • Loading branch information
jofas committed Feb 26, 2023
1 parent 85eb79c commit 086a3ff
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 56 deletions.
3 changes: 0 additions & 3 deletions src/bin/cargo/commands/uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ pub fn cli() -> Command {
}

pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
// Ignore local configuration, same as `cargo install` does
config.reload_rooted_at(config.home().clone().into_path_unlocked())?;

let root = args.get_one::<String>("root").map(String::as_str);

if args.is_present_with_zero_values("package") {
Expand Down
6 changes: 0 additions & 6 deletions src/doc/man/cargo-uninstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ By default all binaries are removed for a crate but the `--bin` and

{{> description-install-root }}

This command operates on system or user level, not on project level.
This means that the local [configuration discovery] is ignored.
Instead, the configuration discovery begins at `$CARGO_HOME/config.toml`.

[configuration discovery]: ../reference/config.html#hierarchical-structure

## OPTIONS

### Install Options
Expand Down
6 changes: 0 additions & 6 deletions src/doc/man/generated_txt/cargo-uninstall.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ DESCRIPTION

o $HOME/.cargo

This command operates on system or user level, not on project level.
This means that the local configuration discovery
<https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure>
is ignored. Instead, the configuration discovery begins at
$CARGO_HOME/config.toml.

OPTIONS
Install Options
-p, --package spec…
Expand Down
6 changes: 0 additions & 6 deletions src/doc/src/commands/cargo-uninstall.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ The installation root is determined, in order of precedence:
- `$HOME/.cargo`


This command operates on system or user level, not on project level.
This means that the local [configuration discovery] is ignored.
Instead, the configuration discovery begins at `$CARGO_HOME/config.toml`.

[configuration discovery]: ../reference/config.html#hierarchical-structure

## OPTIONS

### Install Options
Expand Down
4 changes: 0 additions & 4 deletions src/etc/man/cargo-uninstall.1
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ The installation root is determined, in order of precedence:
.RS 4
\h'-04'\(bu\h'+02'\fB$HOME/.cargo\fR
.RE
.sp
This command operates on system or user level, not on project level.
This means that the local \fIconfiguration discovery\fR <https://doc.rust\-lang.org/cargo/reference/config.html#hierarchical\-structure> is ignored.
Instead, the configuration discovery begins at \fB$CARGO_HOME/config.toml\fR\&.
.SH "OPTIONS"
.SS "Install Options"
.sp
Expand Down
31 changes: 0 additions & 31 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1834,37 +1834,6 @@ fn install_path_config() {
.run();
}

#[cargo_test]
fn uninstall_should_ignore_local_config() {
let project = project()
.file(
".cargo/config",
r#"
[install]
root = './'
"#,
)
.file("src/main.rs", "fn main() {}")
.build();

// Will install `foo` binary to `/path/to/foo/bin/foo`
cargo_process("install --path foo").run();

assert_has_installed_exe(project.root(), "foo");

// Won't find the `foo` executable, because `cargo uninstall`
// ignores the config resolution chain of the current work directory
cargo_process("uninstall foo")
.cwd("foo")
.with_status(101)
.with_stderr_contains(
"[..]error: package ID specification `foo` did not match any packages[..]",
)
.run();

cargo_process("uninstall foo --root foo").run();
}

#[cargo_test]
fn install_version_req() {
// Try using a few versionreq styles.
Expand Down

0 comments on commit 086a3ff

Please sign in to comment.