exul / matrix-rocketchat

Application service to bridge Matrix <-> Rocket.Chat.
Apache License 2.0
70 stars 5 forks source link

Build fails on latest rust nightly #40

Closed grdryn closed 6 years ago

grdryn commented 6 years ago

Hi!

I tried building this locally using the instructions in the readme to get rust nightly with rustup (I don't really know anything about building things with rust).

I got the following build errors:

error[E0277]: the trait bound `EventId: std::convert::From<&std::string::String>` is not satisfied
   --> /home/grdryn/.cargo/registry/src/github.com-1ecc6299db9ec823/ruma-identifiers-0.11.0/src/lib.rs:697:21
    |
697 |                     $crate::$name::try_from(&string)
    |                     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<&std::string::String>` is not implemented for `EventId`
...
763 |     diesel_impl!(EventId);
    |     ---------------------- in this macro invocation
    |
    = note: required because of the requirements on the impl of `std::convert::TryFrom<&std::string::String>` for `EventId`

error[E0277]: the trait bound `RoomAliasId: std::convert::From<&std::string::String>` is not satisfied
   --> /home/grdryn/.cargo/registry/src/github.com-1ecc6299db9ec823/ruma-identifiers-0.11.0/src/lib.rs:697:21
    |
697 |                     $crate::$name::try_from(&string)
    |                     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<&std::string::String>` is not implemented for `RoomAliasId`
...
764 |     diesel_impl!(RoomAliasId);
    |     -------------------------- in this macro invocation
    |
    = note: required because of the requirements on the impl of `std::convert::TryFrom<&std::string::String>` for `RoomAliasId`

error[E0277]: the trait bound `RoomId: std::convert::From<&std::string::String>` is not satisfied
   --> /home/grdryn/.cargo/registry/src/github.com-1ecc6299db9ec823/ruma-identifiers-0.11.0/src/lib.rs:697:21
    |
697 |                     $crate::$name::try_from(&string)
    |                     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<&std::string::String>` is not implemented for `RoomId`
...
765 |     diesel_impl!(RoomId);
    |     --------------------- in this macro invocation
    |
    = note: required because of the requirements on the impl of `std::convert::TryFrom<&std::string::String>` for `RoomId`

error[E0277]: the trait bound `RoomIdOrAliasId: std::convert::From<&std::string::String>` is not satisfied
   --> /home/grdryn/.cargo/registry/src/github.com-1ecc6299db9ec823/ruma-identifiers-0.11.0/src/lib.rs:697:21
    |
697 |                     $crate::$name::try_from(&string)
    |                     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<&std::string::String>` is not implemented for `RoomIdOrAliasId`
...
766 |     diesel_impl!(RoomIdOrAliasId);
    |     ------------------------------ in this macro invocation
    |
    = note: required because of the requirements on the impl of `std::convert::TryFrom<&std::string::String>` for `RoomIdOrAliasId`

error[E0277]: the trait bound `UserId: std::convert::From<&std::string::String>` is not satisfied
   --> /home/grdryn/.cargo/registry/src/github.com-1ecc6299db9ec823/ruma-identifiers-0.11.0/src/lib.rs:697:21
    |
697 |                     $crate::$name::try_from(&string)
    |                     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<&std::string::String>` is not implemented for `UserId`
...
767 |     diesel_impl!(UserId);
    |     --------------------- in this macro invocation
    |
    = note: required because of the requirements on the impl of `std::convert::TryFrom<&std::string::String>` for `UserId`

error: aborting due to 5 previous errors

error: Could not compile `ruma-identifiers`.
warning: build failed, waiting for other jobs to finish...
error: build failed
exul commented 6 years ago

Thank you for reporting, this seems to be due to a change in Rust regarding the from and try_from trait. I'm working on a fix.

grdryn commented 6 years ago

Cool, thanks, I look forward to trying this out! :)

exul commented 6 years ago

I just merged a branch that should fix the latest nightly errors. I also updated the travis configuration to not use a docker container anymore, as this should help to spot problems with updates on nightly earlier. It increases the built time on the CI, but that should not be a problem. It also leads to a wrong test coverage, but I'll fix that in another PR.

Cool, thanks, I look forward to trying this out! :)

That's great to hear, but make sure you're not trying in a production environemement, because it will pollute your homeserver with aliases that will potentially change in the future. I'm still trying to figure out what's the right way to store state (in a separate database or as part of the room).

exul commented 6 years ago

Closing this, since this was fixed by #41. Feel free to reopen if there are still problems.