Open Boarders opened 4 years ago
Let's not assume the user has nix
installed or wants it installed it for them. It adds to the user's machine an additional program which was not necessary to build pcg
.
stack
was our old solution to this issue, but they are no longer viable due to not supporting the newest version of the .cabal
file format.
I think a better solution is updating the makefile
to query for our ghc
and cabal
dependencies on the machine and install them when necessary. Related to #127.
I'm not suggesting here that the default way to build the project is via nix. If nix offers a painless approach to grabbing the correct version of ghc
and cabal
to quickly build the project then there is no harm in knowing and documenting that regardless of what ultimate solution is preferred for how to build the project.
You finally found a reason to get rid of Voldemort!!!
On Feb 27, 2020, at 10:48, recursion-ninja notifications@github.com wrote:
Let's not assume the user has nix installed or wants it installed it for them. It adds to the user's machine an additional program which was not necessary to build pcg.
stack was our old solution to this issue, but they are no longer viable due to not supporting the newest version of the .cabal file format.
I think a better solution is updating the makefile to query for our ghc and cabal dependencies on the machine and install them when necessary. Related to #127 https://github.com/amnh/PCG/issues/127.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/amnh/PCG/issues/162?email_source=notifications&email_token=ADG45MSY5QWDF6RSMWETDSTRE7OEVA5CNFSM4K45L7OKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENE2LAI#issuecomment-592029057, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADG45MX5X43X57KYTU7E7XLRE7OEVANCNFSM4K45L7OA.
I tried this out on a fresh machine without the correct version of GHC or cabal and the following seems to work so long as nix is installed:
nix-shell --packages --pure haskell.compiler.ghc883 haskell.packages.ghc883.cabal-install --run 'cabal update && cabal build'
Note: The use of --pure
is just to avoid getting any system versions that might already be installed.
Also worth noting that this will not result in anything being globally installed on the machine.
Very nice. Ready for me to try?
I think so, yes! [with the current exception of Catalina]
I think we should put this in the makefile
, both for convenience and a permanent reference.
In the near future, perhaps we can use the nix-shell
commands to address #127.
If we rework our make install/bench/test/profile
commands to use nix
, we might want to also rework the Travis CI script to use invoke commands from the makefile
rather than the hard coded set of commands and flags.
Catalina you mean?
Currently our project can be very painful to build on a fresh machine if it is not easy to grab the correct versions of GHC and cabal. Nix is a package manager for both mac and linux that should, in theory, make this a bit easier as it can grab the relevant version of the compiler for you. We should test whether this makes it easy to build on a fresh machine. The instructions to do so are:
First install nix: this can be done via:
curl https://nixos.org/nix/install | sh
though the website here also offers tarballs and a way to securely verify the installation.After that is installed (and perhaps after restarting the shell) one should then be able to run (within the pcg directory):
This is assuming the version of the compiler we wish to build with is
ghc-8.8.1
but can be changed as appropriate so long as the compiler is available from the nix package repository.