Brent, I've done this before a lot, it's a great workflow. Just stack
exec and the world works as you would hope. As an example I have
instructions for compiling GHC here,
http://neilmitchell.blogspot.co.uk/2016/03/compiling-ghc-on-windows.html
- only at the end is the fact I'm using a haskell package even
mentioned.

Thanks, Neil


On Mon, Feb 12, 2018 at 9:42 AM, Michael Snoyman
<michael.snoy...@gmail.com> wrote:
> IIUC, you're looking to define a `stack.yaml` file which will set up all of
> the packages and settings, and then have a script you run to tell Stack to
> build the appropriate packages. That sounds fine; I think the pieces you're
> missing are:
>
> * In order to say "I have no local packages," include the line `packages:
> []` in your `stack.yaml`
> * You can use the `flags` section in your `stack.yaml` to override default
> cabal flags, see
> https://docs.haskellstack.org/en/stable/yaml_configuration/#flags
>
> On Mon, Feb 12, 2018 at 6:14 AM, Brent Yorgey <byor...@gmail.com> wrote:
>>
>> Hi all,
>>
>> I have a specific goal and I'm hoping you can help me figure out the best
>> way to accomplish it using stack (or perhaps even using other tools if they
>> make more sense).  I am working on a LaTeX document which contains embedded
>> Haskell code for generating diagrams
>> (https://github.com/byorgey/series-formelles).  When the LaTeX file is
>> compiled, a certain executable (diagrams-builder-pgf) needs to be present,
>> which in turn uses the GHC API to compile and run the code embedded in the
>> LaTeX document. In order for this to work, various libraries (diagrams-lib,
>> diagrams-pgf, palette, etc...) need to be present in the GHC package
>> database; I also need a specific version of GHC.  Getting this environment
>> set up properly, with compatible versions of everything, can be a pain; I
>> would like to create a script that others can run in order to reproducibly
>> get a proper environment set up to be able to build the LaTeX document.
>>
>> Stack seems like the obvious choice but I have run into a few difficulties
>> trying to get it set up: first of all, as you can tell from my description
>> above, I do not actually have a Haskell package.  There is no Haskell
>> library or executable I am trying to build. But as far as I can tell, a
>> stack project is supposed to contain one or more Haskell packages.  I could
>> try to make a "fake" Haskell package whose dependencies describe the things
>> I want to end up being present in the package DB but I am not sure of the
>> best way to do this, and it seems rather kludgy.  Really what I want is just
>> a sandbox, but I can't really use a cabal sandbox because as far as I know
>> that will just use whatever GHC version someone has installed, and I need a
>> particular GHC version.  Secondly, in order to install the
>> diagrams-builder-pgf executable, I need to pass a certain flag to the
>> diagrams-builder package when it is built, but I'm not clear on exactly how
>> to do this using stack.
>>
>> So, what do you think?  Is there a good way to do this with stack?  Or
>> should I look at some other way to get this set up?  Thanks in advance for
>> any ideas or advice.  I'm happy to answer questions or provide further
>> information.
>>
>> -Brent
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "haskell-stack" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to haskell-stack+unsubscr...@googlegroups.com.
>> To post to this group, send email to haskell-stack@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/haskell-stack/559b2f4d-bfa4-4b4e-9750-32de4d9a4a7c%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "haskell-stack" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to haskell-stack+unsubscr...@googlegroups.com.
> To post to this group, send email to haskell-stack@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/haskell-stack/CAKA2Jg%2BGYmOyERo%3Dq_FqH7r_AzbfB7nMwt10xLt_e1a7kWdE6g%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to haskell-stack+unsubscr...@googlegroups.com.
To post to this group, send email to haskell-stack@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/haskell-stack/CAKcFpm%2BgB6zQk%2Brf0Q-bF3%3DWrrsPjjJtpVBiBm3XRNhwb7zW7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to