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

nodePackages.elm-test: No such file or directory #45280

Closed
jasoncarr0 opened this issue Aug 17, 2018 · 11 comments
Closed

nodePackages.elm-test: No such file or directory #45280

jasoncarr0 opened this issue Aug 17, 2018 · 11 comments
Labels

Comments

@jasoncarr0
Copy link
Contributor

Issue description

The elm-test package in nodePackages

Steps to reproduce

Via nixpkgs:

$ nix run nixpkgs.elmPackages.elm nixpkgs.nodePackages.elm-test
$ elm-test init
$ elm-test
Success! Compiled 54 modules.                                       
Successfully generated /dev/null
Unhandled exception while running the tests: { Error: spawn /nix/store/rll733jmgykq2sxrjbjgsm8hy6wzpsv8-node-elm-test-0.18.12/lib/node_modules/elm-test/bin/elm-interface-to-json ENOENT
    at exports._errnoException (util.js:1020:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32)
    at onErrorNT (internal/child_process.js:376:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn /nix/store/rll733jmgykq2sxrjbjgsm8hy6wzpsv8-node-elm-test-0.18.12/lib/node_modules/elm-test/bin/elm-interface-to-json',
  path: '/nix/store/rll733jmgykq2sxrjbjgsm8hy6wzpsv8-node-elm-test-0.18.12/lib/node_modules/elm-test/bin/elm-interface-to-json',
  spawnargs: [ '--path', '/home/example/empty/tests' ] }

Similar results follow from npm install.

Technical details

The elm-interface-to-json binary installed via npm does not work with NixOS.
After installing via npm install, similar issues arise. The issue was fixed for me by deleting the elm-interface-to-json binary in node_modules/elm-test/bin, and instead linking the copy from the nix store (from elmPackages).

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.56, NixOS, 18.03.132915.d6c6c7fcec6 (Impala)`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.0.4`
 - channels(root): `"nixos-18.03.132915.d6c6c7fcec6"`
 - channels(jason): `"bleeding-edge, temp-pijul-0.10, unstable-18.09pre147850.2428f5dda13"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`

Proposed fix

Move elm-test into elmPackages, build it against existing elm-interface-to-json.

@jasoncarr0 jasoncarr0 changed the title nodePackagse.elm-test: No such file or directory nodePackages.elm-test: No such file or directory Aug 19, 2018
@mdevlamynck
Copy link
Contributor

mdevlamynck commented Oct 28, 2018

https://github.com/mdevlamynck/nixpkgs/tree/elm-test
This branch contains a package for elmi-to-json and a package for elm-test (for elm 0.19.0). These were generated with cabal2nix and node2nix.

Remaining problems:

  • elmi-to-json:
    • the dependency rainbow-0.30.0.2 fails to build
  • elm-test:
    • the dependency fsevents 1.1.2 fails to build (install script trying to request the url http://www.example.com/glob)
    • the path to the binary elmi-to-json needs to be patched in lib/runner.js.

@domenkozar
Copy link
Member

Try using https://github.com/adisbladis/pnpm2nix for nodejs

@stoeffel
Copy link

stoeffel commented Dec 3, 2018

happy to get rid of rainbow-0.30.0.2. Would totally appreciate a PR ❤️

@mdevlamynck
Copy link
Contributor

I can try to make a PR but I don't know much about haskell or its ecosystem, what would you replace rainbow with?

@stoeffel
Copy link

stoeffel commented Dec 4, 2018

@mdevlamynck I would just remove it completely. It's not really necessary. I might get to it next week, but happy to help you if you have questions. I'm @stoeffel on http://elmlang.slack.com.

@mdevlamynck
Copy link
Contributor

mdevlamynck commented Dec 4, 2018

elmi-to-json now builds!

@domenkozar Thanks for your suggestion! I managed to get node-elm-runner building with pnpm2nix. Do you have an example using it within nixpkgs? (nixos noob here).

The issue of patching the path to elmi-to-json remains though. Also I think I might need to also patch the path to elm in node-elm-compiler. Anyway, we're progressing!

@dmvianna
Copy link
Contributor

dmvianna commented Mar 17, 2019

Any update on this? As it stands, a fairly basic Elm library (its test runner) cannot be used in Nixos. I wasn't able to make it work on OSX either, but it seems that the problem is being pushed down to OSes to fix it. I wonder if anyone have made it run anywhere?

Result of nix-shell -p nodePackages.elm-test

> [email protected] install /nix/store/f37rg7c6zq4zdds87mcahpv7pfz0w88x-node-elm-test-0.18.12/lib/node_modules/elm-test
> node install.js

Error communicating with URL https://dl.bintray.com/elmlang/elm-test/0.18.12/linux-x64.tar.gz Error: getaddrinfo ENOTFOUND dl.bintray.com dl.bintray.com:443
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /build/.npm/_logs/2019-03-17T04_30_07_655Z-debug.log
builder for '/nix/store/kchksb44p66q56myw0zr0f3sijn55hwa-node-elm-test-0.18.12.drv' failed with exit code 1
error: build of '/nix/store/kchksb44p66q56myw0zr0f3sijn55hwa-node-elm-test-0.18.12.drv' failed

@domenkozar
Copy link
Member

domenkozar commented Mar 18, 2019

@svanderburg do you have an idea why binwrap-install is missing, given that elmi-to-json depends on binwrap pacakges and tries to execute binary from it?

> [email protected] install /nix/store/rwwndxadj3zmryyla7mafaypvy43kdzj-node-elm-test-0.19.0-rev5/lib/node_modules/elm-test/node_modules/elmi-to-json
> binwrap-install

sh: binwrap-install: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `binwrap-install`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /build/.npm/_logs/2019-03-18T03_33_36_174Z-debug.log
builder for '/nix/store/awg2k8pvr20dmzsrk1ps6p3sgbj49bwp-node-elm-test-0.19.0-rev5.drv' failed with exit code 1
error: build of '/nix/store/awg2k8pvr20dmzsrk1ps6p3sgbj49bwp-node-elm-test-0.19.0-rev5.drv' failed

@turboMaCk
Copy link
Member

turboMaCk commented May 14, 2019

This is what I do to fix it for now https://github.com/turboMaCk/nix-elm-tools/blob/master/patch-bin-wrap.nix

basically, I mock binwrap with noop script and put elmi-to-json to the expected location in derivation itself.

you can use my thing https://github.com/turboMaCk/nix-elm-tools just note that at this point elmi-to-json itself is downloaded as a binary (darwin or linux).

@domenkozar
Copy link
Member

This has been fixed by #63477

@turboMaCk
Copy link
Member

turboMaCk commented Jun 24, 2019

just a note that elm-test was moved so it's located in elmPackages.elm-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants