[Hackage] #438: Cabal should warn or fail if user specifies a bad configuration flag

#438: Cabal should warn or fail if user specifies a bad configuration flag ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.10.1 Platform: | ----------------------------+----------------------------------------------- Let us take the example of Yi. Yi specifies a flag: {{{ flag ghcAPI Description: Enable linking with GHC API for advanced features. Default: False }}} The advanced features are nice indeed, and I wish to use them. So I configure thusly: {{{ gwern@craft:33763~/bin/yi>runhaskell Setup configure --user -fghc-api Configuring yi-0.5.3... }}} (Or perhaps I specify -fghcapi, or -fghc-API. There are a lot of quite reasonable permutations, and I suspect I have made every one of them over the past few months.) The point is, the flag is *wrong*. Completely wrong. If we turn on --verbose, we notice that {{{ Flags chosen: testing=True, hacking=False, cocoa=False, pango=False, gtk=False, vty=True, ghcapi=False }}} The user is not going to get what she requested. Worse, the user has no idea! Everything looks dandy! There is not the slightest indication that something bad has happened. Half an hour later when Yi has compiled and installed, any user trying to use the Shim.* modules in their yi.hs is in for an unpleasant surprise. So the basic point here is: if the user specifies a flag, and the flag doesn't match any flags in the cabal file, *something* is wrong. Either the cabal file is damaged in someway, or the user mistyped. I think an error would be perfectly reasonable here, in the same way that missing fields is a reasonable reason for erroring out; but at a minimum a warning is warranted. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/438 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#438: Cabal should warn or fail if user specifies a bad configuration flag ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.10.1 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Yes. More generally we should do this for cabal-install, though that means working out exactly which packages the -f flags apply to. Do all the -f flags apply to all packages (at least to those which have the flags)? or just the ones on the command line? -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/438#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#438: Cabal should warn or fail if user specifies a bad configuration flag ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: HEAD Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.10.1 | Platform: ----------------------------+----------------------------------------------- Changes (by duncan): * difficulty: normal => easy (<4 hours) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/438#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage