<div dir="ltr">See also <a href="https://github.com/edsko/ghc-dump-tree/blob/master/buildall.sh">https://github.com/edsko/ghc-dump-tree/blob/master/buildall.sh</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 13 March 2017 at 10:34, Alan & Kim Zimmerman <span dir="ltr"><<a href="mailto:alan.zimm@gmail.com" target="_blank">alan.zimm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Once you have installed the various GHC compilers from HVR's PPA, you can do<br><br></div>cabal configure --with-compiler=ghc-7.10.3<br><br></div>etc<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Alan<br></font></span></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 13 March 2017 at 10:28, Ertugrul Söylemez <span dir="ltr"><<a href="mailto:esz@posteo.de" target="_blank">esz@posteo.de</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><span>> Someone asked to add support in my lib for older version of GHC.<br>
> I know that there are GHC-version specific pragmas to activate the<br>
> code on specific version.<br>
><br>
> I'm not quite sure how to setup the environment to use several GHCs.<br>
> How do you do that kind of thing?<br>
<br>
</span>You can do it quite easily with Nix (which you can use alongside your<br>
normal package manager without interference, if you're not on NixOS).<br>
Type in your package's root directory:<br>
<br>
    cabal2nix --shell > shell.nix<br>
<br>
Then you can build your package with various compiler versions:<br>
<br>
    nix-build shell.nix --argstr compiler ghc803<br>
    nix-build shell.nix --argstr compiler ghc7103<br>
    nix-build shell.nix --argstr compiler ghcjs<br>
<br>
If a build is successful, you will get a symlink called 'result', which<br>
points to an installed version if your package including documentation.<br>
Once you're done testing, just delete that link.<br>
<br></div></div><span class="">______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/haskell-caf<wbr>e</a><br>
Only members subscribed via the mailman list are allowed to post.<br></span></blockquote></div><br></div>
</blockquote></div><br></div>