Skip to content
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

Switch to using cargo-edit for cargo upgrade command #61

Merged
merged 1 commit into from
May 8, 2024

Conversation

willbush
Copy link
Member

@willbush willbush commented May 6, 2024

The current cargo update command updates the version of dependencies in the Cargo.lock file based on the semver compatibility. It will not change the version range specified in the Cargo.toml file.

@willbush willbush requested a review from a team as a code owner May 6, 2024 02:20
@willbush willbush marked this pull request as draft May 6, 2024 02:24
@willbush willbush marked this pull request as ready for review May 6, 2024 02:49
@willbush
Copy link
Member Author

willbush commented May 6, 2024

Ran this locally to test (had to comment out githubActions in default.nix:

cargo changes
    Updating 'https://github.com/rust-lang/crates.io-index' index
    Checking nixpkgs-check-by-name's dependencies
name          old req compatible latest  new req
====          ======= ========== ======  =======
regex         1.9.3   1.10.4     1.10.4  1.10.4
clap          4.3.23  4.5.4      4.5.4   4.5.4
serde_json    1.0.105 1.0.116    1.0.116 1.0.116
tempfile      3.8.0   3.10.1     3.10.1  3.10.1
serde         1.0.185 1.0.200    1.0.200 1.0.200
colored       2.0.4   2.1.0      2.1.0   2.1.0
rowan         0.15.11 0.15.15    0.15.15 0.15.15
indoc         2.0.4   2.0.5      2.0.5   2.0.5
relative-path 1.9.2   1.9.3      1.9.3   1.9.3
temp-env      0.3.5   0.3.6      0.3.6   0.3.6
   Upgrading recursive dependencies
    Updating libc v0.2.153 -> v0.2.154
    Updating rustix v0.38.33 -> v0.38.34
note: Re-run with `--incompatible` to upgrade incompatible version requirements
note: Re-run with `--verbose` to show more dependencies
  incompatible: itertools
  latest: 4 packages
Running /nix/store/37c31fdckdpmyk3024xh2fwrbm48y2lm-update-npins
npins changes
[INFO ] Updating 'nixpkgs' …
Changes:
-    url: https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre615035.f2d7a289c5a5/nixexprs.tar.xz
+    url: https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre622008.ee4a6e0f566f/nixexprs.tar.xz
-    hash: 1dz3qjnvrqk8j0i90dn2lz64p51mva1cizznhshas1pbr4v2p2za
+    hash: 0pa8g6a8xg03pbqc98vm36cffjpk5ihmfa43vms86zb4xc1hq1n4
[INFO ] Updating 'treefmt-nix' …
Changes:
-    revision: 49dc4a92b02b8e68798abd99184f228243b6e3ac
+    revision: c6aaf729f34a36c445618580a9f95a48f5e4e03f
-    url: https://github.com/numtide/treefmt-nix/archive/49dc4a92b02b8e68798abd99184f228243b6e3ac.tar.gz
+    url: https://github.com/numtide/treefmt-nix/archive/c6aaf729f34a36c445618580a9f95a48f5e4e03f.tar.gz
-    hash: 0qlhb0xvcc3al19irclxk7vnppd9m6b5vi3nbjb9dylphs306x1p
+    hash: 18491j2law88zdkfxrpg2snbcig34pfcg7ykgjwf6ahbdq313zj2
[INFO ] Update successful.

@philiptaron
Copy link
Contributor

Man, I don't know. semver is just someone's opinion in practice. I kind of prefer the "update and see if it builds and tests" approach we have today.

The `cargo update` command updates the version of the dependency in the
`Cargo.lock` file based on the semver compatibility specified in the `Cargo.toml`
file. It will not change the version range specified in the `Cargo.toml` file.
@willbush
Copy link
Member Author

willbush commented May 6, 2024

Man, I don't know. semver is just someone's opinion in practice. I kind of prefer the "update and see if it builds and tests" approach we have today.

I didn't notice that I had to add --incompatible to allow it to jump major versions. I just force pushed a change to add that.

I can't tell if that's what you meant or if you thought I was changing it to respect semver. Currently cargo update won't ever let us know that a new major version exists. cargo upgrade --incompatible will basically upgrade everything to latest and we'll see if it builds and tests.

Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some research. I think this works.

@philiptaron philiptaron merged commit 23aca77 into NixOS:main May 8, 2024
3 checks passed
@willbush willbush deleted the use-cargo-edit-upgrade branch May 8, 2024 20:46
@infinisil
Copy link
Member

Note that CI also runs the update command for you: https://github.com/NixOS/nixpkgs-check-by-name/actions/runs/8976276467#summary-24652778846 😉

Looking good to me btw, thanks for taking care of this!

@willbush willbush mentioned this pull request May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants