Build error with the Salvo example: the trait `Fro...
# help
a
Hi, I've just installed Shuttle and thought I'd kick things off by using the Salvo example. However when I try to build it I hit this error:
Copy code
error[E0277]: the trait bound `SalvoService: From<Router>` is not satisfied
  --> src/main.rs:14:15
   |
14 |     Ok(router.into())
   |               ^^^^ the trait `From<Router>` is not implemented for `SalvoService`
   |
   = help: the trait `From<salvo_core::routing::router::Router>` is implemented for `SalvoService`
   = note: required for `Router` to implement `Into<SalvoService>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `simplicity` due to previous error
I haven't yet changed anything in the project. Thanks in advance! 🙂
a
What version of cargo-shuttle are you using and what version are the shuttle dependencies in the cargo.toml file?
Also hey there, welcome to shuttle 😄
a
I did a fresh install just 15 minutes ago 🙂 I've got version
0.16.0
of
cargo-shuttle
and my dependencies look like:
Copy code
shuttle-runtime = "0.16.0"
salvo = "0.41.0"
shuttle-salvo = "0.16.0"
tokio = "1.28.1"
I literally just did
cargo shuttle init
and picked the
Salvo
option. After it created the project it wasn't able to build.
I'm pretty sure I didn't touch anything else 😅
a
That's not ideal - I just tried it myself with a fresh project and it doesn't look like it works. I'll query this with the engineering team
a
cool thanks, I was starting to worry that it might have been just me 😁
a
Happy to help 🙂 in the meantime you could try just creating a custom service that implements salvo natively by simply following the custom service tutorial to just serve salvo at the provided http address from the
bind
fn in the shuttle service trait: https://docs.shuttle.rs/tutorials/custom-service
k
It seems like salvo had some breaking changes in a recent release, so it's not compatible with the version shuttle-salvo implements service for. Sorry about this, we'll get it fixed for next release! In the meantime you could use salvo 0.37 or 0.38, or implement custom service like Josh suggested
a
Thanks for looking into it so quickly! Out of interest, when would the next release likely to be? Just so I know what to expect 🙂
g
@kind-area-3810 Are we doing weekly releases during SB2?
Btw, fetching the latest version of a dep for a template never seemed like a good idea. Didn't know it was added 🙈
You could also do a 0.16.1 on
shuttle-salvo
k
We talked about doing it this week at least (meaning release on monday)
Indeed, we could do that!
Yes, I don't remember why we decided to do that in the first place 🙈 The cargo-generate PR should sort it out though
a
@gentle-ice-1561 is
0.16.1
generally available? 🙂
g
If you are looking for a fix for salvo, downgrading the version is the quickest fix
Sounds like next release is on Monday
a
Did the release go out as planned? I don't see an update, but just in case I'm being dense again I thought I'd ask 😄
g
Apparently not yet. @stocky-kangaroo-53672 when is the next release planned?
a
@stocky-kangaroo-53672 might it be this Monday? 😅
g
Hey @agreeable-parrot-72483 thanks for being patient! 🙂 The release is coming out tomorrow morning!
a
nice - thanks! 😄
g
@agreeable-parrot-72483 you should be good to go! 🙂
a
@gentle-agency-53651 works a treat! 🙂