Skip to content

Improve error message if the purs binary's dynamic loader does not exist #22

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

Open
hdgarrood opened this issue May 21, 2020 · 0 comments

Comments

@hdgarrood
Copy link
Collaborator

For systems which aren't based on glibc, such as Alpine, or for systems like Nix which put the glibc dynamic loader in a weird place, the installer fails with this rather unhelpful error:

✖ Verify the prebuilt binary works correctly
  /home/skykanin/.npm-global/lib/node_modules/purescript/purs.bin --version
  Error: spawn /home/skykanin/.npm-global/lib/node_modules/purescript/purs.bin ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)

This was observed in both #16 and #21. I would like to improve this error by catching ENOENT, checking that purs.bin does in fact exist (just in case), and if it does, checking whether its dynamic loader is a file which exists. If it doesn't, we could output a message along the lines of:

The prebuilt binary does not appear to be suitable for your system (specifically, the dynamic loader /lib64/ld-linux-x86-64.so.2 was not found).

and then fall back to building from source. We'll have to depend on an ELF parser to manage this but I think it's justifiable.

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

1 participant