justinwoo / spago2nix

Generate a derivation of (old) Spago dependencies, and use them to install them into the directory structure used by Spago.
MIT License
42 stars 22 forks source link

`spago test --no-install` in `checkPhase` fails #52

Open paulyoung opened 2 years ago

paulyoung commented 2 years ago

I'm running into the error described in the README despite using the --no-install flag. Is there something else I need to do?

spago: security: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

https://github.com/justinwoo/spago2nix#i-dont-know-how-to-compile-my-project-in-a-derivation

{
  packages.purescript = pkgs.stdenv.mkDerivation {
    name = "purescript-spago-build";
    buildInputs = [
      spagoPkgs.installSpagoStyle
      spagoPkgs.buildSpagoStyle
    ];
    nativeBuildInputs = [
      easy-ps.purs
      easy-ps.spago
      easy-ps.zephyr
    ];
    src = ./frontend;
    unpackPhase = ''
      cp $src/spago.dhall .
      cp $src/packages.dhall .
      install-spago-style
    '';
    buildPhase = ''
      cp -R $src/src .
      build-spago-style "./src/**/*.purs" --codegen corefn
      zephyr -f Main.main
    '';
    doCheck = true;
    checkPhase = ''
      HOME=$TMP
      cp -R $src/test .
      build-spago-style "./test/**/*.purs" --codegen js
      spago --global-cache skip test --no-install
    '';
    installPhase = ''
      mkdir $out
      mv dce-output $out/
      mv output $out/
    '';
  };
}
paulyoung commented 2 years ago

I'm apparently pulling in spago version 0.20.3 via easy-purescript-nix.

paulyoung commented 2 years ago

The changelog entry for https://github.com/purescript/spago/pull/866 says "Fix spago run and spago test to accept command line arguments correctly, by writing a JS file to run" but I'm not sure if that relates to the --no-install flag.

paulyoung commented 2 years ago

With 0.20.9 I get spago: security: createProcess: posix_spawnp: does not exist (No such file or directory)

szg251 commented 1 year ago

Putting this here for reference, if anyone else bumps into this later: https://github.com/purescript/spago/issues/888