#135 "Run with profiling" fails: rts options disabled


Wiindows 7, Haskepp Platform 2011.4, GHC 7.0.4

Try to right-click on an Executable (or Main.hs) and choose "Run With Profiling"
get this eror
MyProject.exe: Most RTS options are disabled. Link with -rtsopts to enable them.

I tried adding "-rtsopts" as a GHC Option un Window -> Preferences -> Haskell -> Haskell Implementations -> GHC

Workaround: I also tried adding "-rtsopts to the Cabal file "ghc-options" section. That works, sometimes.
ghc-options: -Wall -rtsopts

EclipseFP seems to be unpredictable in how it chooses to rebuild content, so I had to delete .dist-buildwrapper\dist\build\MyProject, Project -> Clean, Project -> Build, etc, before a new executable was generated.

Then, Profiling worked. (Very nice!)


  • JP Moresmau

    JP Moresmau - 2012-01-29
    • assigned_to: nobody --> jpmoresmau
    • status: open --> closed-rejected
  • JP Moresmau

    JP Moresmau - 2012-01-29

    The GHC options in preferences only apply when a new project is created. So the standard way to fix having no profiling is to add the rtsopts to the Cabal file. What do you mean it works "sometimes".
    EclipseFP does not choose to rebuild content. When a project is built, we call Cabal, cabal decides what to rebuild. I agree that having clean deleting the dist-buildwrapper directory would be a good idea, but that's another subject

  • JP Moresmau

    JP Moresmau - 2012-01-29

    Actually, it's true that the behavior is not consistent. We should either
    1. only enabling run with profiling if rtsopts is in the cabal stanza
    2. add rtsopts automatically when choosing profiling

    Since 2. will cause a rebuild and such, 1. has my vote. Thoughts?

  • JP Moresmau

    JP Moresmau - 2012-01-29
    • status: closed-rejected --> open-accepted
  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2012-01-30

    First question:

    I wrote "sometimes" because I find that it is difficult to consistently reproduce issues with build and launch.

    (I think the reason that behavior is inconsistent is that buildwrapper runs in a separate process asynchronously and without status-tracking in Eclipse GUI, so I get my build into a weird state by interacting with Eclipse while buildwrapper is running.)

    Second question:
    Re: 1. In general, I think that the software UI should always give advice if it cannot perform a requested action. So, if the profiling option is disabled, it will be confusing the user WHY profiling is disabled. (Is there a way to put a message in the UI, saying "add -rtsopts to cabal file" ?)

    Re 2. I think this is good, very user-friendly, if possible.

    Related suggestions:
    3. Make "-rtsopts" part of the default cabal file? (This may require adding a dedicated option in the Preferences pane, so that users can turn OFF -rtsopts if desired.) I think -rtsopts is almost always what users want. The only reason I know for disabling -rtsopts is to generate a shared-environment security-conscious build for a published package.

    Last edit: Anonymous 2014-06-11