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

#778: ConfigFlags { configConfigurationsFlags } field should contain flags which are defined in .cabal file, but aren't specified in command line with -flags=... ----------------------------+----------------------------------------------- Reporter: nartamonov | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.3 Platform: | ----------------------------+----------------------------------------------- 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. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/778 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#778: ConfigFlags { configConfigurationsFlags } field should contain flags which are defined in .cabal file, but aren't specified in command line with -flags=... ----------------------------+----------------------------------------------- Reporter: nartamonov | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.3 Platform: | ----------------------------+----------------------------------------------- Comment(by nartamonov): Small snippet from Setup.hs which shows how I use ConfigFlags { configConfigurationsFlags }: {{{ customBuild :: PackageDescription -> LocalBuildInfo -> UserHooks -> BuildFlags -> IO () customBuild descr buildInfo hooks flags = {- ... skipped ... -} where debugFlag = lookup (FlagName "debug") $ configConfigurationsFlags $ configFlags buildInfo main = defaultMainWithHooks simpleUserHooks { hookedPrograms = [qmake, make], buildHook = customBuild } }}} -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/778#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#778: ConfigFlags { configConfigurationsFlags } field should contain flags which are defined in .cabal file, but aren't specified in command line with -flags=... ----------------------------+----------------------------------------------- Reporter: nartamonov | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.3 Platform: | ----------------------------+----------------------------------------------- Comment(by lemming): Would a solution as proposed in #836 help you? -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/778#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#778: ConfigFlags { configConfigurationsFlags } field should contain flags which are defined in .cabal file, but aren't specified in command line with -flags=... ----------------------------+----------------------------------------------- Reporter: nartamonov | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.12.3 Platform: | ----------------------------+----------------------------------------------- Comment(by elga): * [http://www.releve-identite-operateur.fr/rio-bouygues.html rio bouygues] -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/778#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage