-
Notifications
You must be signed in to change notification settings - Fork 696
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
-prof GHC flag should not to be used with --ghc-options cabal flag #2827
Comments
Actually, with the latest Cabal, they should probably only do
and with the latest development version, they should only do
but these may be inadequately documented and it surely should be an error to include |
@ttuegel is that to say: that in the development version, when --enable-profiling is enabled then the |
@robstewart57 Well, not quite: we actually use |
I think Cabal strips out some |
But if you remove -prof from GHC options at building, how can you pass +RTS -p at execution? |
@ttuegel And leading on from the mirrored stack github ticket about the same issue, stack commit commercialhaskell/stack@7f49966 now means that when the misuse of cabal-install that @ezyang is describing, i.e.
|
Ok, indeed it does, but it's weird.
But when I manually find the executable and run it ("./dist/build/my-exe/my-exe +RTS -p") then it works. I thought both were the same? |
@YPares You are passing |
@ttuegel Ok... now I feel stupid. Thanks a lot ^^. Is it possible to have cabal issue a warning when given +RTS options? Like "BEWARE. This is (maybe) not the RTS you are looking for"? |
Would add to this old thread. I found this thread by:
and
I try to profile HNix inside I tried many variants:
cabal v2-build --enable-tests --enable-profiling --ghc-options="-rtsopts" +RTS -p I enabled profiling the right way, as you several times restated in this thread. But I get the same:
But I already enabled profiling the right way.
You, see - every variant that I was recommended to use, found or tried - results into the option configuration conflict. I am in the complete double bind. |
Problem: build fails with -prof, error like: Failed to load interface for ‘GHC.Integer.Type’ Perhaps you haven't installed the "p_dyn" libraries for package ‘integer-wired-in’? Note: see haskell/cabal#2827
I was reminded of this thread again today. We need to do two things:
|
This is a disaster. @ttuegel, you are completely right. Dear @Anton-Latukha, @docteurklein, @kikofernandez, did you find a solution to your problem? If not, I'm here to help. |
So what is the correct way to pass This may not be relevant, but I also passed |
I'm not sure I'm reading this right but perhaps |
One way to improve this would be to have However, that would be a breaking change and maybe more confusing? |
@Mikolaj Oh, I didn't know you can pass the target after |
Too bad. We really need to fix this.
Actually |
I'm aware, but as you can see... nobody is using |
Ran into this, was using nix to run with Maybe we show a warning or a helpful message that |
When a user wants to run with cost modelling profiling enabled, they need to use
+RTS -p
. For this to work and when invoking GHC directly, the user types:However, if they are using cabal, they should type:
It might not be clear that when cabal is used to invoke GHC,
-prof
should not be used in--ghc-options
. If it is included, then they are likely to see compiler error messages relating to p_dyn, e.g.I initially raised this as a GHC documentation bug, but there it has been suggested that instead, cabal should throw an error or at least print a warning that
-prof
should not appear in the string passed to--ghc-options
.This is the GHC ticket, that I'd like to close once the corresponding stack and cabal tickets are discussed: https://ghc.haskell.org/trac/ghc/ticket/10894
This is the mirrored stack ticket: commercialhaskell/stack#1015
The text was updated successfully, but these errors were encountered: