cargo-edit: no longer upgrading toml files

when i run cargo upgrade it used to actually change the .toml files, now all i get is a printout saying it found updates.

> cargo upgrade --workspace
    Updating 'https://github.com/rust-lang/crates.io-index' index
    Checking mylib's dependencies
note: Re-run with `--verbose` to show all dependencies
  compatible: anyhow, url
  unchanged: httpmock, serde, serde_json, toml_edit, ureq
    Checking myapp's dependencies
note: Re-run with `--verbose` to show all dependencies
  compatible: anyhow
  unchanged: clap, dirs, mylib, log, rpassword, serde, simplelog
note: Re-run with `--to-lockfile` to upgrade compatible version requirements

running with --verbose only gives a table but still does nothing. even running without workspace in a crate dir only prints the same. --to-lockfile does nothing since the toml doesnt change.

behavior doesnt match description of either the app or the args. can either the app or docs be fix please for correct behavior otherwise app is useless since someone needs to manually find versions and update the tomls and then upgrade the lockfile

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17

Most upvoted comments

The new behavior is described in that link but the tl;dr is that cargo upgrade -i will give you most of the old-old cargo upgrade behavior; no cargo update needed.

i literally just did but here is my toml. also see https://github.com/killercup/cargo-edit/issues/761 which repros the issue and has the same problem i do

use this toml, run cargo upgrade and see nothing change. i have my files in git so i can prove it doesnt change with git status. not even lockfile change. so its not just cargo upgrade showing no change its git too.

[package]
name = "mylib"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = { version = "1.0.63", default-features = false, features = ["std"] }
serde = { version = "1.0.144", features = ["derive"] }
serde_json = "1.0.85"
toml_edit = { version = "0.14.4", features = ["easy"] }
ureq = { version = "2.5.0", features = ["json", "tls"] }
url = { version = "2.2.2", default-features = false }

[dev-dependencies]
httpmock = { version = "0.6.6", default-features = false }

i just downgrade to 0.9.1 and it WORKS and upgrades my TOML files like i expect. this is regression in new version and no longer work. 0.10.0 and newer does nothing and changes no files.

with 0.9.1 i see this which updates files and is different that my original comment output

> cargo upgrade --workspace
    Updating 'https://github.com/rust-lang/crates.io-index' index
mylib:
    Upgrading anyhow v1.0.63 -> v1.0.64
    Upgrading url v2.2.2 -> v2.3.1
myapp:
    Upgrading anyhow v1.0.63 -> v1.0.64

cc @U007D @mqudsi from that thread if they want to add info or get a working version of this