Announcing `cargo-edit` v0.3.0

cargo-edit is a command-line tool that allows you to add, remove and upgrade dependencies in your Cargo.toml. We've just released v0.3.0 of cargo-edit, our first full release in nearly a year.

The key feature of v0.3.0 is that we try not to mess up your Cargo.toml files any more. We've switched from serde to toml-edit, a formatting-aware toml parser.

Some of the other cool features:

  • Proxy support via environment variable
  • Allow simultaneous specification of both version and path
  • cargo-upgrade now supports --precise, --dry-run, --all, and --allow-prerelease.
  • Better error messages

We've still got more to do, though. There's work underway to create a new toml parser that can handle the last few edge cases. Once that's done, we can think about moving parts of cargo-edit into cargo itself. We've got a number of issues we're looking for help with, so check out our issue list.

Thanks to all the contributors since v0.2.0: @bjgill, @dherman , @Eijebong, @ibabushkin, @killercup, @mrcnski, @ordian, @vitiral, and @whentze

17 Likes

Wonderful! A “cargo add” is one of our most requested features. Thanks for all your work!

2 Likes

This is great news!

I myself have had cargo-edit installed since forever, but until now I have limited its use to only small, throwaway test crates due to the format clobbering. It's great to see roundtrip TOML parsers gaining traction in the ecosystem!

I'm so glad this is finally published! :slight_smile:

You can install/update it with cargo install --force cargo-edit.

I'm getting the following error on Windows when I run cargo install --force cargo-edit:

   Compiling phf_codegen v0.7.22
   Compiling serde_derive v1.0.66
   Compiling mime_guess v2.0.0-alpha.4
error[E0658]: macro is_x86_feature_detected! is unstable (see issue #0)
  --> C:\Users\gurinder.singh\.cargo\registry\src\github.com-1ecc6299db9ec823\regex-1.0.1\src\vector\avx2.rs:11:12
   |
11 |         if is_x86_feature_detected!("avx2") {
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add #![feature(stdsimd)] to the crate attributes to enable

error[E0658]: macro is_x86_feature_detected! is unstable (see issue #0)
  --> C:\Users\gurinder.singh\.cargo\registry\src\github.com-1ecc6299db9ec823\regex-1.0.1\src\vector\ssse3.rs:23:12
   |
23 |         if is_x86_feature_detected!("ssse3") {
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add #![feature(stdsimd)] to the crate attributes to enable

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `regex`.

The rust version I'm using is nightly-2018-03-30-x86_64-pc-windows-msvc. Does the regex crate need updating?

These macros has been added as part of the new SIMD support that got added to stable in 1.27 Announcing Rust 1.27 | Rust Blog

Does this mean regex crate has a genuine compilation problem with the latest nightly?

You're not using the latest nightly though? In your post above, you say you're using nightly-2018-03-30-x86_64-pc-windows-msvc, which is three months old.

Whoops! How could have I missed that? Sorry. False alarm :neutral_face:

1 Like