analog-hors/tantabus

can not compile (on Linux)

Closed this issue · 7 comments

hi,
i tried to compile Tantabus by 'cargo build --release' and just 'cargo build' but i get errors .. i'm not into Rust, but i encounter programmers who use Nightly .. maybe this is the problem? I do not have Nightly installed (and i don't like to).
Btw. i use Xubuntu 20.04

$ cargo build
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.29
   Compiling unicode-xid v0.2.2
   Compiling libc v0.2.101
   Compiling ucd-trie v0.1.3
   Compiling syn v1.0.75
   Compiling maplit v1.0.2
   Compiling cozy-chess-types v0.1.0
   Compiling arrayvec v0.7.1
error[E0658]: arbitrary expressions in key-value attributes are unstable
 --> /home/tissatussa/.cargo/registry/src/github.com-1ecc6299db9ec823/cozy-chess-types-0.1.0/src/lib.rs:1:10
  |
1 | #![doc = include_str!("../README.md")]
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information

error[E0658]: arbitrary expressions in key-value attributes are unstable
  --> /home/tissatussa/.cargo/registry/src/github.com-1ecc6299db9ec823/cozy-chess-types-0.1.0/src/helpers.rs:14:21
   |
14 |               #[doc = concat!("The number of [`", stringify!($name), "`] variants.")]
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | 
  ::: /home/tissatussa/.cargo/registry/src/github.com-1ecc6299db9ec823/cozy-chess-types-0.1.0/src/color.rs:1:1
   |
1  | / crate::helpers::simple_enum! {
2  | |     /// A side to move.
3  | |     #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4  | |     pub enum Color {
...  |
7  | |     }
8  | | }
   | |_- in this macro invocation
   |
   = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: arbitrary expressions in key-value attributes are unstable
  --> /home/tissatussa/.cargo/registry/src/github.com-1ecc6299db9ec823/cozy-chess-types-0.1.0/src/helpers.rs:16:21
   |
16 |               #[doc = concat!("An array of all [`", stringify!($name), "`] variants.")]
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | 
  ::: /home/tissatussa/.cargo/registry/src/github.com-1ecc6299db9ec823/cozy-chess-types-0.1.0/src/color.rs:1:1
   |
1  | / crate::helpers::simple_enum! {
2  | |     /// A side to move.
3  | |     #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4  | |     pub enum Color {
...  |
7  | |     }
8  | | }
   | |_- in this macro invocation
   |
   = note: see issue #78835 <https://github.com/rust-lang/rust/issues/78835> for more information
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

[...]



Compiling hashbrown v0.11.2
error: aborting due to 30 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `cozy-chess-types`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

Looks like it can't compile cozy-chess. It complains about rust-lang/rust#78835, but this was stabilized a long time ago. Try upgrading your Rust version? I believe cozy-chess needs at least version 1.56.0 due to it using the 2021 edition. If you installed Rust using rustup (recommended), rustup update should work.

Also make sure to compile with cargo build --release, cargo build is a debug version.

i tried :

$ rustup update

Command 'rustup' not found, but can be installed with:

sudo snap install rustup

$ sudo snap install rustup
error: This revision of snap "rustup" was published using classic confinement and thus may perform
       arbitrary system changes outside of the security sandbox that snaps are usually confined to,
       which may put your system at risk.

       If you understand and want to proceed repeat the command including --classic.

because of this warning, i did not yet do this .. normally i prefer installing by apt or Synaptic .. i read that snap can give troubles when combined with programs installed by apt .. what is your advise ? Is it safe to install rustup by snap ?

I am mostly unfamiliar with Linux. I have been told the best course of action is to uninstall the current Rust installation and then reinstall it through the instructions on https://rustup.rs/.

thanks .. i will investigate this now and i will post a reply soon .. btw. i have rustc v1.53.0 which was installed by apt .. so, when installing rustup by snap, it may interfere with apt on my linux system .. this is what i think, but i'm not sure. Btw. using Linux is cool ! Do you (still) use Windows ?

I mainly use Windows, yes. Should probably uninstall the apt rustc for the reason you mention. Its version is too old anyway. Make sure the Rust version you get is at least 1.56 (rustup should install the latest I believe).

OK, i managed to install your Tantabus :

$ ./tantabus-uci 
uci
id name Tantabus
id author Analog Hors
option name UCI_Chess960 type check default false
option name Hash type spin default 16 min 0 max 64000
option name PercentTimePerMove type spin default 5 min 0 max 100
option name MinimumTimeUsedPerMove type spin default 0 min 0 max 86400000
uciok

and it runs fine in CuteChess !
btw. indeed i decided to unstall rustc (and thus also cargo) which were installed by apt on my system .. then i installed rustup by the link you provided .. that way also rustc and cargo were installed .. i have rustc v1.56.1 now.
Thanks !