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

Allow user configurable command line options for build tools #1223

Open
dagit opened this issue Feb 28, 2013 · 7 comments
Open

Allow user configurable command line options for build tools #1223

dagit opened this issue Feb 28, 2013 · 7 comments

Comments

@dagit
Copy link
Collaborator

dagit commented Feb 28, 2013

There is currently no mechanism to control how tools like happy are invoked by cabal. Other tools that would be nice to control over include (but not limited to), hsc2hs, c2hs, and alex.

A simple option would be to add a field happy-options: to the cabal file format. An even better solution would be for the mechanism to allow the options to be per module. An even better solution would make the addition of tools with options into a generic configurable option so that new build tools can be added without modifying cabal.

@elliottt
Copy link

This would be nice, and would give the package developer a bit of control back over how the tools get run.

@23Skidoo
Copy link
Member

23Skidoo commented Mar 3, 2013

An even better solution would be for the mechanism to allow the options to be per module.

Probably best solved via tool-specific pragmas.

@23Skidoo
Copy link
Member

With regard to this comment:

There is currently no mechanism to control how tools like happy are invoked by cabal.

This is not strictly true, you can set happy-options in ~/.cabal/config or use cabal configure --happy-options="...". But I agree that allowing happy-options in .cabal files would be nice.

@hvr
Copy link
Member

hvr commented Jun 16, 2015

I just noticed, one can workaround this also via a project-cabal.config file containing e.g.

-- workaround for https://github.com/haskell/cabal/issues/1223
program-default-options
  alex-options: --latin1

Not sure though if it's a good idea to include that file via extra-sources into the source-dist tarball, and whether it'll be honored then...

(It may actually be a good idea to reject package uploads to Hackage which contain a top-level cabal.config file...)

@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
@yav
Copy link

yav commented Jul 22, 2019

I just run into the same issue. This seems like a fairly obvious and trivial feature, and this ticket is over 5 years old. Are there any technical difficulties, or are we just lacking manpower?

@23Skidoo
Copy link
Member

Patches definitely welcome.

@yav
Copy link

yav commented Jul 22, 2019

I found that Alex has an "encoding" directive, so one can do:

%encoding "latin1"

instead of passing --latin1, which is a work around for this specific case.

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