andyarvanitis / purescript-native

A native compiler backend for PureScript (via C++ or Golang)
http://purescript.org
Other
629 stars 40 forks source link

Nix build #51

Closed kayhide closed 4 years ago

kayhide commented 4 years ago

This PR supports nix build.

The build setting is based on haskell.nix. Before building, it is advised to configure cachix: https://app.cachix.org/cache/iohk

To build:

$ nix build -f . psgo.components.exes.psgo

and you will see the executable ready at result/bin/psgo.

To install the executable into your nix profile:

$ nix-env -f . -iA psgo.components.exes.psgo

Now psgo is available:

$ psgo --help
Usage: psgo OPTIONS COREFN-FILES
  PureScript to native (via go) compiler
...

This PR also updates purescript version to 0.13.6.

andyarvanitis commented 4 years ago

Thanks for the PR. I'll need to run tests on 0.13.6 before merging. While I don't mind moving forward (though it generally hasn't been necessary until a major release), is there a particular reason why you did so?

kayhide commented 4 years ago

@andyarvanitis Hi, thanks for taking care of my PR.

Yes, I first tried the purescript version as is, but it did not work because of the lack of proper tool dep. It should have had happy on package.yaml. This was fixed on this PR.

NickHu commented 4 years ago

Doesn't build anymore:

error: attribute 'nixpkgs-1903' missing, at /tmp/purescript-native/default.nix:3:16
(use '--show-trace' to show detailed location information)
andyarvanitis commented 4 years ago

I finally ran the ran the standard compiler tests and everything looks good. Thanks!

andyarvanitis commented 4 years ago

And sorry it took so long...

kayhide commented 3 years ago

No problem! And thanks for taking care of this!