Re: a cabal/database lib experience

Paul Moore wrote:
On 12/12/06, Ketil Malde
wrote: I'm possibly using cabal in a simplistic way, but I generally do either
./Setup.lhs configure -p ./Setup.lhs build ./Setup.lhs install
[...]
This is a lot of typing, and at least once I wrote a Makefile to automate it (oh, the irony of it!) Anyway, it would be nice if a 'cabal' command automated the whole sequence in one go, at least as an option.
I come from a Python background, and Python's distutils (which feels very like cabal - or should that be the other way round?) tends to have later commands include earlier ones. So,
setup.py install
automatically does "build" (there is no explicit configure step).
Sounds entirely reasonable to me. Though configure takes a bunch of arguments; so if configure is run automatically it'll always be with the default settings. Maybe that's ok. Simon

Hi
have later commands include earlier ones. So,
setup.py install
automatically does "build" (there is no explicit configure step).
Sounds entirely reasonable to me. Though configure takes a bunch of arguments; so if configure is run automatically it'll always be with the default settings. Maybe that's ok.
I would love this. I have a batch file on my computer called cabal-ghc, which does a configure, then a build, then an install. I've never felt the need to pass flags to configure, and as it happens, I wouldn't have a clue what flags to pass in anyway. This reduces the number of cabal steps to install a library, less is clearly better! I also have cabal-hugs which installs the library under hugs, and cabal-all, which configure/build/install's the library under hugs and ghc. Those 6 commands are really annoying, this way i can do cabal-all and go away and come back later. Thanks Neil

[narrowed to libraries list]
Sounds entirely reasonable to me. Though configure takes a bunch of arguments; so if configure is run automatically it'll always be with the default settings. Maybe that's ok.
even with default settings it might help many, though there are users with special needs, and it would be nice to be able to break off the process after seeing the configure output (a simple confirmation [y/n]). it seems that neither build nor install take all that many arguments, so any combined command could pass everything to the configure phase (or each phase could simply leave unknown arguments alone, to be picked up by the next phase, or by an error messager if there is no next phase). also, could the usage info (runhaskell Setup --help) please be amended? something like the two extra lines on usage cycle and home page below. claus ------------------------------------------------------------------------------ $ runhaskell.exe Setup.lhs --help Usage: Setup.lhs [GLOBAL FLAGS] or: Setup.lhs COMMAND [FLAGS] Global flags: -h, -? --help Show this help text +Typical usage cycle: 1. configure 2. build 3. install + Commands: configure Prepare to build the package. build Make this package ready for installation. clean Clean up after a build. install Copy the files into the install locations. Run register. copy Copy the files into the install locations. sdist Generate a source distribution file (.tar.gz or .zip). test Run the test suite, if any (configure with UserHooks). haddock Generate Haddock HTML code from Exposed-Modules. pfe Generate Programatica Project. register Register this package with the compiler. unregister Unregister this package with the compiler. For more information about a command, try 'Setup.lhs COMMAND --help'. + +This Setup feature has been prepared using the Haskell Cabal infrastructure. +See http://haskell.org/cabal/ for more information. ------------------------------------------------------------------------------

Commands: configure Prepare to build the package. build Make this package ready for installation. clean Clean up after a build. install Copy the files into the install locations. Run register. copy Copy the files into the install locations. sdist Generate a source distribution file (.tar.gz or .zip). test Run the test suite, if any (configure with UserHooks). haddock Generate Haddock HTML code from Exposed-Modules. pfe Generate Programatica Project. register Register this package with the compiler. unregister Unregister this package with the compiler.
oops, forgot to mention these: 1. there are some suspicious omissions in that list of commands. quoting Paul Moore again:
If I need to rebuild to do so (grumble) then how do I uninstall the current version of takusen (it's not in "Add/Remove programs" and "runhaskell Setup.hs" doesn't seem to offer an uninstall option...
it is perhaps safer not to offer mis-configurable automated remove code, but at the very least I would hope to see the following two additional commands: list List all installed packages uninstall Provide uninstall information the former ought to list known Haskell implementations and their package databases, the latter ought to output status information about the (current) package (has it been registered anywhere? if yes, point to the unregister command first. have files been copied anywhere? if yes, explain which directories can simply and safely be removed). 2. runhaskell Setup unregister --help outputs usage info for register? claus

Claus Reinke wrote:
Commands: configure Prepare to build the package. build Make this package ready for installation. clean Clean up after a build. install Copy the files into the install locations. Run register. copy Copy the files into the install locations. sdist Generate a source distribution file (.tar.gz or .zip). test Run the test suite, if any (configure with UserHooks). haddock Generate Haddock HTML code from Exposed-Modules. pfe Generate Programatica Project. register Register this package with the compiler. unregister Unregister this package with the compiler.
oops, forgot to mention these:
1. there are some suspicious omissions in that list of commands. quoting Paul Moore again:
If I need to rebuild to do so (grumble) then how do I uninstall the current version of takusen (it's not in "Add/Remove programs" and "runhaskell Setup.hs" doesn't seem to offer an uninstall option...
it is perhaps safer not to offer mis-configurable automated remove code, but at the very least I would hope to see the following two additional commands:
list List all installed packages uninstall Provide uninstall information
the former ought to list known Haskell implementations and their package databases, the latter ought to output status information about the (current) package (has it been registered anywhere? if yes, point to the unregister command first. have files been copied anywhere? if yes, explain which directories can simply and safely be removed).
2. runhaskell Setup unregister --help outputs usage info for register?
Thanks for all the suggestions in this thread. I've created three tickets: http://hackage.haskell.org/trac/hackage/ticket/104 http://hackage.haskell.org/trac/hackage/ticket/105 http://hackage.haskell.org/trac/hackage/ticket/106 and fixed the easy bug (no. 2 above). Maybe we'll get a chance to hack on some of these during Hac, but there's an awful lot of tickets there... Cheers, Simon
participants (3)
-
Claus Reinke
-
Neil Mitchell
-
Simon Marlow