brianch / offline-chess-puzzles

Tool to view and solve puzzles from the lichess puzzle database
MIT License
115 stars 16 forks source link

Can't compile under linux #7

Closed emdio closed 2 years ago

emdio commented 2 years ago

After running "build cargo" I get a lot of errors. Just a sample:

22  | use crate::Device;
    |
22  | use crate::gles::Device;
    |
      and 1 other candidate
help: if you import `Device`, refer to it directly
    |
106 -         let devices = mtl::Device::all();
106 +         let devices = Device::all();
    |

error[E0283]: type annotations needed
   --> /home/emilio/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.12.5/src/metal/mod.rs:590:5
    |
586 | #[derive(Debug, Default)]
    |                 ------- in this derive macro expansion
...
590 |     samplers: Vec<SamplerPtr>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
    |
    = note: cannot satisfy `_: std::default::Default`
    = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0283, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0283`.

The rust version I'm using is "cargo 1.64.0-nightly (a5e08c470 2022-06-23)"

I'm using an Ubuntu 20.04.4 LTS.

brianch commented 2 years ago

Hello, can you post the full log? (you can put it in a "code" block here)

I'm using Rust stable, but I just tested and it seems to compile with nightly as well.

You could try to run cargo clean, cargo update and then cargo run again.

emdio commented 2 years ago

My bad. I had tweaked a file to try to compile the project, then updated my rust version, and forgot to "untweak".

On the other hand, it takes ages to compile, and I finally get a 2GB folder, whilst the releases you provide are under 10MB.

brianch commented 2 years ago

Rust does have long compilation times and the size of the folder is also normal since it contains a ton of build files (that will make the compilation go much faster if you compile again).

But if you just wanna use the software, you can delete everything but the executable file, you should also use the --release flag in cargo build (or cargo run) to get a much smaller file (it's around 20mb now) compared to a regular debug build.

The executable will be generated in "target/debug" or "target/release" depending on how you compile it, you can for example move it to the main directory of the project and delete the "target" directory).