[GHC] #8123: GHCi warns about -eventlog even though it's sometimes necessary

#8123: GHCi warns about -eventlog even though it's sometimes necessary -------------------------+------------------------------------------------- Reporter: akio | Owner: Type: bug | Status: new Priority: | Milestone: normal | Version: 7.6.3 Component: GHCi | Operating System: Linux Keywords: | Type of failure: Incorrect warning at Architecture: | compile-time x86_64 (amd64) | Test Case: Difficulty: | Blocking: Unknown | Blocked By: | Related Tickets: | -------------------------+------------------------------------------------- If I invoke GHCi as {{{ghci -eventlog}}}, it says: {{{Warning: -debug, -threaded and -ticky are ignored by GHCi}}}. However, the flag does make a difference, in that GHCi will be able to load object files that were compiled using {{{-eventlog}}}. For this reason, I don't think {{{-eventlog}}} should trigger the warning. Also runghc has the same issue. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8123 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8123: GHCi warns about -eventlog even though it's sometimes necessary -------------------------------------+------------------------------------- Reporter: akio | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect | (amd64) warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * cc: hvr (added) * status: new => infoneeded Comment: @akio I can't reproduce your bug. Could you please supply some example code where running `ghci` with `-eventlog` ''does'' make a difference. Here's what I've tried: {{{ $ cat Test.hs main = return () $ ghc-7.6.3 -fforce-recomp -eventlog -c Test.hs $ ghc-7.6.3 --interactive Test.o GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading object (static) Test.o ... done final link ... done Leaving GHCi. }}} Seems to work fine. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8123#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8123: GHCi warns about -eventlog even though it's sometimes necessary -------------------------------------+------------------------------------- Reporter: akio | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect | (amd64) warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by akio): * status: infoneeded => new Comment: Here is a test session (with GHC 7.10.1): {{{ % cat Test.hs main = return () % ghc -c -eventlog Test.hs % ghci Test.hs GHCi, version 7.10.1.1: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( Test.hs, interpreted ) [flags changed] Ok, modules loaded: Main. *Main> Leaving GHCi. % ghci Test.hs -eventlog GHCi, version 7.10.1.1: http://www.haskell.org/ghc/ :? for help Warning: -debug, -threaded and -ticky are ignored by GHCi Ok, modules loaded: Main. Prelude Main> Leaving GHCi. }}} So GHCi decides to re-use the object file only when it's given `-eventlog`. Perhaps the recompilation checker should ignore this flag, if the flag doesn't actually affect how a module is compiled? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8123#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8123: GHCi warns about -eventlog even though it's sometimes necessary -------------------------------------+------------------------------------- Reporter: akio | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect | (amd64) warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): akio, you seem to have something special about your environment (`DYNAMIC_BY_DEFAULT`?) I had to add `-dynamic` to the `ghc` invocations to reproduce. But a simpler test is {{{ rwbarton@morphism:/tmp$ ghc -c Test.hs rwbarton@morphism:/tmp$ ghc -c Test.hs -threaded compilation IS NOT required rwbarton@morphism:/tmp$ ghc -c Test.hs -debug compilation IS NOT required rwbarton@morphism:/tmp$ ghc -c Test.hs -eventlog rwbarton@morphism:/tmp$ }}} Technically the eventlog way is not actually RTS-only because it adds `-DTRACING` to the C compiler and C preprocessor options. If you had CPP in Test.hs that checked whether `TRACING` was defined, then recompiling the module to an object file (either in ghci or by ghc) really would have been necessary. So, there are a few possible resolutions: 1. Make `WayEventLog` a non-RTS only way in `wayRTSOnly`, which would suppress this ghci warning, on the grounds that modules can detect (via CPP) whether they were built with `-eventlog`. I think this would prevent linking `-eventlog` object files with non-`-eventlog` ones, though. 2. Don't change `wayRTSOnly`, and just change the test for that ghci warning to check something other than `wayRTSOnly` (e.g., treat `WayEventLog` specially). However this leaves us in the current mildly inconsistent state of affairs that `-eventlog` is considered in some sense (and is documented to be) a link-time only option, when in fact it affects compilation as well. 3. Implement `WayEventLog` in the same manner as `WayThreaded` and `WayDebug`. I don't know exactly what is (perhaps thomie can comment) but the latter two ways are not built by automatically enabling CPP options in ghc, even though the RTS is in fact full of `#ifdef THREADED` and `#ifdef DEBUG`. I assume there is some special logic in the build system for these. This potentially breaks people who were using `#ifdef TRACING` in their Haskell source, but hopefully there aren't any (it is undocumented after all). Personally I lean towards 3 if it isn't technically difficult to implement. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8123#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8123: GHCi warns about -eventlog even though it's sometimes necessary -------------------------------------+------------------------------------- Reporter: akio | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect | (amd64) warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by akio): Replying to [comment:3 rwbarton]:
akio, you seem to have something special about your environment (`DYNAMIC_BY_DEFAULT`?) I had to add `-dynamic` to the `ghc` invocations to reproduce.
Oops, yes, I was using a `ghc` with `("GHC Dynamic","NO")`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8123#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC