Pycckue-Bnepeg / samp-cef

Client and server plugins for SA:MP to embed CEF.
GNU General Public License v3.0
100 stars 46 forks source link

Client Build problem #43

Closed sl1ms closed 1 year ago

sl1ms commented 1 year ago
Compiling detour v0.8.0 (https://github.com/darfink/detour-rs?rev=3b6f17a#3b6f17a8) error[E0059]: type parameter to bare Fn trait must be a tuple --> C:\Users\Станислав.cargo\git\checkouts\detour-rs-497fa4e2739f3073\3b6f17a\src\detours\statik.rs:106:8 106 D: Fn<T::Arguments, Output = T::Output> + Send + 'static, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait Tuple is not implemented for <T as Function>::Arguments

note: required by a bound in Fn help: consider further restricting the associated type | 106 | D: Fn<T::Arguments, Output = T::Output> + Send + 'static, ::Arguments: Tuple | ~~~~~~~

error[E0059]: type parameter to bare Fn trait must be a tuple --> C:\Users\Станислав.cargo\git\checkouts\detour-rs-497fa4e2739f3073\3b6f17a\src\detours\statik.rs:157:8 157 C: Fn<T::Arguments, Output = T::Output> + Send + 'static, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait Tuple is not implemented for <T as Function>::Arguments

note: required by a bound in Fn help: consider further restricting the associated type | 157 | C: Fn<T::Arguments, Output = T::Output> + Send + 'static, ::Arguments: Tuple | ~~~~~~~

For more information about this error, try rustc --explain E0059. error: could not compile detour due to 2 previous errors warning: build failed, waiting for other jobs to finish...

TemaSM commented 1 year ago

For those who also facing same problem:

1) Install the Rust version of November 05, 2022: rustup toolchain install nightly-2022-11-06-i686 2) Run the build: cargo +nightly-2022-11-06-i686 build --release Finished

Why did this work? On November 6, Rust's contributors made commit to the master branch, that affects how the compiler handles syntax: https://github.com/rust-lang/rust/commit/7eef946fc0e0eff40e588eab77b09b287accbec3 This commit went to toolchain-version nightly-2022-11-07-i686, which means that since November 6 this samp-cef stopped building with versions of Rust newer than 2022-11-06. After installing the correct version (command above), we switched to the version of Rust the day before this commit and safely compiled what we needed without any changes to the code.

Why did this happen? Because the sources of the detours library (which is a dependency) uses outdated syntax, so that the Rust compiler showed us an error during compile. Related: https://github.com/darfink/detour-rs/issues/39

GeneralZero commented 1 year ago

Just an update to this rustup will automatically get the correct architecture you need. So you can install the nightly version like this. rustup toolchain install nightly-2022-11-06

Specifically specifying the architecture broke another part of my code. But will build with cargo +nightly-2022-11-06 build