Open jrp2014 opened 4 years ago
If I remember correctly it does not matter if you put the executable name before or after the --
, since the --
just stops cabal's flag parser. For example you could also do cabal <cabal args> exec ghc SomeFile.hs -- <ghc args>
(don't actually do this).
The second one may require a custom setup, like cabal-testsuite does. Or you could use a test argument.
By the way another way of getting ghc to pick up the package, instead of using cabal exec, could be to generate an environment file, with some variation of either cabal somecommand --write-ghc-environment-files
or cabal install --lib --env
Thanks for this. I'll have a further play,and look up ghc environment files. It would certainly make things faster to avoid the call to cabal
just to launch ghx
any pointers / references welcome.
Could we turn this discussion and experimentation into documentation improvement? @jrp2014, what do you think?
By the way the syntax is the same for cabal run
(i think there's a similar ticket about it too..) so the docs could be unified.
That'd be great, if we have a valid answer.
Thanks for this. I'll have a further play,and look up ghc environment files. It would certainly make things faster to avoid the call to
cabal
just to launchghx
any pointers / references welcome.
@jrp2014: any news? anything we can help with?
Didn't realise the ball was in my court. I thought that whoever owns the documentation might refine it.
Huh, if we own it, we'd love to sell it, even for 1$. :) But I didn't intend to trick you into taking ownership. I just thought you are going to try out some hypotheses and then, once we have something that works, we (meaning @fgaz and you:) can together think how to describe it better. I'm afraid we don't have the bandwidth to investigate the problem, document it and only then ask you to verify if that works for you. Your toil is very much needed to move this ticket along at all.
This is probably just a documentation issue, but I am struggling to understand what the difference is between these (particularly the first two) cases.
I have a couple of cases, with which I am wrestling. The following is aa fragment from a test harness that runs a ghc plugin over some test cases by compiling them:
--
order,-package
parameter, etc)?cabal test -w <path to ghc>
. How can I pick up the<path to ghc>
within this test harness (rather than using justghc
at line 79)?Thanks!