Skip to content

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

Open
@hdgarrood

Description

@hdgarrood

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions