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

Pass cabal options without PATH override #438

Open
yaitskov opened this issue Jul 16, 2024 · 0 comments
Open

Pass cabal options without PATH override #438

yaitskov opened this issue Jul 16, 2024 · 0 comments

Comments

@yaitskov
Copy link

Consider situation cabal project expects a CPP macro to be defined in launch time.

foo :: Int
#ifdef DEF_FOO_BODY
foo = 3


#endif

It seems hie.yml cannot pass --ghc-options=-DDEF_FOO_BODY

cradle:
  cabal:
    - path: "src"
      component: "lib:mychild"
    - path: "exe/Main.hs"
      component: "mychild:exe:mychild"

My workaround is to generate cabal script

#!/usr/bin/bash

/nix/store/py73yq7j7k6qm889byni79vngbc5qyhb-cabal-install-3.10.3.0/bin/cabal --ghc-options="-DDEF_FOO_BODY=1" "$@"
export $PWD/bin:$PATH
code .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant