Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't install purescript #3544

Closed
sagax opened this issue Feb 27, 2019 · 14 comments
Closed

can't install purescript #3544

sagax opened this issue Feb 27, 2019 · 14 comments

Comments

@sagax
Copy link

sagax commented Feb 27, 2019

command

npm install -g purescript

simple log https://termbin.com/yene
complete log https://termbin.com/kzs7

  • linux kernel 4.15.13-1-default
  • node v8.12.0
  • npm 6.4.1
@justinwoo
Copy link
Contributor

This should be reported to https://github.com/purescript-contrib/node-purescript/

@shinnn
Copy link

shinnn commented Feb 28, 2019

@justinwoo No.

@hdgarrood hdgarrood reopened this Feb 28, 2019
@justinwoo
Copy link
Contributor

The binary I download from the release works via three ways:

  • I am able to download the binary from the archive and run it
[bash:~/Downloads] > l purs
-rwxr-xr-x 1 justin justin 43M Feb 24 23:46 purs
[bash:~/Downloads] > ./purs
Usage: purs COMMAND
  The PureScript compiler and tools
# ...
> command -v purs
./node_modules/.bin/purs
> purs --version
0.12.3

@hdgarrood
Copy link
Contributor

From https://github.com/purescript-contrib/node-purescript/issues/65:

purescript/purescript#3544 (comment) is a wrong direction. You ran into two problems both of which are not directly related to this repository.

  1. The prebuilt binary downloaded from https://github.com/purescript/purescript/releases/tag/v0.12.3 is not working.
  1. stack setup command fails when using PureScript's stack.yaml

@shinnn I've just checked on my own linux system and the v0.12.3 binary is working normally, so I don't think 1) is correct. I wonder if the download might have gone wrong somehow, or are you perhaps on a different architecture (i.e. 32-bit vs 64-bit)? @sagax can you try downloading the binary manually from that url and executing it? Also, can you paste the output of uname -a?

The stack setup failure happened while configuring GHC so I think it is highly unlikely that it has anything to do with our stack.yaml file. I suspect that is to do with your system. Unfortunately the output from GHC's configure script seems to have been suppressed, so you might want to try running it yourself?

@shinnn
Copy link

shinnn commented Feb 28, 2019

Please, check the log posted by the issue author before participating in the discussion.

/home/sagax_nb/local/bin/purs -> /home/sagax_nb/local/lib/node_modules/purescript/purs.bin

> purescript@0.12.3 postinstall /home/sagax_nb/local/lib/node_modules/purescript
> install-purescript --purs-ver=0.12.3 .

[ SUCCESS ] Check if a prebuilt 0.12.3 binary is provided for Linux (5s)
[ SUCCESS ] Download the prebuilt PureScript binary (5s)
[ FAILURE ] Verify the prebuilt binary works correctly (628ms)
Error: Command failed: /home/sagax_nb/local/lib/node_modules/purescript/purs.bin --version
/home/sagax_nb/local/lib/node_modules/purescript/purs.bin: /home/sagax_nb/local/lib/node_modules/purescript/purs.bin: cannot execute binary file
    at makeError (~/local/lib/node_modules/purescript/node_modules/execa/index.js:172:9)
    at Promise.all.then.arr (~/local/lib/node_modules/purescript/node_modules/execa/index.js:277:16)
    at <anonymous>

↓ Fallback: building from source

[ SUCCESS ] Check if 'stack' command is available
[ SUCCESS ] Download the PureScript 0.12.3 source (5s)
[ RUNNING ] command: stack setup
  Preparing to install GHC to an isolated location.
  This will not interfere with any system-level installation.
  Preparing to download ghc-8.4.3 ...
  Already downloaded.
  Unpacking GHC into /home/sagax_nb/.stack/programs/i386-linux/ghc-8.4.3.temp/ ...
  Configuring GHC ...
  Received ExitFailure 77 when running
  Raw command: /home/sagax_nb/.stack/programs/i386-linux/ghc-8.4.3.temp/ghc-8.4.3/configure --prefix=/home/sagax_nb/.stack/programs/i386-linux/ghc-8.4.3/
  Run from: /home/sagax_nb/.stack/programs/i386-linux/ghc-8.4.3.temp/ghc-8.4.3/
[ FAILURE ] Ensure the appropriate GHC is installed (3m)
Error: Command failed: stack --allow-different-user setup
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Preparing to download ghc-8.4.3 ...
Already downloaded.
Unpacking GHC into /home/sagax_nb/.stack/programs/i386-linux/ghc-8.4.3.temp/ ...
Configuring GHC ...
Received ExitFailure 77 when running
Raw command: /home/sagax_nb/.stack/programs/i386-linux/ghc-8.4.3.temp/ghc-8.4.3/configure --prefix=/home/sagax_nb/.stack/programs/i386-linux/ghc-8.4.3/
Run from: /home/sagax_nb/.stack/programs/i386-linux/ghc-8.4.3.temp/ghc-8.4.3/
    at makeError (~/local/lib/node_modules/purescript/node_modules/execa/index.js:172:9)
    at Promise.all.then.arr (~/local/lib/node_modules/purescript/node_modules/execa/index.js:277:16)
    at <anonymous>

@hdgarrood
Copy link
Contributor

hdgarrood commented Feb 28, 2019

@shinnn I did check the log. Notice that the error is "cannot execute binary file", which is why I suggested checking the architecture. See https://superuser.com/questions/435988/how-can-i-resolve-the-error-cannot-execute-binary-file. Does the node purescript package check that system architecture matches the binary?

@hdgarrood
Copy link
Contributor

@shinnn also, it's not really fair of you to assume that @justinwoo didn't check the log either. Either way the fact that it works on both of our systems is useful context. Clearly the binary is not totally broken, and so more investigation is needed to work out what's actually gone wrong.

@shinnn
Copy link

shinnn commented Feb 28, 2019

Does the node purescript package check that system architecture matches the binary?

If INSTALL.md clearly states the required system architecture, of course it will. If there is no mention about it in the documentation, users and integrated tools generally don't assume the binary works only on 64-bit systems.

@hdgarrood
Copy link
Contributor

hdgarrood commented Feb 28, 2019

The compiler should work on all the architectures that GHC supports. However, any given compiled binary will usually only work on one architecture. I think it's pretty rare for a single binary to run on more than one architecture in general.

In the case of our binaries, there are some pretty big clues in the file names: "linux64", "win64". Should I take that as a "no", the node purescript package doesn't check that the system architecture matches the architecture the binary is expecting? If so, I think it should.

@hdgarrood
Copy link
Contributor

Or at least, 32-bit binaries can often run on 64-bit systems, but not vice versa.

@shinnn
Copy link

shinnn commented Feb 28, 2019

there are some pretty big clues in the file names: "linux64", "win64".

If PureScript is a closed-source personal hobby, it' ok. But PureScript is a language, where this kind of implicitness is not allowed, I think.

Anyway, thanks for taking your time to approve this is not actually a bug of the npm package but more like room for UX improvement of it and a documentation issue of this repository.

@hdgarrood
Copy link
Contributor

I’m going to close this as it seems like this is not a compiler issue.

@shinnn
Copy link

shinnn commented Apr 13, 2019

Though this is not a compiler issue in a sense, again, it's a documentation issue of this repository.

@hdgarrood
Copy link
Contributor

Oh yes of course, thanks. I’ll update INSTALL.md later today.

hdgarrood added a commit that referenced this issue Apr 14, 2019
hdgarrood added a commit that referenced this issue Apr 14, 2019
- Clarify architecture targeted by prebuilt binaries, refs #3544
- Separate operating system requirements from prebuilt binaries section
- Explain how to install an official binary bundle
- Clarify difference between official binary bundles and other compiler
  distributions
- Remove outdated reference to "other utilities" included in an official
  binary bundle (now it's just `purs`)
- Use proper link text for stack install documentation link
- Remove outdated sentence about `stack setup`, since stack now installs
  the appropriate GHC for you automatically by default.
hdgarrood added a commit that referenced this issue May 8, 2019
- Clarify architecture targeted by prebuilt binaries, refs #3544
- Separate operating system requirements from prebuilt binaries section
- Explain how to install an official binary bundle
- Clarify difference between official binary bundles and other compiler
  distributions
- Remove outdated reference to "other utilities" included in an official
  binary bundle (now it's just `purs`)
- Use proper link text for stack install documentation link
- Remove outdated sentence about `stack setup`, since stack now installs
  the appropriate GHC for you automatically by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants