tmountain / uchess

♛♔ Play chess against UCI engines in your terminal.
MIT License
64 stars 7 forks source link

Doesn't run on windows powershell #1

Closed Bios-Marcel closed 3 years ago

Bios-Marcel commented 3 years ago

On startup of the windows release binary, i get the following:

> .\uchess_0.1.0_windows_x86_64.exe
panic: theme: no theme found                                                                                                                                                                                                                    

goroutine 1 [running]:
main.main()
    /Users/traviswhitton/Projects/uchess/cmd/uchess/main.go:25 +0x753

Trying to run via the source code on windows attempts to find stockfish at /usr/bin/stockfish, which is a linux path. Do i need to manually install stockfish and edit the path?

Either way, i assume something went wrong with pkger during built of your windows release executable.

tmountain commented 3 years ago

Confirmed. Looks like the bug is not limited to Windows. There's something wrong with the way I'm trying to embed the themes asset via pkger. Will investigate. Also, for Windows, you'll need to install Stockfish on your machine, generate a uchess config, and let it know where Stockfish is installed.

$ uchess -tmpl > uchess.json

Relevant config section.

    "uciEngines": [
        {
            "name": "stockfish",
            "engine": "C:\\Users\\yourusername\\Desktop\\win\\stockfish.exe",
            "hash": 128,
            "ponder": false,
            "ownBook": false,
            "multiPV": 4,
            "depth": 0,
            "searchMoves": "",
            "moveTime": 3000,
            "options": [
                {
                    "name": "skill level",
                    "value": "20"
                }
            ]
        }

I will cut a new release and report back when I figure out the pkger issue.

Bios-Marcel commented 3 years ago

pkger and packr have been a pain in the ass for me too. Look forward to go 1.16, it comes with a built-in embeding framework ;)

tmountain commented 3 years ago

I found the root cause, and it is resolved. There was a race condition related to the default config referencing data that should have existed in pkger prior to it being materialized. I have built a new release, and I have tested it on Windows. Please confirm that it works for you, and I will close this issue.

uchess v0.2.0

Thank you for the feedback, and yes, looking forward to 1.16 as well!

Bios-Marcel commented 3 years ago

Will check on monday, thanks.

tmountain commented 3 years ago

Can you confirm that the issue is resolved on your side?

Bios-Marcel commented 3 years ago

Ah sorry, forgot.

Doesn't work, but the problem changed:

> .\uchess_0.2.0_windows_x86_64.exe
panic: exec: "C:\\stockfish\\stockfish.exe": file does not exist

goroutine 1 [running]:
github.com/tmountain/uchess.InitEngines(0x40b444, 0x9, 0x40b444, 0x9, 0x40b444, 0x9, 0x5a2220, 0x1, 0x1, 0x418aff, ...)
    /Users/traviswhitton/Projects/uchess/engine.go:61 +0x26c
main.main()
    /Users/traviswhitton/Projects/uchess/cmd/uchess/main.go:38 +0x278

I manually need to install stockfish I assume?

Wouldn't it make sense to bundle stockfish, leaving the option of using a custom version via a cli parameter? Or are there any licensing issues?

Bios-Marcel commented 3 years ago

Either way, I've downloaded stockfish and put the executable on my path, which uchess doesn't find. I think uchess should check the PATH variable as well.

However, passing it via a parameter doesn't seem to be possible either. I don't think anybody installs stuff on C:/ directly 😬

tmountain commented 3 years ago

Hi,

I've incorporated your feedback into the most recent release (v0.2.1). The latest version will search for stockfish using the PATH variable, and it will also offer to download the Stockfish binary if it cannot be found. Can you try this version and see if it works for you? I have tested it on my Windows 10 machine and using Parallels, and it is working for me, but it would helpful if you can confirm. Thanks!

PS--I've also dropped the pkger dependency in favor of the native embed handling in Golang 1.16.

Bios-Marcel commented 3 years ago

Nice, works fine, thanks. Even though I am too stupid to move anything besides the pawns ^^