[Haskell-cafe] problems with "stack ghc"

Michael Snoyman michael at snoyman.com
Wed Jul 12 10:52:12 UTC 2017


I think you'll be happy about this PR:

https://github.com/commercialhaskell/stack/pull/3237

On Wed, Jul 12, 2017 at 10:24 AM, Dennis Raddle <dennis.raddle at gmail.com>
wrote:

> --package seems to work.
>
> But this brings up another question. This takes a long time to run for a
> change to a single file, because stack is preprocessing and building *all*
> my executables, then installing them all. In my situation this is a lot of
> wasted time for something that needs to be fast.
>
> It's not just "stack ghc." I tried to get "stack build" to build a
> specific executable. I tried something like "stack build cac:myExec" (my
> package name is "cac") but this builds all my executables every time. I
> haven't been able to find the right approach to this in the docs.
>
> So, aside from wondering why "stack ghc" builds all my executables, how do
> I use "stack build" to build just one executable?
>
> D
>
>
> On Tue, Jul 11, 2017 at 7:41 PM, Michael Snoyman <michael at snoyman.com>
> wrote:
>
>> No, the `ghc` command has no rebuild logic built in, since it doesn't
>> know which of your packages you're expecting to be available. You can pass
>> in the `--package` flag, however, to tell it which packages you're
>> expecting. I'm not sure if I've ever tested in the exact case you're
>> trying, so you may have to resort to `stack build` in the directory, but
>> `--package` is worth a shot.
>>
>> On Tue, Jul 11, 2017 at 11:29 PM, Dennis Raddle <dennis.raddle at gmail.com>
>> wrote:
>>
>>> I'm using Haskell stack in the normal way (i.e. "stack build", "stack
>>> exec") for most of my application. However, I also need to build files that
>>> aren't in the stack source tree.
>>>
>>> My stack source tree is at ~/stack/cac/src/
>>>
>>> Let's say I want to build the program /Users/Dennis/test.hs.
>>>
>>> So far I have been using
>>>
>>>    stack ghc --stack-yaml ~/stack/cac/stack.yaml -- --make
>>> /Users/Dennis/test.hs
>>>
>>> I am confused. I thought this was working until today. I made some
>>> modifications in various places, including to my cac.cabal (but NOT my
>>> stack.yaml) and I'm having a problem. The libraries that test.hs imports
>>> are not getting rebuilt when they change.
>>>
>>> Are they *supposed* to be rebuilt? Any ideas how to debug this?
>>>
>>> D
>>>
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> To (un)subscribe, modify options or view archives go to:
>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>>> Only members subscribed via the mailman list are allowed to post.
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170712/950e00a5/attachment.html>


More information about the Haskell-Cafe mailing list