Git Product home page Git Product logo

Comments (15)

javier-cornejo avatar javier-cornejo commented on August 22, 2024 1

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

from npm-installer.

hdgarrood avatar hdgarrood commented on August 22, 2024 1

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

from npm-installer.

javier-cornejo avatar javier-cornejo commented on August 22, 2024

Screenshot from 2019-07-13 22-35-44

from npm-installer.

hdgarrood avatar hdgarrood commented on August 22, 2024

Thanks for the report. Do you have a minimal Dockerfile which can reproduce this issue?

from npm-installer.

javier-cornejo avatar javier-cornejo commented on August 22, 2024

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

from npm-installer.

marijnz0r avatar marijnz0r commented on August 22, 2024

I'm affected by this issue as well on:

  • Ubuntu 19.04
  • 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

from npm-installer.

hdgarrood avatar hdgarrood commented on August 22, 2024

@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

from npm-installer.

marijnz0r avatar marijnz0r commented on August 22, 2024

@hdgarrood thanks for the quick response, it seems it might have to do something with a correct version of libtinfo, check out this issue: purescript/spago#104
Do you have an idea how to fix this?

from npm-installer.

hdgarrood avatar hdgarrood commented on August 22, 2024

Yes, you need to install the ncurses/libtinfo library, and/or build from source so that GHC can select the appropriate version.

from npm-installer.

marijnz0r avatar marijnz0r commented on August 22, 2024

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?

from npm-installer.

marijnz0r avatar marijnz0r commented on August 22, 2024

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.

from npm-installer.

hdgarrood avatar hdgarrood commented on August 22, 2024

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.

from npm-installer.

hdgarrood avatar hdgarrood commented on August 22, 2024

The issues reported here are covered by #22 and #24, so I'm going to close this. Thanks for the report!

from npm-installer.

wclr avatar wclr commented on August 22, 2024

@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 ?

from npm-installer.

hdgarrood avatar hdgarrood commented on August 22, 2024

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.

from npm-installer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.