Sandbox Confusion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Sandbox Confusion

Britt Anderson
This works if one removes the -threaded option
e.g. cabal exec ghc site.hs

Is there a way to make cabal exec accept ghc options?

--Britt

> Message-ID:
> <CAKFCL4V0cntKL6dvXe0Yh2cGf6JwEeHauQk2HEv3Hctz26JNpw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> On Thu, Aug 14, 2014 at 8:13 PM, Britt Anderson <britt at uwaterloo.ca> wrote:
>
> > cabal exec hakyll-init my-site
> > and this works, and I
> > cd ./my-site
> > but the next step specified in the tutorial I can't figure out how to work.
> > It is:
> > ghc --make -threaded site.hs
> >
> > It fails because it cannot find the Hakyll module to import.
> >
> > I am hoping to learn what the proper command would be in a sandbox
> > environment, and
>
>
> You already used it once: put `cabal exec` in front. (Also, you no longer
> need `--make` in current versions of ghc.)
>
> --
> brandon s allbery kf8nh                               sine nomine associates
> allbery.b at gmail.com                                  ballbery at sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.haskell.org/pipermail/beginners/attachments/20140814/b8db72b9/attachment-0001.html>


Reply | Threaded
Open this post in threaded view
|

Sandbox Confusion

Karolis Velicka
Hi. What you can do is run

cabal exec bash

and then simply use `ghc -threaded site.hs` or any other command - the
shell you'd launch with `cabal exec bash` will have the libraries from
your sandbox in its environment.

Best wishes,
Karl (Karolis) Velicka


On 15 August 2014 13:06, Britt Anderson <britt at uwaterloo.ca> wrote:

> This works if one removes the -threaded option
> e.g. cabal exec ghc site.hs
>
> Is there a way to make cabal exec accept ghc options?
>
> --Britt
>
>> Message-ID:
>>       <CAKFCL4V0cntKL6dvXe0Yh2cGf6JwEeHauQk2HEv3Hctz26JNpw at mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>>
>> On Thu, Aug 14, 2014 at 8:13 PM, Britt Anderson <britt at uwaterloo.ca> wrote:
>>
>> > cabal exec hakyll-init my-site
>> > and this works, and I
>> > cd ./my-site
>> > but the next step specified in the tutorial I can't figure out how to work.
>> > It is:
>> > ghc --make -threaded site.hs
>> >
>> > It fails because it cannot find the Hakyll module to import.
>> >
>> > I am hoping to learn what the proper command would be in a sandbox
>> > environment, and
>>
>>
>> You already used it once: put `cabal exec` in front. (Also, you no longer
>> need `--make` in current versions of ghc.)
>>
>> --
>> brandon s allbery kf8nh                               sine nomine associates
>> allbery.b at gmail.com                                  ballbery at sinenomine.net
>> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: <http://www.haskell.org/pipermail/beginners/attachments/20140814/b8db72b9/attachment-0001.html>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners

Reply | Threaded
Open this post in threaded view
|

Sandbox Confusion

Bob Ippolito
On Fri, Aug 15, 2014 at 6:46 AM, Karolis Velicka <karolis.velicka at gmail.com>
wrote:

> Hi. What you can do is run
>
> cabal exec bash
>
>
$ cabal exec --help
Usage: cabal exec [FLAGS] COMMAND [-- [ARGS...]]

according to the Usage, you should probably do this instead:

$ cabal exec ghc -- -threaded site.hs

It's a common unix convention to have `--` separate flags from arguments,
for example:

$ echo '--not-a-flag' | grep --not-a-flag
grep: unrecognized option `--not-a-flag'

$ echo '--not-a-flag' | grep -- --not-a-flag
--not-a-flag


-bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140815/45864774/attachment.html>