Skip to content

Tracking issue for install-upgrade #6797

@ehuss

Description

@ehuss

Original issue: #6667
Implementation PR: #6798
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#install-upgrade

Summary
Instead of failing when cargo install detects a package is already installed, it will upgrade if the versions don't match, or do nothing (exit 0) if it is considered "up-to-date".

cargo +nightly install foo -Z install-upgrade

Unresolved questions

  • Is it tracking the correct information? There are many other settings that could be tracked (rustc, env variables, changes in dependencies in Cargo.lock, mtime for path sources, etc). The current set was chosen to be practical and simple and should cover most use cases. Otherwise --force is intended as a workaround for more advanced requirements.
  • Should there be a way to upgrade all outdated packages? (See Proposal: cargo install with upgrades #6667 for more about this.)
  • Should --no-track be kept, or is there a better approach for packaging? Does it have the right behavior? See also Please provide a cargo install option to not write .crates.toml #3316.
  • Should this be the new default? Should there be an option to disable upgrades and revert to the old behavior?
  • If a new version of a package drops a binary, should those dropped binaries be uninstalled when the new package is installed? Currently it only replaces binaries. Fixed in cargo install: Remove orphaned executables. #7246

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions