mavlink / mavlink2rest

mavlink2rest creates a REST server that provides mavlink information from a mavlink source
MIT License
68 stars 23 forks source link

Compilation Error on M2 MacOS 14 #92

Open neurons9 opened 5 months ago

neurons9 commented 5 months ago
Compiling ioctl-rs v0.1.6 error[E0277]: cannot subtract chrono::Duration from Tm --> /Users/joa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-http-1.0.1/src/cookie/jar.rs:224:44 224 cookie.set_expires(time::now() - Duration::days(365)); ^ no implementation for Tm - chrono::Duration
= help: the trait `Sub<chrono::Duration>` is not implemented for `Tm`
= help: the following other types implement trait `Sub<Rhs>`:
          <Tm as Sub<time::Duration>>
          <Tm as Sub>
Compiling lock_api v0.3.4 error[E0308]: mismatched types --> /Users/joa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-http-1.0.1/src/cookie/mod.rs:736:40 736 self.set_expires(time::now() + twenty_years); ^^^^^^^^^^^^ expected time::Duration, found chrono::Duration
= note: `chrono::Duration` and `time::Duration` have similar names, but are actually distinct types
note: chrono::Duration is defined in crate chrono --> /Users/joa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.31/src/duration.rs:55:1 55 pub struct Duration { ^^^^^^^^^^^^^^^^^^^ note: time::Duration is defined in crate time --> /Users/joa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.1.45/src/duration.rs:45:1
45 pub struct Duration {
^^^^^^^^^^^^^^^^^^^

how can I fix this? And what file type are the binaries for macOS in the releases?

patrickelectric commented 5 months ago

Hi @neurons9, this is pretty weird, mac M* family should be aarch64, there is a binary available on our release CI if you want to try.

How did you install Rust in your computer ? Did you follow the book ?

neurons9 commented 5 months ago

Hi @patrickelectric, thanks for your quick reply! I have installed Rust with the command: curl https://sh.rustup.rs -sSf | sh What file types are the binaries? I can't open or run them... ah got it... sorry

patrickelectric commented 5 months ago

I only have a mac m1 but I can compile fine here, from the issues that you are pointing, may be a dependence break or something. Try to cargo clean, cargo update and cargo build