These are chat archives for rust-lang/rust

26th
May 2018
brotzeit
@brotzeit
May 26 2018 09:17
is there a way to update crate versions in Cargo.toml files...I just found cargo outdated but it seems it's just able to show outdated crates
Andrey Lesnikov
@ozkriff
May 26 2018 09:19
check https://github.com/killercup/cargo-edit#cargo-upgrade (though I usually prefer to do it manually)
brotzeit
@brotzeit
May 26 2018 09:28
thanks...why do you prefer to do it manually...are there any downsides ?
Andrey Lesnikov
@ozkriff
May 26 2018 09:31
i find it easier to update one dependency at a time: check that everything still compiles and works - or read the info about breaking changes in the changelog and update my code one piece at a time
brotzeit
@brotzeit
May 26 2018 09:34
I see...is cargo-edit also able to just display the currently installed version and the latest version available
Michal 'vorner' Vaner
@vorner
May 26 2018 09:35
@brotzeit There are downsides. cargo update does it automatically, but only according to semver compatibility ‒ so your code should not break. But going through semver-incompatible changes doesn't guarantee it will still compile or do the correct thing. So you might need to make changes or just decide not to update some of them while still updating others.
Andrey Lesnikov
@ozkriff
May 26 2018 09:36
+1
btw, does everyone know about rustfest livestream - https://paris.rustfest.eu/livetime/ ? 🦀
brotzeit
@brotzeit
May 26 2018 09:39
so it would be possible to update to the latest compatible version...theoretically
cargo-outdated shows compatible versions https://github.com/kbknapp/cargo-outdated#demo
Michal 'vorner' Vaner
@vorner
May 26 2018 09:40
Yes, cargo update does just that. These are updated in Cargo.lock.
(and cargo update is part of the basic cargo, not a plugin)
Andrey Lesnikov
@ozkriff
May 26 2018 09:43

is cargo-edit also able to just display the currently installed version and the latest version available

nope, if i remember correctly, cargo-upgrade (part of cargo-edit package) updates Cargo.toml if called without arguments:

# Upgrade all dependencies for the current crate
$ cargo upgrade
brotzeit
@brotzeit
May 26 2018 09:46
I'm asking because I'd like to implement something for emacs that simplifies handling of crate version...thanks for the info...maybe I can find a solution
Tembo
@Tembocs
May 26 2018 20:25
Hi, what exactly is cargo-fix?
Denis Lisov
@tanriol
May 26 2018 20:28
@Tembocs Some errors/warnings/lints provide suggestions how to fix your code. cargo-fix can apply them automatically.
Ed Page
@epage
May 26 2018 20:30
@brotzeit @ozkriff alternatively you can configure a bot to periodically update your dependencies
https://dependabot.com/
For example, I have it scheduled to create a PR per dependency that needs upgrading every Monday. If a semver break fails, I'm at least now aware of it and can take care of it manually
See https://crate-ci.github.io/dependencies/updates.html for further notes on it
(not affiliated, just glad someone else wrote it so I wouldn't have to)
Tembo
@Tembocs
May 26 2018 20:31
@tanriol @ozkriff thank you very much.
Andrey Lesnikov
@ozkriff
May 26 2018 20:33
@epage hmmm. not sure, I'm really afraid of updating the deps without locally checking how it works first, but i'll check it :)
currently i'm using https://deps.rs/repo/github/ozkriff/zemeroth badge in the readme as a reminder that something is outdated and a quick way to see what exactly
Ed Page
@epage
May 26 2018 20:35
Yeah, it depends on how much you trust your tests
but in an ecosystem that encourages a lot of small crates, it becomes too much to micromanage their dependencies' versions
Andrey Lesnikov
@ozkriff
May 26 2018 20:43

it depends on how much you trust your tests

and the problem in my case is that it's hard to write tests for a game

Ed Page
@epage
May 26 2018 20:43
Yup