haskell / haskell/cabal

ConfigFlags { configConfigurationsFlags } field should contain flags which are defined in .cabal file, but aren't specified in command line with -flags=...

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

描述

(Imported from [Trac #778](http://hackage.haskell.org/trac/hackage/ticket/778), reported by @nartamonov on 2010-12-17)

I have custom Flag declaration in .cabal file:

Flag debug


Description: Build with debug support
Default: True

and some conditionals (if flag(debug) ...) which depend on this flag. In custom Setup.hs I use data structure Distribution.Simple.Setup.`ConfigFlags?` and its field configConfigurationsFlags to get value of 'debug' flag. But it seems that field contains flag entry only when I explicitly mention flag during configuration phase in command line with '-fdebug' or '--flags=debug'.

I think it is wrong because even if I don't mention flag in command line he will be initialized to True and conditionals (in *.cabal) which depend on it will be evaluated according to this default value. It would be awesome if I could access flag with its implicitly assigned value via `ConfigFlags?` { configConfigurationsFlags }.

My custom Setup.hs machinery heavily depends on values of such flags, and it is inconvenient to explicitly define all of them via command line during configuration phase.

Thanks.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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