Skip to content

--enable-profiling not recognized by new-build? #3442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
edsko opened this issue May 19, 2016 · 10 comments
Closed

--enable-profiling not recognized by new-build? #3442

edsko opened this issue May 19, 2016 · 10 comments

Comments

@edsko
Copy link
Contributor

edsko commented May 19, 2016

How do I make new-build build a profiling-enabled version of my executable? Can it be done?

/cc @dcoutts

@hvr
Copy link
Member

hvr commented May 19, 2016

cabal new-configure --enable-executable-profiling results in cabal.project.local containing

executable-profiling: True

...doesn't that work?

@edsko
Copy link
Contributor Author

edsko commented May 19, 2016

Doesn't appear to, no.

@ezyang
Copy link
Contributor

ezyang commented Sep 6, 2016

It's possible you're seeing some more subtle bug, e.g. #3485. Hard to say without a reproducing case, but maybe wait till we fix that one and see if that fixes your case.

@ezyang
Copy link
Contributor

ezyang commented Sep 6, 2016

Please add constraints: Cabal >= 1.24 to cabal.project and tell us if you still see this problem.

@edsko
Copy link
Contributor Author

edsko commented Sep 19, 2016

With cabal-install-head from @hvr (1.25+git20160918.1.c9e046e~xenial), this config works:

packages: ingest.cabal

profiling: True
executable-profiling: True
constraints: Cabal >= 1.24

program-options
  ghc-options: -fprof-auto 

@hvr
Copy link
Member

hvr commented Sep 19, 2016

@edsko minor nitpick: ghc-prof-options should be used to override the default prof detail level, and even better yet, there's

  • profiling-detail: all-functions and
  • library-profiling-detail: all-functions

which are supposed to work in cabal.project files (in pkg.cabal files we can only use ghc-prof-options), where the levels: default, none, exported-functions, toplevel-functions, all-functions map to the corresponding -fprof-auto* flags...

@ezyang
Copy link
Contributor

ezyang commented Sep 19, 2016

OK @edsko, I think that confirms that this is a dupe of #3485.

@hvr, this clearly seems like a documentation failing. ghc-prof-options is not documented. Can we fix the docs.

@23Skidoo
Copy link
Member

Closing in favour of #3790, which has now been fixed. Please reopen if disagree.

@ezyang
Copy link
Contributor

ezyang commented Sep 28, 2016

Also note that executable-profiling: True is unnecessary; profiling will automatically enable it.

@ezyang
Copy link
Contributor

ezyang commented Sep 28, 2016

Also, to be clear, ghc-prof-options is NOT supported in cabal.project format. So you can only put the flags in ghc-options or use Cabal's built-ins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants