Zoxc / crusader

A network bandwidth and latency tester.
Apache License 2.0
95 stars 8 forks source link

Build fail against unstable crusader lib #10

Closed yorkshiredemon closed 1 year ago

yorkshiredemon commented 1 year ago

sudo apt update && sudo apt upgrade -y
sudo apt install build-essential -y
sudo apt install cargo -y
sudo snap install rustup --classic
sudo rustup toolchain install nightly
sudo rustup run nightly rustc --version
sudo rustup default nightly
sudo rustup update
git clone https://github.com/Zoxc/crusader.git
cd /home/xxxx/crusader/src
sudo cargo build --release```

# Followed the guidelines and use a nightly build of rust; from the 'note' message below.  Any guidance please.

Compiling crusader-lib v0.0.9 (/home/xxxx/crusader/src/crusader-lib)
error[E0658]: use of unstable library feature 'bool_to_option'
   --> crusader-lib/src/serve.rs:236:73
    |
236 | ...                   (client.ip == ip_to_ipv6_mapped(addr.ip())).then_some(client)
    |                                                                   ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0658]: use of unstable library feature 'bool_to_option'
   --> crusader-lib/src/serve.rs:498:64
    |
498 |                     (ip_to_ipv6_mapped(src.ip()) == client.ip).then_some((client, ping))
    |                                                                ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `crusader-lib` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Zoxc commented 1 year ago

You're probably using your distro's rustc here which is older than 1.62. You could try to run rustup run nightly cargo build --release.

yorkshiredemon commented 1 year ago

Fixed as per below instructions


sudo apt remove rustc
sudo apt remove cargo
sudo apt update && sudo apt upgrade -y
curl https://sh.rustup.rs -sSf | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo rustup toolchain install nightly-aarch64
git clone https://github.com/Zoxc/crusader.git
cd /home/xxxx/crusader/src
sudo cargo build --release```