Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for build-tools #1466

Closed
ghost opened this issue Sep 3, 2013 · 5 comments
Closed

Documentation for build-tools #1466

ghost opened this issue Sep 3, 2013 · 5 comments

Comments

@ghost
Copy link

ghost commented Sep 3, 2013

Is there documentation for the build-tools option of the cabal file? If so, where can I find it.

In particular I would like to know:
how to use build-tools, what programs (other than alex and happy) are legal arguments to the build-tools options, how and in what order the build-tools are run?
Some other questions I have are:
Do alex and happy (or any tools for that matter) need to be included in the build-depends argument list?
Do the AlexScannerFile.x and HappyParserFile.y need to be included somewhere in the cabal file?
Do the files generated by Alex and Happy -- the AlexScannerFile.hs and HappyParserFile.hs -- need to be in other-modules?

Thank you for your help!!

@23Skidoo
Copy link
Member

23Skidoo commented Sep 3, 2013

There is some documentation here, but it could definitely be improved.

how to use build-tools, what programs (other than alex and happy) are legal arguments to the build-tools options, how and in what order the build-tools are run?

The programs known to Cabal are listed here. Tools that generate .hs sources are run before ghc.

Do alex and happy (or any tools for that matter) need to be included in the build-depends argument list?

No.

Do the AlexScannerFile.x and HappyParserFile.y need to be included somewhere in the cabal file?

You only need to list AlexScannerFile and HappyParserFile in other-modules or exposed-modules.

@ttuegel ttuegel added this to the Cabal-1.24 milestone Apr 23, 2015
@23Skidoo 23Skidoo modified the milestones: Cabal 1.24, Cabal 1.26 Feb 21, 2016
@ezyang ezyang modified the milestone: Cabal 2.0 Sep 6, 2016
@gbaz
Copy link
Collaborator

gbaz commented Feb 5, 2018

@linearray
Copy link
Member

Docs now list acceptable values in great detail, so I'm quite sure this is fixed.

@andreasabel
Copy link
Member

andreasabel commented Nov 3, 2020

Is this issue resolved by the current docs? http://cabal.readthedocs.io/en/latest/developing-packages.html?highlight=build-tools#pkg-field-build-tool-depends

This link does not point to a description of build-tools.

Here is a short reference: https://cabal.readthedocs.io/en/latest/cabal-package.html#pkg-field-build-tool-depends
However, I do not see how this explains how build tools work. How does the mere mention of the executables needed for the build explain which Haskell files they create from which sources? Where do I specify that by great build tool buildit creates a Haskell file for a .blit file? (Like happy creates a Haskell file from a .y file.)

@fgaz
Copy link
Member

fgaz commented Nov 4, 2020

@andreasabel
The preprocessor section lists the extensions natively supported by Cabal.
Adding custom preprocessors is explained here, or can be done with the GHC -F flag.

Maybe we should cross-link those sections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants