Enhancement: Default cabal to `-p` profiling enabled

I love GHC's profiling support, and like to use it to analyze the performance of my Haskell applications. However, profiling an application is difficult when it depends on any third-party libraries, as cabal doesn't include profiling information by default. Fortunately, cabal can reinstall a library with profiling support, with: cabal install --reinstall -p <library> Unfortunately, cabal is a bit of a simpleton, so this will fail unless that libraries dependencies are also installed with profiling enabled: cabal install --reinstall -p <libraryX> <libraryY> <libraryZ> ... For example, a user who wants to profile his die-rolling program must run: $ sudo apt-get install haskell-platform haskell-platform-doc haskell-platform-prof $ sudo cabal install --reinstall -p mwc-random rvar random-fu random-source mersenne-random-pure64 stateref flexible-defaults th-extras MonadPrompt math-functions erf vector-th-unbox monad-loops random-shuffle MonadRandom And that long list of packages must be slowly grown one at a time, starting from random-source, based on many attempts at running cabal install --reinstall -p ..., waiting several minutes for compilation to partially complete, and scrolling back up through the logs to track down which dependencies also neglected to compile with profiling enabled. It can take a while to get a list of this long, full dependency chain. It would be much easier if cabal simply enabled `-p` by default, so we didn't have to think about it. What do you think? -- Cheers, Andrew Pennebaker www.yellosoft.us

On Wed, Jul 23, 2014 at 4:18 PM, Andrew Pennebaker
It can take a while to get a list of this long, full dependency chain. It would be much easier if cabal simply enabled `-p` by default, so we didn't have to think about it.
What do you think?
I'm all for it, I always have to remember to go set profiling true in new cabal installs. If I forget, I just wipe out everything and start again from scratch. Compile time is 2x, which is crummy, but cabal is for developers, and developers should be profiling, right?

Cabal is not necessarily for developers: For many users it is the way to obtain a recent version of programs like pandoc. Those don't really need profiling libs enabled. If you are a developer, I recommend setting `library-profiling: True` in ~/.cabal/config once and forever, wiping ~/.ghc and reinstalling everything. That said, I agree that the current way to deal with missing profiling/shared/whatever libs is a total pain. A great solution would be if Cabal could simply install development libraries of the existing libraries recursively when a package demands them, just like it installs dependencies recursively in the normal way. On 24/07/14 01:39, Evan Laforge wrote:
On Wed, Jul 23, 2014 at 4:18 PM, Andrew Pennebaker
wrote: It can take a while to get a list of this long, full dependency chain. It would be much easier if cabal simply enabled `-p` by default, so we didn't have to think about it.
What do you think?
I'm all for it, I always have to remember to go set profiling true in new cabal installs. If I forget, I just wipe out everything and start again from scratch.
Compile time is 2x, which is crummy, but cabal is for developers, and developers should be profiling, right? _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Thanks for the .cabal/config tip! I'll also enable library-coverage as well
:)
On Wed, Jul 23, 2014 at 6:48 PM, Niklas Hambüchen
Cabal is not necessarily for developers: For many users it is the way to obtain a recent version of programs like pandoc. Those don't really need profiling libs enabled.
If you are a developer, I recommend setting `library-profiling: True` in ~/.cabal/config once and forever, wiping ~/.ghc and reinstalling everything.
That said, I agree that the current way to deal with missing profiling/shared/whatever libs is a total pain.
A great solution would be if Cabal could simply install development libraries of the existing libraries recursively when a package demands them, just like it installs dependencies recursively in the normal way.
On 24/07/14 01:39, Evan Laforge wrote:
On Wed, Jul 23, 2014 at 4:18 PM, Andrew Pennebaker
wrote: It can take a while to get a list of this long, full dependency chain. It would be much easier if cabal simply enabled `-p` by default, so we didn't have to think about it.
What do you think?
I'm all for it, I always have to remember to go set profiling true in new cabal installs. If I forget, I just wipe out everything and start again from scratch.
Compile time is 2x, which is crummy, but cabal is for developers, and developers should be profiling, right? _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- Cheers, Andrew Pennebaker www.yellosoft.us

It will be less painful to enable profiling by default when someone finishes the parallel build support for profiling "ways". That would mean that we can build the vanilla and profiling version of a library at the same time, saving quite a bit of time.

Am 24.07.2014 01:18, schrieb Andrew Pennebaker:
Fortunately, cabal can reinstall a library with profiling support, with:
cabal install --reinstall -p <library>
Unfortunately, cabal is a bit of a simpleton, so this will fail unless that libraries dependencies are also installed with profiling enabled:
cabal install --reinstall -p <libraryX> <libraryY> <libraryZ> ...
You may obtain a list of dependent packages with ghc-pkg-dep from http://hackage.haskell.org/package/cabal-sort

I'd like to add that if you install vanilla cabal from the tarball, the
installation process already installs several libraries that need to be
reinstalled later with profiling enabled, even if you enable the
configuration flag. For this I found convenient to start the cabal
installation as
EXTRA_CONFIGURE_OPTS="--enable-library-profiling" ./bootstrap.sh
Petr
Dne 24. 7. 2014 10:30 "Henning Thielemann"
Am 24.07.2014 01:18, schrieb Andrew Pennebaker:
Fortunately, cabal can reinstall a library with profiling support, with:
cabal install --reinstall -p <library>
Unfortunately, cabal is a bit of a simpleton, so this will fail unless that libraries dependencies are also installed with profiling enabled:
cabal install --reinstall -p <libraryX> <libraryY> <libraryZ> ...
You may obtain a list of dependent packages with ghc-pkg-dep from http://hackage.haskell.org/package/cabal-sort
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Hi Andrew,
I'm actually writing a tool to automate the workflow when coding on
multiple modules, and dealing with a shared sandbox.
I think that would be the perfect fit for an option like this (and thanks
to your email, I'll be sure it's easy to enable... or maybe even make it
the default... but ... developers often want fast compilation too!), I
don't really see that enabled by default on cabal for the same reason
others mentioned.
Cheers
On 24 July 2014 00:18, Andrew Pennebaker
I love GHC's profiling support, and like to use it to analyze the performance of my Haskell applications. However, profiling an application is difficult when it depends on any third-party libraries, as cabal doesn't include profiling information by default.
Fortunately, cabal can reinstall a library with profiling support, with:
cabal install --reinstall -p <library>
Unfortunately, cabal is a bit of a simpleton, so this will fail unless that libraries dependencies are also installed with profiling enabled:
cabal install --reinstall -p <libraryX> <libraryY> <libraryZ> ...
For example, a user who wants to profile his die-rolling program must run:
$ sudo apt-get install haskell-platform haskell-platform-doc haskell-platform-prof $ sudo cabal install --reinstall -p mwc-random rvar random-fu random-source mersenne-random-pure64 stateref flexible-defaults th-extras MonadPrompt math-functions erf vector-th-unbox monad-loops random-shuffle MonadRandom
And that long list of packages must be slowly grown one at a time, starting from random-source, based on many attempts at running cabal install --reinstall -p ..., waiting several minutes for compilation to partially complete, and scrolling back up through the logs to track down which dependencies also neglected to compile with profiling enabled.
It can take a while to get a list of this long, full dependency chain. It would be much easier if cabal simply enabled `-p` by default, so we didn't have to think about it.
What do you think?
-- Cheers,
Andrew Pennebaker www.yellosoft.us
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- *A\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard

What if -p continued to default to false, but when -p was specified, cabal
was smart enough to automatically recompile all dependencies with -p,
rather than complaining about them lacking profiling?
On Thu, Jul 24, 2014 at 12:51 PM, Alois Cochard
Hi Andrew,
I'm actually writing a tool to automate the workflow when coding on multiple modules, and dealing with a shared sandbox. I think that would be the perfect fit for an option like this (and thanks to your email, I'll be sure it's easy to enable... or maybe even make it the default... but ... developers often want fast compilation too!), I don't really see that enabled by default on cabal for the same reason others mentioned.
Cheers
On 24 July 2014 00:18, Andrew Pennebaker
wrote: I love GHC's profiling support, and like to use it to analyze the performance of my Haskell applications. However, profiling an application is difficult when it depends on any third-party libraries, as cabal doesn't include profiling information by default.
Fortunately, cabal can reinstall a library with profiling support, with:
cabal install --reinstall -p <library>
Unfortunately, cabal is a bit of a simpleton, so this will fail unless that libraries dependencies are also installed with profiling enabled:
cabal install --reinstall -p <libraryX> <libraryY> <libraryZ> ...
For example, a user who wants to profile his die-rolling program must run:
$ sudo apt-get install haskell-platform haskell-platform-doc haskell-platform-prof $ sudo cabal install --reinstall -p mwc-random rvar random-fu random-source mersenne-random-pure64 stateref flexible-defaults th-extras MonadPrompt math-functions erf vector-th-unbox monad-loops random-shuffle MonadRandom
And that long list of packages must be slowly grown one at a time, starting from random-source, based on many attempts at running cabal install --reinstall -p ..., waiting several minutes for compilation to partially complete, and scrolling back up through the logs to track down which dependencies also neglected to compile with profiling enabled.
It can take a while to get a list of this long, full dependency chain. It would be much easier if cabal simply enabled `-p` by default, so we didn't have to think about it.
What do you think?
-- Cheers,
Andrew Pennebaker www.yellosoft.us
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- *A\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard
-- Cheers, Andrew Pennebaker www.yellosoft.us

For what it's worth, this is my preference by a significant margin. I
recently stopped always turning on profiling builds because I was
getting tired of doubling the length of building everything,
especially when sandboxes are involved. I'd much rather cabal just
install profiling builds as necessary.
On Thu, Jul 24, 2014 at 2:30 PM, Andrew Pennebaker
What if -p continued to default to false, but when -p was specified, cabal was smart enough to automatically recompile all dependencies with -p, rather than complaining about them lacking profiling?
On Thu, Jul 24, 2014 at 12:51 PM, Alois Cochard
wrote: Hi Andrew,
I'm actually writing a tool to automate the workflow when coding on multiple modules, and dealing with a shared sandbox. I think that would be the perfect fit for an option like this (and thanks to your email, I'll be sure it's easy to enable... or maybe even make it the default... but ... developers often want fast compilation too!), I don't really see that enabled by default on cabal for the same reason others mentioned.
Cheers
On 24 July 2014 00:18, Andrew Pennebaker
wrote: I love GHC's profiling support, and like to use it to analyze the performance of my Haskell applications. However, profiling an application is difficult when it depends on any third-party libraries, as cabal doesn't include profiling information by default.
Fortunately, cabal can reinstall a library with profiling support, with:
cabal install --reinstall -p <library>
Unfortunately, cabal is a bit of a simpleton, so this will fail unless that libraries dependencies are also installed with profiling enabled:
cabal install --reinstall -p <libraryX> <libraryY> <libraryZ> ...
For example, a user who wants to profile his die-rolling program must run:
$ sudo apt-get install haskell-platform haskell-platform-doc haskell-platform-prof $ sudo cabal install --reinstall -p mwc-random rvar random-fu random-source mersenne-random-pure64 stateref flexible-defaults th-extras MonadPrompt math-functions erf vector-th-unbox monad-loops random-shuffle MonadRandom
And that long list of packages must be slowly grown one at a time, starting from random-source, based on many attempts at running cabal install --reinstall -p ..., waiting several minutes for compilation to partially complete, and scrolling back up through the logs to track down which dependencies also neglected to compile with profiling enabled.
It can take a while to get a list of this long, full dependency chain. It would be much easier if cabal simply enabled `-p` by default, so we didn't have to think about it.
What do you think?
-- Cheers,
Andrew Pennebaker www.yellosoft.us
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
-- A\ois http://twitter.com/aloiscochard http://github.com/aloiscochard
-- Cheers,
Andrew Pennebaker www.yellosoft.us
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Hi,
On 24 July 2014 22:30, Andrew Pennebaker
What if -p continued to default to false, but when -p was specified, cabal was smart enough to automatically recompile all dependencies with -p, rather than complaining about them lacking profiling?
I think everyone agrees that it's how it should work. Now someone needs to implement it.

Have cabal run the equivalent of ghc-pkg-dep on the user-supplied package list before attempting to (re)install them with profiling. On Thu, Jul 24, 2014 at 3:42 PM, Mikhail Glushenkov < the.dead.shall.rise@gmail.com> wrote:
Hi,
On 24 July 2014 22:30, Andrew Pennebaker
wrote: What if -p continued to default to false, but when -p was specified, cabal was smart enough to automatically recompile all dependencies with -p, rather than complaining about them lacking profiling?
I think everyone agrees that it's how it should work. Now someone needs to implement it.
-- Cheers, Andrew Pennebaker www.yellosoft.us
participants (9)
-
Alois Cochard
-
Andrew Pennebaker
-
Carl Howells
-
Evan Laforge
-
Henning Thielemann
-
Johan Tibell
-
Mikhail Glushenkov
-
Niklas Hambüchen
-
Petr Pudlák