Skip to content

Avoid using enable-overloading flag #124

Closed
@hamishmack

Description

@hamishmack

Automatic flags are not automatic in stack. So we have to manually specify them for each gi-* package. I think it might be possible to work around this by eliminating the enable-overloading cabal flag.

Haskell gi-*.cabal files contain:

if flag(enable-overloading)
     cpp-options: -DENABLE_OVERLOADING
     build-depends: haskell-gi-overloading == 1.0.*
else
     build-depends: haskell-gi-overloading == 0.0

We could change this to just:

build-depends: haskell-gi-overloading < 1.1

and replace ENABLE_OVERLOADING with haskell-gi-overloading_MIN_VERSION(1,0)

Instead of -f-enable-overloading we would need to use --constraint=haskell-gi-overloading==0.0.

In stack.yaml just having

extra-deps:
- haskell-gi-overloading-0.0

Would be enough to switch off overloading.

Another option might be to keep the enable-overloading flag but only on one package (perhaps haskell-gi). So haskell-gi.cabal would have the automatic flag and:

if flag(enable-overloading)
     cpp-options: -DENABLE_OVERLOADING
     build-depends: haskell-gi-overloading == 1.0.*
else
     build-depends: haskell-gi-overloading == 0.0

While all the gi-*.cabal files would have:

build-depends: haskell-gi-overloading < 1.1

and use haskell-gi-overloading_MIN_VERSION(1,0). The stack.yaml would be:

extra-deps:
- haskell-gi-overloading-0.0

flags:
  haskell-gi:
    enable-overloading: false

This is not quite as nice.

CC @mgsloan

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