-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for install-upgrade #6797
Comments
That's probably a different feature right? Or why would we need to resolve this as part of this one?
I think this should behave like uninstalling the package, and then installing the newer one, so that would mean that yes, this should do that. Having said this, printing a |
Yea, in my original proposal I indicated it should probably be separate. I just included it here for completeness in case people felt it was important.
That sounds good to me. |
My perspective here is mostly that of an end-user, but having just read through the implementation PR I do have some opinions on these questions:
As you note, the current set (at least what is listed there) seems to me to be a pretty good set of distinguishers between versions. I was personally only thinking about versions as being criteria—this set also covers more information. It might be nice to update all installations that match the given criteria. For example, if I've installed for target
I think so, but I don't see a way to make this fit with the verbiage
Based on the description given, I think it's just about right. For packaging, I personally am of the mind that In building Docker images with Crates, I think having
For the I could definitely see a
I think replacement of remaining binaries is fine, with a warning added indicating that binaries were dropped. Though, since doing so would require comparison of the former and latter states anyhow, it might just be better to uninstall dangling binaries and warn the user that you did that. This could also be toggleable behavior. (Proposal: There is one additional item—I would like the final version of this feature to just reuse |
I would've preferred this as a flag like: |
`cargo install`: Remove orphaned executables. When a new version of a package is installed that no longer contains an executable from a previous version, this change causes those orphaned executables to also be removed. I can place this new behavior behind the `install-upgrade` feature gate if anyone is uncomfortable with changing the behavior now. cc #6797
Will this also compile the crate with the nightly toolchain? Is there a way to use the install-upgrade command from nightly but compile the actual crate with stable? |
@kathampy This feature is nightly-only until it is stabilized. |
I do think it is important to have. ❤️ |
1664: chore: update get_block_template rpc doc r=quake,u2,keroro520,yangby-cryptape a=shaojunda replace difficulty with compact_target 1669: chore(test): Allow CI debug logs r=u2,zhangsoledad a=keroro520 The number of logs is acceptable after #1474. 1671: test: disconnect check by all part r=u2,keroro520,quake a=driftluo Disconnect check by all part 1673: docs: Update PoW mining algorithm description r=u2,quake a=ashchan Now that this has been decided the doc should reflect that before the next round of mining test. 1680: fix: get_block_transactions_process r=u2,quake a=zhangsoledad 1689: chore: issuance comment r=u2,quake a=zhangsoledad comments were lost on rebase 1690: ci: Make sure cargo-audit up-to-date r=quake,u2 a=zhangsoledad rustsec/rustsec#143 https://internals.rust-lang.org/t/idea-cargo-install-update/11072 rust-lang/cargo#6797 1691: chore: speed up maturity test r=u2,quake a=zhangsoledad Co-authored-by: shaojunda <shaojunda@gmail.com> Co-authored-by: keroro520 <keroroxx520@gmail.com> Co-authored-by: driftluo <driftluo@foxmail.com> Co-authored-by: James Chen <james@ashchan.com> Co-authored-by: zhangsoledad <787953403@qq.com>
1680: fix: get_block_transactions_process r=u2,quake a=zhangsoledad 1689: chore: issuance comment r=u2,quake a=zhangsoledad comments were lost on rebase 1690: ci: Make sure cargo-audit up-to-date r=quake,u2 a=zhangsoledad rustsec/rustsec#143 https://internals.rust-lang.org/t/idea-cargo-install-update/11072 rust-lang/cargo#6797 1691: chore: speed up maturity test r=u2,quake a=zhangsoledad 1693: test: simple header field json format check r=quake,u2 a=zhangsoledad 1696: fix: set `next_epoch_diff` to one instead of panic when it is zero r=zhangsoledad,u2 a=doitian Co-authored-by: zhangsoledad <787953403@qq.com> Co-authored-by: ian <ian@nervos.org>
1680: fix: get_block_transactions_process r=u2,quake a=zhangsoledad 1689: chore: issuance comment r=u2,quake a=zhangsoledad comments were lost on rebase 1690: ci: Make sure cargo-audit up-to-date r=quake,u2 a=zhangsoledad rustsec/rustsec#143 https://internals.rust-lang.org/t/idea-cargo-install-update/11072 rust-lang/cargo#6797 1691: chore: speed up maturity test r=u2,quake a=zhangsoledad 1693: test: simple header field json format check r=quake,u2 a=zhangsoledad 1696: fix: set `next_epoch_diff` to one instead of panic when it is zero r=zhangsoledad,u2 a=doitian Co-authored-by: zhangsoledad <787953403@qq.com> Co-authored-by: ian <ian@nervos.org>
I think we could adapt what pip do here about the command line flag.
Also, do we have any plan to stabilize this feature in near future? |
I am not following what this option has to do with Cargo. This feature is for installing binary packages and dependencies are not installed in a separate fashion (AIUI). Are you proposing that this subcommand will reinstall the binary package if any of its dependencies have updated since the binary was compiled? Do we even track that information? |
I have posted a proposal to stabilize at #7560. |
Is |
This was stabilized in 1.41 (#7560) and we still have all of the tests for it, so I presume it still works. Note that this is just about |
With rust 1.75 if I install an already installed package it errors. Can you please confirm? |
@frederikhors this is a closed issue, please don't bring up new issues here. Instead open a new issue and add all the usual details (steps to reproduce, the exact command you used, the exact output you got). |
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".Unresolved questions
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.cargo install
with upgrades #6667 for more about this.)--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.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 incargo install
: Remove orphaned executables. #7246The text was updated successfully, but these errors were encountered: