Skip to content

Pass cabal options without PATH override #438

@yaitskov

Description

@yaitskov

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 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions