Alfredo Di Napoli | 20 Oct 16:27 2013
Picon

Is Cabal ignoring "-with-rtsopts"?

Hello guys,

I'm integrating EKG in my webserver and I've stumbled upon a peculiar behaviour: Putting this inside my cabal manifest seems to not trigger any effect (EKG shows flat lines):

    GHC-Options:
        -Wall
        -threaded
        -Werror
        -fwarn-tabs
        -with-rtsopts=-T

Whereas, if I run my webserver with "blablabla [...] +RTS -T" everything works as expected. What am I missing?

I am on GHC 7.6.3, Cabal 1.18 and Mac OS X 64 bit.

Alfredo
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Roman Cheplyaka | 20 Oct 17:40 2013

Re: Is Cabal ignoring "-with-rtsopts"?

You could start by running cabal with -v and seeing if it passes the
right option to ghc during the linking phase.

Roman

* Alfredo Di Napoli <alfredo.dinapoli <at> gmail.com> [2013-10-20 15:27:54+0100]
> Hello guys,
> 
> I'm integrating EKG in my webserver and I've stumbled upon a peculiar
> behaviour: Putting this inside my cabal manifest seems to not trigger any
> effect (EKG shows flat lines):
> 
>     GHC-Options:
>         -Wall
>         -threaded
>         -Werror
>         -fwarn-tabs
>         -with-rtsopts=-T
> 
> Whereas, if I run my webserver with "blablabla [...] +RTS -T" everything
> works as expected. What am I missing?
> 
> I am on GHC 7.6.3, Cabal 1.18 and Mac OS X 64 bit.
> 
> Alfredo

> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Alfredo Di Napoli | 20 Oct 17:50 2013
Picon

Re: Is Cabal ignoring "-with-rtsopts"?

Hi Roman,

strangely enough, now that I've recompiled the program cabal does pass the correct flag and everything works as expected.
Which kinda surprise me. The only explanation I have is that I've modified the source code, so cabal was forced to recompile everything with the new flags.

Thanks,
A.


On 20 October 2013 16:40, Roman Cheplyaka <roma <at> ro-che.info> wrote:
You could start by running cabal with -v and seeing if it passes the
right option to ghc during the linking phase.

Roman

* Alfredo Di Napoli <alfredo.dinapoli <at> gmail.com> [2013-10-20 15:27:54+0100]
> Hello guys,
>
> I'm integrating EKG in my webserver and I've stumbled upon a peculiar
> behaviour: Putting this inside my cabal manifest seems to not trigger any
> effect (EKG shows flat lines):
>
>     GHC-Options:
>         -Wall
>         -threaded
>         -Werror
>         -fwarn-tabs
>         -with-rtsopts=-T
>
> Whereas, if I run my webserver with "blablabla [...] +RTS -T" everything
> works as expected. What am I missing?
>
> I am on GHC 7.6.3, Cabal 1.18 and Mac OS X 64 bit.
>
> Alfredo

> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Brandon Allbery | 20 Oct 18:08 2013
Picon

Re: Is Cabal ignoring "-with-rtsopts"?

On Sun, Oct 20, 2013 at 11:50 AM, Alfredo Di Napoli <alfredo.dinapoli <at> gmail.com> wrote:
strangely enough, now that I've recompiled the program cabal does pass the correct flag and everything works as expected.

Yes, that is in ghc-options and therefore only does something when you compile; it's not consulted at runtime (indeed, running a program doesn't even look at the cabal file).

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Alfredo Di Napoli | 20 Oct 18:11 2013
Picon

Re: Is Cabal ignoring "-with-rtsopts"?

Thanks Brandon, it makes sense, dumb me for not having thought that in the first place. 

A.


On 20 October 2013 17:08, Brandon Allbery <allbery.b <at> gmail.com> wrote:
On Sun, Oct 20, 2013 at 11:50 AM, Alfredo Di Napoli <alfredo.dinapoli <at> gmail.com> wrote:
strangely enough, now that I've recompiled the program cabal does pass the correct flag and everything works as expected.

Yes, that is in ghc-options and therefore only does something when you compile; it's not consulted at runtime (indeed, running a program doesn't even look at the cabal file).

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Roman Cheplyaka | 20 Oct 18:16 2013

Re: Is Cabal ignoring "-with-rtsopts"?

* Brandon Allbery <allbery.b <at> gmail.com> [2013-10-20 12:08:59-0400]
> On Sun, Oct 20, 2013 at 11:50 AM, Alfredo Di Napoli <
> alfredo.dinapoli <at> gmail.com> wrote:
> 
> > strangely enough, now that I've recompiled the program cabal does pass the
> > correct flag and everything works as expected.
> >
> 
> Yes, that is in ghc-options and therefore only does something when you
> compile; it's not consulted at runtime (indeed, running a program doesn't
> even look at the cabal file).

Not really. -with-rtsopts is a linking-time flag that sets the default
RTS options. See
http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/runtime-control.html#rts-opts-compile-time

Roman
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Roman Cheplyaka | 20 Oct 18:25 2013

Re: Is Cabal ignoring "-with-rtsopts"?

* Roman Cheplyaka <roma <at> ro-che.info> [2013-10-20 19:16:34+0300]
> * Brandon Allbery <allbery.b <at> gmail.com> [2013-10-20 12:08:59-0400]
> > On Sun, Oct 20, 2013 at 11:50 AM, Alfredo Di Napoli <
> > alfredo.dinapoli <at> gmail.com> wrote:
> > 
> > > strangely enough, now that I've recompiled the program cabal does pass the
> > > correct flag and everything works as expected.
> > >
> > 
> > Yes, that is in ghc-options and therefore only does something when you
> > compile; it's not consulted at runtime (indeed, running a program doesn't
> > even look at the cabal file).
> 
> Not really. -with-rtsopts is a linking-time flag that sets the default
> RTS options. See
> http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/runtime-control.html#rts-opts-compile-time

Oh, I think I misunderstood what you're saying. You were pointing out
that Alfredo didn't recompile his program. I thought you're saying that
this isn't supposed to work at all.

Sorry for the noise.

Roman
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Brandon Allbery | 20 Oct 21:58 2013
Picon

Re: Is Cabal ignoring "-with-rtsopts"?

On Sun, Oct 20, 2013 at 12:25 PM, Roman Cheplyaka <roma <at> ro-che.info> wrote:
* Roman Cheplyaka <roma <at> ro-che.info> [2013-10-20 19:16:34+0300]
> * Brandon Allbery <allbery.b <at> gmail.com> [2013-10-20 12:08:59-0400]
> > On Sun, Oct 20, 2013 at 11:50 AM, Alfredo Di Napoli <
> > alfredo.dinapoli <at> gmail.com> wrote:
> > > strangely enough, now that I've recompiled the program cabal does pass the
> > > correct flag and everything works as expected.
> >
> > Yes, that is in ghc-options and therefore only does something when you
> > compile; it's not consulted at runtime (indeed, running a program doesn't
> > even look at the cabal file).
>
> Not really. -with-rtsopts is a linking-time flag that sets the default
> RTS options.

Oh, I think I misunderstood what you're saying. You were pointing out
that Alfredo didn't recompile his program. I thought you're saying that
this isn't supposed to work at all.

Right. I considered mentioning the distinction between compile-time and link-time, but as cabal-install doesn't expose such a distinction it's pretty pointless. Maybe I should have said "build" instead of "compile" though.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane