spago
spago copied to clipboard
Wrong binary installed on macOS (via `npm`)
I think that the latest release is installing the Linux binary on macOS, see:
$ uname -a
Darwin Ians-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64
$ npm install -g spago
// ...
$ spago test
zsh: exec format error: spago
$ file /usr/local/bin/spago
/usr/local/bin/spago: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=bfc088a128e5b509e6be0a8bcab708137f34a6ec, stripped
For comparison
$ file /usr/local/bin/purs
/usr/local/bin/purs: Mach-O 64-bit executable x86_64
Downloading the macOS binary from the releases page directly works fine.
Thanks for reporting @ianp! We use this little script to download/unpack the binary from the releases: https://github.com/purescript/spago/blob/72315e003857e2a6c6e5904716d440925990ec21/npm/install.js#L1-L9
As you can see in line 6 we read process.platform
and download the macOS binary if it's equal to darwin
, and fallback to the linux binary if not. I suspect this might have changed in recent versions of macOS and/or Node. What's the result of running this command?
node - <<< "console.log(process.platform)"
Figured it out! I have ignore-scripts=true
in my local NPM config so that wasn't getting run and I was just getting the included Linux binary.
I think that it may be worth updating the readme with a note about this.
The new Spago does not have binaries anymore, closing (it's all javascript)