cecton / roomba

Client library to use the Roomba's API
MIT License
8 stars 3 forks source link

Cargo compile error on Raspberry PI : attributes are not yet allowed on `if` expressions #13

Closed psa-jforestier closed 3 years ago

psa-jforestier commented 3 years ago

From a fresh install on a Raspberry Pi 3 (5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l GNU/Linux) :

$> sudo apt-get install cargo
(...)
$> cargo --version
cargo 1.42.1
$> rustc --version
rustc 1.41.1
$> cargo install --path roomba-cli
(...)
   Compiling async-mutex v1.4.0
   Compiling async-lock v2.4.0
error: attributes are not yet allowed on `if` expressions
   --> /home/jerome/.cargo/registry/src/github.com-1ecc6299db9ec823/async-lock-2.4.0/src/mutex.rs:165:13
    |
165 |             #[cfg(not(target_arch = "wasm32"))]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: could not compile `async-lock`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `roomba-s9plus-cli v0.1.0 (/home/jerome/roomba/roomba-cli)`, intermediate artifacts can be found at `/home/jerome/roomba/target`

Caused by:
  build failed
cecton commented 3 years ago

This happens because you're on an old version of Rust. Try using the latest one instead:

  1. Uninstall the packages cargo (and maybe others that got installed)
  2. Follow instructions on https://rustup.rs/
cecton commented 3 years ago

wow, rustc 1.41 is a pre-covid era version 😮 from back in the days we were commuting a lot to the office. I remember

cecton commented 3 years ago

(But don't hesitate to tell me if you still have issues! ^_^)

psa-jforestier commented 3 years ago

Fixed by installing Rust & Cargo by hand :

sudo apt-get autoremove cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Now it compiles. But my device (Roomba 976) seems not supported right now (related to https://github.com/cecton/roomba/issues/7 )