Skip to content

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

Closed

Description

@edsko

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

/cc @dcoutts

Activity

  1. added
    cabal-install: v2-build system
    on May 19, 2016
  2. hvr commented on May 19, 2016

    @hvr
    Member

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

    executable-profiling: True
    

    ...doesn't that work?

  3. edsko commented on May 19, 2016

    @edsko
    ContributorAuthor

    Doesn't appear to, no.

  4. ezyang commented on Sep 6, 2016

    @ezyang
    Contributor

    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.

  5. ezyang commented on Sep 6, 2016

    @ezyang
    Contributor

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

  6. edsko commented on Sep 19, 2016

    @edsko
    ContributorAuthor

    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 
    
  7. hvr commented on Sep 19, 2016

    @hvr
    Member

    @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...

  8. ezyang commented on Sep 19, 2016

    @ezyang
    Contributor

    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.

  9. 23Skidoo commented on Sep 21, 2016

    @23Skidoo
    Member

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

  10. ezyang commented on Sep 28, 2016

    @ezyang
    Contributor

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

  11. ezyang commented on Sep 28, 2016

    @ezyang
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked: info-neededcabal-install: v2-build systemresolution: duplicatetype: user-question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions