Closed javier-cornejo closed 4 years ago
Thanks for the report. Do you have a minimal Dockerfile which can reproduce this issue?
Sure, Fedora release 30 (Thirty) Docker version 18.09.7, build 2d0083d
FROM alpine:3.10.1
RUN apk add nodejs npm && \
npm install --global purescript
This one shows more errors at docker build time
FROM alpine:3.10.1
RUN apk add nodejs npm && \
npm install --global --ignore-scripts purescript && \
node /usr/lib/node_modules/purescript/node_modules/purescript-installer/index.js
I'm affected by this issue as well on:
Node 12.13.0
✔Check if a prebuilt 0.13.4 binary is provided for linux (906ms)
✔ Download the prebuilt PureScript binary (943ms)
✖ Verify the prebuilt binary works correctly
/home/marijn/.nvm/versions/node/v12.13.0/lib/node_modules/purescript/purs.bin --version
Error: Command failed: /home/marijn/.nvm/versions/node/v12.13.0/lib/node_modules/purescript/purs.bin --version
/home/marijn/.nvm/versions/node/v12.13.0/lib/node_modules/purescript/purs.bin: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
at ChildProcess.exithandler (child_process.js:295:12)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:430:11)
at Socket.emit (events.js:210:5)
at Pipe.<anonymous> (net.js:658:12)
▬ Save the downloaded binary to the npm cache directory
↓ Fallback: building from source
✖ Check if 'stack' command is available stack --allow-different-user --numeric-version Error: Command failed with exit code 2 (ENOENT): stack --allow-different-user --numeric-version spawn stack ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19) at onErrorNT (internal/child_process.js:456:16) at processTicksAndRejections (internal/process/task_queues.js:80:21) ▬ Download the PureScript 0.13.4 source ▬ Ensure the appropriate GHC is installed ▬ Build a binary from source ▬ Save the built binary to the npm cache directory
@marijnz0r that looks like a different issue to me, it seems you're missing the libtinfo
/ ncurses
library. See the note in https://github.com/purescript/purescript/blob/master/INSTALL.md#the-curses-library
@hdgarrood thanks for the quick response, it seems it might have to do something with a correct version of libtinfo, check out this issue: https://github.com/spacchetti/spago/issues/104 Do you have an idea how to fix this?
Yes, you need to install the ncurses/libtinfo library, and/or build from source so that GHC can select the appropriate version.
The weird thing is, I do have them installed:
locate libtinfo.so
/snap/core/7713/lib/x86_64-linux-gnu/libtinfo.so.5
/snap/core/7713/lib/x86_64-linux-gnu/libtinfo.so.5.9
/snap/core/7917/lib/x86_64-linux-gnu/libtinfo.so.5
/snap/core/7917/lib/x86_64-linux-gnu/libtinfo.so.5.9
/snap/core18/1192/lib/x86_64-linux-gnu/libtinfo.so.5
/snap/core18/1192/lib/x86_64-linux-gnu/libtinfo.so.5.9
/snap/core18/1223/lib/x86_64-linux-gnu/libtinfo.so.5
/snap/core18/1223/lib/x86_64-linux-gnu/libtinfo.so.5.9
/usr/lib/x86_64-linux-gnu/libtinfo.so
/usr/lib/x86_64-linux-gnu/libtinfo.so.6
/usr/lib/x86_64-linux-gnu/libtinfo.so.6.1
How do I point the purescript install script to the correct libtinfo.so.5?
This apparently fixed it for me:
sudo ln -s /snap/core/7917/lib/x86_64-linux-gnu/libtinfo.so.5 /usr/lib/x86_64-linux-gnu/libtinfo.so.5
I hope it helps someone.
You can use LD_LIBRARY_PATH
, or preferably put the library in one of the directories listed in /etc/ld.so.conf
. See http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
I've dug into this a bit and I think it might be to do with alpine being based on musl rather than glibc or some other difference in how the system is set up. After running those commands, we get an error along the lines of spawn /purs ENOENT
, which would suggest that the problem is that the file /purs
does not exist. In fact the file does exist, which leads me to believe that we are in a similar situation to this person: https://stackoverflow.com/questions/5234088/execve-file-not-found-when-stracing-the-very-same-file, and the ENOENT really means that the dynamic loader for the binary doesn't exist. Indeed, ldd /purs
prints /lib64/ld-linux-x86-64.so.2
as the first line of the output, but no such file that exists in the container. I think you may need to build the compiler from source.
The issues reported here are covered by #22 and #24, so I'm going to close this. Thanks for the report!
@hdgarrood (Form the discussion) it is not clear what to do if one wants to install purs on alpine and encounters the error?
Should this be added to https://github.com/purescript/purescript/blob/master/INSTALL.md ?
You’ll need to build the compiler yourself from source on alpine, as all of the prebuilt binaries rely on glibc. We do have instructions there for building from source already, but I don’t think we have the bandwidth to maintain instructions for alpine specifically.
Trying to run npm i -g purescript
On alpine:3.10.1 in a docker container. node v10.16.0 npm v6.9.0
716 verbose stack Error: purescript@0.13.2 postinstall: (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
716 verbose stack at EventEmitter.emit (events.js:198:13)
716 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
716 verbose stack at ChildProcess.emit (events.js:198:13)
716 verbose stack at maybeClose (internal/child_process.js:982:16)
716 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
install-purescript --purs-ver=0.13.2
716 verbose stack Exit status 1 716 verbose stack at EventEmitter.Also attaching a log file: 2019-07-14T03_13_09_728Z-debug.log