Closed jasoncarr0 closed 5 years ago
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:
lib/runner.js
.Try using https://github.com/adisbladis/pnpm2nix for nodejs
happy to get rid of rainbow-0.30.0.2. Would totally appreciate a PR ❤️
I can try to make a PR but I don't know much about haskell or its ecosystem, what would you replace rainbow with?
@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.
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!
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
> elm-test@0.18.12 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! elm-test@0.18.12 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the elm-test@0.18.12 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
@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?
> elmi-to-json@0.19.1 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! elmi-to-json@0.19.1 install: `binwrap-install`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the elmi-to-json@0.19.1 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
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).
This has been fixed by https://github.com/NixOS/nixpkgs/pull/63477
just a note that elm-test
was moved so it's located in elmPackages.elm-test
Issue description
The elm-test package in nodePackages
Steps to reproduce
Via nixpkgs:
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.Proposed fix
Move elm-test into elmPackages, build it against existing elm-interface-to-json.