purescript / purescript/npm-installer

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

Open
#22 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10
Forks
15
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the installer’s prebuilt-binary verification that runs purs.bin --version and handles the reported ENOENT. Reproduce the failure on an affected system, check whether purs.bin exists, inspect its dynamic loader, and ensure a missing loader produces a specific message before falling back to building from source.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.