haskell / haskell/cabal

Optionally exposed modules / APIs should be banned

Ouverte
#778 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Cabal: other type: bug
Langage dominant
Haskell
Étoiles
1.7k
Forks
750
Merge moyen
4 j 3 h
PR mergées (30 j)
28

Description

(Imported from [Trac #788](http://hackage.haskell.org/trac/hackage/ticket/788), reported by @dcoutts on 2011-01-11)

It is a deliberate decision that packages cannot depend on package + flag combinations, only on packages. The point is that flags are not supposed to change the API of a package.

This needs to be enforced.

Consider a real example (from Chart package: [http://hackage.haskell.org/packages/archive/Chart/0.14/Chart.cabal](http://hackage.haskell.org/packages/archive/Chart/0.14/Chart.cabal))

  if flag(gtk)

build-depends: gtk >= 0.9.11
exposed-modules: Graphics.Rendering.Chart.Gtk
The criterion package depends on Chart and imports Graphics.Rendering.Chart.Gtk meaning that it breaks if you build Chart with the gtk flag turned off.

The solution is that Chart should be prevented from conditionally exposing modules. We should add a QA check that looks for exposed modules that are conditional on a flag. It is annoying but somewhat less bad for modules to change between platforms.

Should it be a hard failure or just a warning?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.