Pass extra parameters of 'configure' to user hooks #809

Closed
bos opened this Issue May 24, 2012 · 1 comment

Projects

None yet

4 participants

@bos
Contributor
bos commented May 24, 2012

(Imported from Trac #819, reported by guest on 2011-03-22)

Non-standard options to 'configure' are not supported by Cabal; to accept new options requires writing a custom version of Cabal's 'defaultMain'. It would be useful to provide some support for extending the command-line parser, or at least passing unrecognized arguments to user hooks.

To motivate this feature, here's my use case. During the build phase, my package builds an executable, then uses the executable to build some data files. The executable and data files are installed together. If the executable needs extra arguments (e.g., search paths) to run, they can be supplied as command-line parameters to 'configure'. Supporting these extra parameters required some changes to Cabal.

I did it by copying 'defaultMainWithHooks' and some 200-odd lines of non-exported functions from Distribution.Simple into my package's Setup.hs so that I could override 'configureCommand'. This gave me access to the command-line parser. Relatively little code was actually changed, so hopefully this feature would fit nicely into the current codebase.

@ttuegel ttuegel added this to the _|_ milestone Apr 23, 2015
@BardurArantsson
Collaborator

Lodged in 2011. No feedback. Close.

@23Skidoo 23Skidoo closed this Jun 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment