jordanbray / chess

A rust library to manage chess move generation
https://jordanbray.github.io/chess/
MIT License
231 stars 54 forks source link

Misguided! "Build as dependency stalls" - Build time confusion #40

Closed WalterSmuts closed 3 years ago

WalterSmuts commented 3 years ago

EDIT: This is all wrong :/. Take a look at the last comment.

Hi, I'm trying to use your library but it seems to stall whenever I attempt to compile:

wssmts@laptop:~/Programs/chess-ai > cargo build
   Compiling chess v3.1.1 (https://github.com/jordanbray/chess.git#a09032e3)
    Building [===================================================>     ] 35/38: chess(build)

It just get's stuck there... When I run strace on it it seems to be sitting in some sort of deadlock:

wssmts@laptop:~/Programs/chess-ai > strace cargo build
<SNIP>
ioctl(2, TIOCGWINSZ, {ws_row=57, ws_col=212, ws_xpixel=1908, ws_ypixel=1026}) = 0
ioctl(2, TIOCGWINSZ, {ws_row=57, ws_col=212, ws_xpixel=1908, ws_ypixel=1026}) = 0
futex(0x5636fae9da98, FUTEX_WAIT_PRIVATE, 0, {tv_sec=0, tv_nsec=499991284}) = -1 ETIMEDOUT (Connection timed out)
futex(0x5636fae9da20, FUTEX_WAKE_PRIVATE, 1) = 0
ioctl(2, TIOCGWINSZ, {ws_row=57, ws_col=212, ws_xpixel=1908, ws_ypixel=1026}) = 0
ioctl(2, TIOCGWINSZ, {ws_row=57, ws_col=212, ws_xpixel=1908, ws_ypixel=1026}) = 0
futex(0x5636fae9da98, FUTEX_WAIT_PRIVATE, 0, {tv_sec=0, tv_nsec=499998831}) = -1 ETIMEDOUT (Connection timed out)
futex(0x5636fae9da20, FUTEX_WAKE_PRIVATE, 1) = 0
ioctl(2, TIOCGWINSZ, {ws_row=57, ws_col=212, ws_xpixel=1908, ws_ypixel=1026}) = 0
ioctl(2, TIOCGWINSZ, {ws_row=57, ws_col=212, ws_xpixel=1908, ws_ypixel=1026}) = 0
... <CONTINUES FOREVER>

I've tried a bunch of different versions, including pointing directly to your repo, and found that I can compile 0.3.4 but 0.4.0 introduces the stalling behavior for me. I've also tried compiling with the nightly compiler and the stable compiler, both exibit the same behavior.

The strange thing is that I tried cloning your repo and building it standalone, and this works:

wssmts@laptop:~/Programs/chess > cargo build
   Compiling arrayvec v0.5.2
   Compiling nodrop v0.1.14
   Compiling chess v3.1.1 (/home/ANT.AMAZON.COM/wssmts/Programs/chess)
warning: `#[inline]` is ignored on function prototypes
  --> src/movegen/piece_type.rs:17:5
   |
17 |     #[inline(always)]
   |     ^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_attributes)]` on by default

    Finished dev [optimized + debuginfo] target(s) in 7.56s

Any ideas? (The cargo verbose flag isn't very useful, just spits out the same info)

Environment details:

wssmts@laptop:~ > rustc -V
rustc 1.41.0 (5e1a79984 2020-01-27)
wssmts@laptop:~ > rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/ANT.AMAZON.COM/wssmts/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.38.0-x86_64-unknown-linux-gnu
1.41.0-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain
--------------------------------------

aarch64-unknown-linux-musl
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

active toolchain
----------------

1.41.0-x86_64-unknown-linux-gnu (default)
rustc 1.41.0 (5e1a79984 2020-01-27)
WalterSmuts commented 3 years ago

Well I'll be damned... I am completely wrong. This was just the generation of the lookup table. Takes a while, couple of minutes on my laptop. Why didn't it build the table when I compiled it standalone? (or did it?)

May be worth it to add that in your documentation?

jordanbray commented 3 years ago

This only really happens in debug mode. In release mode it happens quite a bit faster.

Adding a doc item may not be the worst idea

On Sun, Nov 22, 2020, 3:42 AM Walter Smuts notifications@github.com wrote:

Well I'll be damned... I am completely wrong. This was just the generation of the lookup table. Takes a while, couple of minutes on my laptop. Why didn't it build the table when I compiled it standalone? (or did it?)

May be worth it to add that in your documentation?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jordanbray/chess/issues/40#issuecomment-731716373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJ5PIBM6ACCT4PX65DDLTSRDFITANCNFSM4T6KSO6Q .