makingthematrix / gailibrary

A very cheerful library for Artificial Intelligence in games
MIT License
7 stars 0 forks source link

Build environment #7

Open makingthematrix opened 6 years ago

makingthematrix commented 6 years ago

Until now every time I started to work with a new environment, I ignored this part. I learned only a few most important command: some kind of compile and test mostly, nad thought it was sufficient. Well, it was, but it also meant that as the project became larger, the more I had to do by hand. It was tedious, consumed time, and eventually I started ignoring these tasks. And as a result the project was getting more and more messy.

Let's try not to repeat the error. I still don't like Docker and I'm not going to use it here, but it would be nice to learn cargo and probably to install cargo-make and learn that to. Let's start handling all these pesky little tasks properly from the very beginning:

makingthematrix commented 6 years ago

rustfmt for syntax checks: http://fredrik.anderzon.se/2017/01/31/rust-code-style-and-rustfmt-2/

makingthematrix commented 6 years ago

Clippy for various additional lint checks: https://github.com/rust-lang-nursery/rust-clippy Works only with the nightly build (?). Maybe I could use it as a subcommand for cargo.

makingthematrix commented 6 years ago

https://github.com/rust-lang/cargo/wiki/Third-party-cargo-subcommands

makingthematrix commented 6 years ago

https://medium.com/@sagiegurari/automating-your-rust-workflows-with-cargo-make-part-1-of-5-introduction-and-basics-b19ced7e7057

makingthematrix commented 6 years ago

Remember to add /usr/local/lib to your LD_LIBRARY_PATH (or include it in your /etc/ld.so.conf so ldconfig searches it when run) in order to prevent:

~/.cargo/bin/clippy-driver: error while loading shared libraries: librustc_driver-2afd8b7b2eb0a674.so: cannot open shared object file: No such file or directory

Found here: https://github.com/rust-lang/rust/issues/24677

If it still does not work, just reinstall clippy:

cargo +nightly install clippy -f

And if that doesn't work (there were some problems with it recently, check https://github.com/rust-lang-nursery/rust-clippy/issues/2704 and https://github.com/rust-lang-nursery/rust-clippy/issues/2706) you can try this:

cargo update
cargo install clippy --git https://github.com/rust-lang-nursery/rust-clippy.git