[Hackage] #495: feature request: top-level if statements

#495: feature request: top-level if statements ----------------------------+----------------------------------------------- Reporter: awick | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.1 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: 6.10.1 Platform: | ----------------------------+----------------------------------------------- It would be really, really handy for us to be able to use top-level if constructs, such as: {{{ if os(linux) executable run-tests main-is: ... ghc-options: ... if os(foo) executable program main-is: ... ghc-options: ... }}} (Specifically, we need it in cases like this, where tests run on a different OS than the code will be run on.) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/495 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#495: feature request: top-level if statements ----------------------------+----------------------------------------------- Reporter: awick | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.1 Severity: normal | Resolution: Keywords: | Difficulty: unknown Ghcversion: 6.10.1 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Is it not enough to do: {{{ executable run-tests if !os(linux) buildable: False main-is: ... ghc-options: ... executable program if !os(foo) buildable: False main-is: ... ghc-options: ... }}} -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/495#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#495: feature request: top-level if statements ----------------------------+----------------------------------------------- Reporter: awick | Owner: Type: enhancement | Status: closed Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.1 Severity: normal | Resolution: worksforme Keywords: | Difficulty: unknown Ghcversion: 6.10.1 | Platform: ----------------------------+----------------------------------------------- Changes (by awick): * status: new => closed * resolution: => worksforme Comment: Yeah, someone pointed this out to me shortly after I posted this, and I hadn't gotten a chance to remove it. Sorry about that. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/495#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#495: feature request: top-level if statements ----------------------------+----------------------------------------------- Reporter: awick | Owner: Type: enhancement | Status: closed Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.1 Severity: normal | Resolution: worksforme Keywords: | Difficulty: unknown Ghcversion: 6.10.1 | Platform: ----------------------------+----------------------------------------------- Comment (by duncan): Replying to [comment:2 awick]:
Yeah, someone pointed this out to me shortly after I posted this, and I hadn't gotten a chance to remove it.
Ok, great.
Sorry about that.
No problem. Sadly It's not exactly an obvious feature. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/495#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#495: feature request: top-level if statements ----------------------------+----------------------------------------------- Reporter: awick | Owner: Type: enhancement | Status: closed Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.1 Severity: normal | Resolution: worksforme Keywords: | Difficulty: unknown Ghcversion: 6.10.1 | Platform: ----------------------------+----------------------------------------------- Comment (by awick): Actually, the only thing that's a minor issue is that flags don't seem to work properly this way. For example: {{{ executable foo build-depends: base, other-library if !flag(Foo) buildable: False }}} When I run cabal-install, it seems to require 'other-library' to be around even if Foo is not set. Moving the dependency: {{{ executable foo build-depends: base if !flag(Foo) buildable: False build-depends: other-library }}} doesn't seem to help. On the other hand, if you use "os(foo)", it works as I'd expect (other-library isn't required). -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/495#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage