Installing `cargo-shuttle` fails
# help
c
When trying to install the newest version via
cargo install cargo-shuttle
, I get the following compile error:
Copy code
error[E0308]: mismatched types
  --> /home/glitch/.cargo/registry/src/github.com-1ecc6299db9ec823/shuttle-common-0.17.0/src/models/error.rs:27:43
   |
27 |             self.message.to_string().with(Color::Red)
   |                                      ---- ^^^^^^^^^^ expected `crossterm::style::Color`, found `comfy_table::Color`   |                                      |
   |                                      arguments to this method are incorrect
   |
   = note: `comfy_table::Color` and `crossterm::style::Color` have similar names, but are actually distinct types
note: `comfy_table::Color` is defined in crate `crossterm`
  --> /home/glitch/.cargo/registry/src/github.com-1ecc6299db9ec823/crossterm-0.26.1/src/style/types/color.rs:28:1
   |
28 | pub enum Color {
   | ^^^^^^^^^^^^^^
note: `crossterm::style::Color` is defined in crate `crossterm`
  --> /home/glitch/.cargo/registry/src/github.com-1ecc6299db9ec823/crossterm-0.25.0/src/style/types/color.rs:28:1
   |
28 | pub enum Color {
   | ^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `crossterm` are being used?
note: method defined here
  --> /home/glitch/.cargo/registry/src/github.com-1ecc6299db9ec823/crossterm-0.25.0/src/style/stylize.rs:78:8
   |
78 |     fn with(self, color: Color) -> Self::Styled {
g
Copy pasting from the feedback channel: Could be some dependency that broke semver perhaps? Try installing with binstall or with --locked.
c
Yeah, external semver breakage is very likely. I completely forgot about
--locked
, thanks!
c
out of curiosity, what does --locked do?
a
Locks the dependencies
a crate owner decided it was a good idea to push a new crate version with breaking changes on friday
g
If shuttle has a dependency on
abc="1.0.0"
(in its lock file) but abc 1.1.0 has been released, installing without locked mode would grab 1.1.0. If that update had a breaking change, you would end up with a "too new" version. --locked makes you use exactly the version in the lock file.
a
If I get time over the weekend I'll address the issues since obviously, not being able to install is kinda bad
c
The best solution would be to just file a report to
comfy_table
and get them to yank their
6.2.0
release
a
I'll file a gh issue. Hopefully it won't have been an intentional break
c
Seems like they just merged a dependabot PR. Probably on accident
ngl, dependabot just making PRs for semver-incompatible versions is kinda dangerous
They should at least add a big scary warning to the PR body
g
Depends on if the project has good CI, but yeah
c
if with
--locked
is the only way to guarantee the installation is going to build... shouldnt that be the default? or am i misunderstanding something
a
If you want the latest version you don't use
--locked
- however this kind of issue while rare, can happen which is why this is the solution. It's just unfortunate because it's a Friday evening 💀
g
It assumes the community follows semver and only upgrades non-breaking patches. But yeah, with more power comes more responsibility
a
posted a gh issue on the repo - we just have to wait and see now
g
there is one already
a
that was me
wait is this on the comfy-table repo?
g
aha, I thought you meant shuttle repo
c
i think im the one that made the shuttle repo one
a
ah - no I posted an issue on comfy-table's repo, just praying they come back soon lol
c
ah ye thats me
g
It's good for visibility
Especially now that there will be more people flowing in
c
indeed
a
yeah definitely
once it's rolled back i'll respond to that thread
Ok I have figured out what the issue is
It looks like we are running 0.25.0 crossterm and because comfy-table uses 0.26.0 crossterm
we need to update but there's currently no engineers on 😂
g
Yes, it is a conflict, but it must have been triggered by a non semver-breaking patch upstream, right?
c
so in theory the fix would just be upgrading to crossterm .26?
so just editing the cargo.toml?
g
I think there are lots of breaking changes in that version bump, so it might not
a
I had a look and it doesn't look like there are that many - the main issue is that there's nobody with write access on who can merge PRs at the moment
c
is this a good first issue tho? 👀
a
Don't see why not
c
been meaning to contribute to open source but havent yet... this could be my first. i'll give it a shot later today if no-one's done it by then
c
Yeah, but that's still a semver breaking change. They consciously tied their versioning to crossterm's, where a 0.x release is an incompatible one, by exposing them in their public API
They can't just jump from 0.25 to 0.26 on a minor version change
a
Hmmmm, yeah I guess
c
Gave my two cents in your issue, but if everyone upgrades and no one complains, was it really breaking?
@agreeable-painting-48846 Thought I'd ping you. The developer of
comfy-table
is looking for feedback from users that hit the semver issue, it seems like they are thinking about revamping their API to prevent something like this in the future