TimJentzsch / stonefish_engine

An amateur chess engine written in Rust.
https://lichess.org/@/StonefishEngine
GNU General Public License v3.0
2 stars 0 forks source link

Compiling error #8

Closed rwbc closed 1 year ago

rwbc commented 2 years ago

Hello,

I get an error for compiling info.rs. This is on Win7 with Msys2 and cargo/rust package 1.57.0. I don't know much about Rust syntax and how format! works there, but the complained line is at the end of the built log.

Guenther Simon@CAPPUCCINO MINGW64 ~/stonefish_engine
$ cargo build --release
  Downloaded libc v0.2.108
  Downloaded mucow v0.1.0
  Downloaded memoffset v0.6.4
  Downloaded rayon-core v1.9.1
  Downloaded rayon v1.5.1
  Downloaded pleco v0.5.0
  Downloaded 6 crates (890.7 KB) in 7.37s
   Compiling rand_core v0.4.2
   Compiling autocfg v1.0.1
   Compiling autocfg v0.1.7
   Compiling crossbeam-utils v0.8.5
   Compiling lazy_static v1.4.0
   Compiling cfg-if v1.0.0
   Compiling winapi-x86_64-pc-windows-gnu v0.4.0
   Compiling crossbeam-epoch v0.9.5
   Compiling winapi v0.3.9
   Compiling libc v0.2.108
   Compiling scopeguard v1.1.0
   Compiling rayon-core v1.9.1
   Compiling memchr v2.4.1
   Compiling either v1.6.1
   Compiling regex-syntax v0.6.25
   Compiling bitflags v1.3.2
   Compiling mucow v0.1.0
   Compiling rand_core v0.3.1
   Compiling memoffset v0.6.4
   Compiling rayon v1.5.1
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling rand v0.6.5
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling num_cpus v1.13.0
   Compiling crossbeam-channel v0.5.1
   Compiling aho-corasick v0.7.18
   Compiling regex v1.5.4
   Compiling crossbeam-deque v0.8.1
   Compiling rand_jitter v0.1.4
   Compiling rand_os v0.1.3
   Compiling pleco v0.5.0
   Compiling stonefish_engine v0.1.0 (C:\msys64\home\Guenther Simon\stonefish_engine)
error: there is no argument named `cp`
  --> src\stonefish\node\info.rs:27:55
   |
27 |             Evaluation::Centipawns(cp) => format!("cp {cp}"),
   |                                                       ^^^^

error: could not compile `stonefish_engine` due to previous error

Guenther

TimJentzsch commented 2 years ago

Hey there!

This particular section uses a language feature that was introduced in Rust 1.58.

You should be able to fix this problem by upgrading your Rust toolchain, for example using rustup update.

Please let me know if you are running into any further issues!

rwbc commented 2 years ago

Thanks for the info Tim,

I am surprised how often they still introduce new features in Rust ;-)

As this was just released a week ago I guess it might be available as a package for msys2 in the next two weeks. (msys2 has its own toolchains and package manager and offers a bash shell in WIN)

https://packages.msys2.org/search?q=rust

TimJentzsch commented 2 years ago

As Rust is still a relatively "new" language, a couple of features are not stabilized yet. I tried changing the corresponding call to make it compile for you, but I'm also using the unstable feature str_split_whitespace_as_str which is not available on the stable toolchain yet. Is there a way for you to use nightly Rust?

rwbc commented 2 years ago

Don't worry (no need to change your sources). I will report back after I have installed the next official rust package. Using 'nightly' would probably require a parallel installation, which would defeat the whole purpose of using msys2.

Thanks again.