passing flags to alex and happy via stack
Asked Answered
C

0

11

I am trying to move a project from cabal to stack. It was painless up until I tried to make alex use a custom wrapper. Now I'm stuck.

I used to use cabal build --alex-options=".." to pass them on, but that option is not there with stack (stack version 1.1.2 at least). Similarly, I used to pass debug flags to happy, but now it no longer seems possible. Is there some other way to achieve this and still use stack?

The point of moving this project is to help collaborators be able to reproduce my build effortlessly (it was already some work to convince them to use Haskell).

Chadd answered 30/5, 2016 at 6:12 Comment(4)
AFAIK there's currently no way to pass these flags with stack. These two issues are somewhat related – I suggest you join the discussion and pronounce your need! ;)Ekaterina
Another relevant issue: github.com/commercialhaskell/stack/issues/652Jobless
In the event that you only want to pass a debug flag every now and then, you can trick stack by: (1) building your project (2) running happy manually (stack exec happy -- ) with your desired options outputting to the same file as stack would (3) change something in a module imported in the grammar (4) stack build again. This will trigger recompilation, but not re-processing of the grammar (since stack will have observed no change in the grammar file).Chuchuah
Everything is terrible.Lidia

© 2022 - 2024 — McMap. All rights reserved.