How to pass arguments to build tools like happy

235 views
Skip to first unread message

Pierre van de Laar

unread,
Dec 22, 2016, 3:04:14 AM12/22/16
to haskell-stack
Dear Stack users,

If you are using GHC, generate parsers using the -a -g -c options, and compile them using GHC with the -fglasgow-exts option.
I can specify the ghc options to stack using the ghc-options field in the .cabal file.

yet stack doesn't recognize happy-options:
Cabal file warning in C:\Example.cabal: Unknown fields: happy-options (line 27)
Fields allowed in this section:
    exposed-modules, reexported-modules, required-signatures,
    exposed-signatures, exposed, buildable, build-tools, build-depends,
    cpp-options, cc-options, ld-options, pkgconfig-depends, frameworks,
    c-sources, js-sources, default-language, other-languages,
    default-extensions, other-extensions, extensions, extra-libraries,
    extra-ghci-libraries, extra-lib-dirs, includes, install-includes,
    include-dirs, hs-source-dirs, other-modules, ghc-prof-options,
    ghcjs-prof-options, ghc-shared-options, ghcjs-shared-options,
    ghc-options, ghcjs-options, jhc-options, hugs-options,
    nhc98-options
 Yet, how can I specify the parameters for build tools, like happy, in stack?

Thanks in advance!

Pierre


Michael Snoyman

unread,
Dec 26, 2016, 5:26:21 AM12/26/16
to Pierre van de Laar, haskell-stack
I've never passed in parameters to happy, so I may be unaware of this functionality being available. But to my knowledge, there's no such feature in Stack right now. (Someone please correct me if I'm wrong.) The best way forward would probably be to open up a feature request on Github:


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to haskel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/e2079ead-7d9d-42e8-ba1a-e1dafa59f517%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pierre van de Laar

unread,
Jan 3, 2017, 3:07:10 AM1/3/17
to haskell-stack, mic...@snoyman.com

Damian Nadales

unread,
Jul 17, 2017, 8:13:16 AM7/17/17
to haskell-stack
Just for the record, cabal passes these flags to happy:
    https://github.com/haskell/cabal/blob/e28abb9ca321b74c82931d23d1e1cc75574ce4b9/Cabal/Distribution/Simple/PreProcess.hs

However, being able to specify custom flags should be possible.

On Tuesday, January 3, 2017 at 9:07:10 AM UTC+1, Pierre van de Laar wrote:
Reply all
Reply to author
Forward
0 new messages