haskell / haskell/cabal

Optionally exposed modules / APIs should be banned

未关闭
#778 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Cabal: other type: bug
主要语言
Haskell
星标
1.7k
派生
750
平均合并
4 天 3 小时
30 天内合并 PR
28

描述

(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?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。