Ticket #7 (closed enhancement: fixed)

Opened 3 years ago

Last modified 1 year ago

add --ghc-args and such to configure

Reported by: ijones Assigned to: ijones
Priority: high Milestone: Cabal-1.2
Component: Cabal library Version: 1.1.3
Severity: normal Keywords:
Cc: Difficulty: very easy (<1 hour)
GHC Version: 6.2.1 Platform: Linux

Description (Last modified by ijones)

this should be done w/ the Distribution.Program interface, and is closely related to 5 and 6.

Change History

10/30/05 20:32:43 changed by anonymous

  • milestone set to Cabal-1.2.

11/29/05 14:42:41 changed by anonymous

  • priority changed from normal to high.

12/11/05 11:27:46 changed by ijones

  • description changed.

08/23/07 04:53:06 changed by duncan

  • status changed from new to closed.
  • difficulty set to very easy (<1 hour).
  • ghcversion set to 6.2.1.
  • resolution set to fixed.
  • platform set to Linux.

Done.

runhaskell Setup configure --with-ghc=... --ghc-args=...

These flags apply for all programs that cabal knows about (which is also extensible via hooks).

08/23/07 05:08:27 changed by ross@soi.city.ac.uk

  • status changed from closed to reopened.
  • resolution deleted.

Done in the code, but not documented in the User's Guide.

A design issue: there is a difference in naming and semantics from --configure-option (and ghc-option elsewhere). The latter takes only one option, so multiple options must each be wrapped individually. That can be a bit more cumbersome, but it avoids issues with embedded spaces.

09/01/07 16:23:11 changed by duncan

  • status changed from reopened to closed.
  • resolution set to fixed.

Now documented.

Also, I've added a --prog-arg= flag that behaves like --configure-option=.

I've also made --prog-args= parse it's args more cleverly. Instead of using words which breaks on files with embedded spaces we now use a slightly more clever lexer that allows simple quoting with "" chars. eg:

splitArgs "--foo=\"C:\Program Files\Bar\" --baz"
= ["--foo=C:\Program Files\Bar", "--baz"]

so on the command line you'd use:

./setup configure --foo-args='--bar="some path with spaces"'

That is the " chars have to be passed to setup, so if necessary they have to be escaped in the shell invocation.

The alternative of course is to use

./setup configure --foo-arg=--bar="some path with spaces"

again, assuming your shell parses --foo-arg=--bar="some path with spaces" into a single argument --foo-arg=--bar=some path with spaces.

Oh the joys of shell quoting.