nim-lang / choosenim

Official tool for easily installing and managing multiple versions of the Nim programming language.
BSD 3-Clause "New" or "Revised" License
36 stars 8 forks source link

Installation on Windows via GitHub action fails #52

Closed h3rald closed 3 weeks ago

h3rald commented 3 weeks ago

This used to work until last week... but now installing Nim on Windows (using GitHub actions) via choosenim fails:

2024-10-27T11:03:52.9527486Z ##[group]Run iffy/install-nim@v4.5.0
2024-10-27T11:03:52.9527978Z with:
2024-10-27T11:03:52.9528241Z   version: stable
2024-10-27T11:03:52.9528529Z env:
2024-10-27T11:03:52.9528789Z   CHOOSENIM_CHOOSE_VERSION: stable
2024-10-27T11:03:52.9529171Z   CHOOSENIM_NO_ANALYTICS: 1
2024-10-27T11:03:52.9529507Z   MSYSTEM: MINGW64
2024-10-27T11:03:52.9529779Z ##[endgroup]
2024-10-27T11:03:52.9797562Z ##[group]Run export SHELL=/bin/bash
2024-10-27T11:03:52.9797906Z export SHELL=/bin/bash
2024-10-27T11:03:52.9798362Z 'D:\a\_actions\iffy\install-nim\v4.5.0/install-nim.sh' 'stable'
2024-10-27T11:03:52.9811566Z shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
2024-10-27T11:03:52.9812079Z env:
2024-10-27T11:03:52.9812311Z   CHOOSENIM_CHOOSE_VERSION: stable
2024-10-27T11:03:52.9812623Z   CHOOSENIM_NO_ANALYTICS: 1
2024-10-27T11:03:52.9812890Z   MSYSTEM: MINGW64
2024-10-27T11:03:52.9813115Z ##[endgroup]
2024-10-27T11:03:53.7130224Z Install type: choosenim
2024-10-27T11:03:53.7130849Z        param: stable
2024-10-27T11:03:53.7188676Z Installing via choosenim for: stable
2024-10-27T11:03:53.8296172Z Found version 
2024-10-27T11:03:54.9059805Z choosenim-init: Downloading choosenim-0.8.9_windows_amd64.zip
2024-10-27T11:03:55.7524090Z main: line 79: /tmp/choosenim-0.8.9_windows_amd64.zip: cannot execute binary file: Exec format error
2024-10-27T11:03:55.7604769Z ##[error]Process completed with exit code 126.

See:

ringabout commented 3 weeks ago

Because in https://github.com/nim-lang/choosenim/pull/41, init.sh provides a zip file instead of an exe file to ship some necessaries DLLs, bat files etc.

Either https://github.com/iffy/install-nim/blob/019401647969089934e8ad6b31b4915839cf282a/install-nim.sh#L383 need unzip the zip file or use a custom init.sh

h3rald commented 3 weeks ago

In my opinion, the default init.sh should be updated to handle this specific case.

Until recently, you could just execute init.sh and it would work, but now it doesn't (on Windows):

curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
choosenim-init: Downloading choosenim-0.8.9_windows_amd64.zip
init.sh: line 79: /tmp/choosenim-0.8.9_windows_amd64.zip: cannot execute binary file: Exec format error

In other words, the default init.sh can't be used on Windows anymore.

ringabout commented 3 weeks ago

Make sense. I have reverted https://github.com/nim-lang/choosenim/pull/41. It should work now.

h3rald commented 3 weeks ago

Perfect, thanks!