[GHC] #8736: GHCi doesn't load .dyn_o files appropriately

#8736: GHCi doesn't load .dyn_o files appropriately ------------------------------------+------------------------------------- Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- Now that GHCi generally defaults to dynamic linking, it handles dynamic object files. But it doesn't implicitly handle the `-dynamic-too` case appropriately: {{{ $ cat Test.hs main = return () $ ./inplace/bin/ghc-stage2 -dynamic Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) Linking Test ... $ ./inplace/bin/ghc-stage2 --interactive Test GHCi, version 7.8.20140130: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Ok, modules loaded: Main. Prelude Main> ^D $ ./inplace/bin/ghc-stage2 -dynamic-too Test.hs [1 of 1] Compiling Main ( Test.hs, Test.o ) Linking Test ... $ ./inplace/bin/ghc-stage2 --interactive Test GHCi, version 7.8.20140130: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Main ( Test.hs, interpreted ) Ok, modules loaded: Main. *Main> }}} Also: {{{ $ ./inplace/bin/ghc-stage2 --interactive Test.dyn_o GHCi, version 7.8.20140130: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Warning: ignoring unrecognised input `Test.dyn_o' Prelude> }}} but it does handle the `.o` case. This should all be fixed and merged to 7.8 since it'll likely be very annoying. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by George): * cc: george.colpitts@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by lukexi): * cc: lukexi@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by thoughtpolice): Ugh, so this is a slightly annoying 'fix' because the compilation options are hashed as part of the recompilation check, and simply loading the dynamic interface file won't work as the hashes will differ (because -dynamic-too implies some other options). I've almost got a working fix for this I think, but it's unclear to me how hacky it might be. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): Summarising the behaviour. If you say `:load Foo` in GHCi * `Foo` was compiled with `-dynamic`: loads `Foo.dyn_o` * `Foo` was compiled without any dynamic flag: does not find object files, so interprets. * `Foo` was compiled with `-dynamic-too`: fails as above. Not a release blocker. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by thoughtpolice): * version: 7.8.1-rc1 => 7.8.1-rc2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.2 Component: Compiler | Version: 7.8.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by thoughtpolice): * milestone: 7.8.1 => 7.8.2 Comment: We're moving this to 7.8.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.2 Component: Compiler | Version: 7.8.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by gidyn): * cc: gideon@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.3 Component: Compiler | Version: 7.8.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by George): Replying to [comment:4 simonpj]:
Summarising the behaviour. If you say `:load Foo` in GHCi * `Foo` was compiled with `-dynamic`: loads `Foo.o` * `Foo` was compiled without any dynamic flag: does not find object files, so interprets. * `Foo` was compiled with `-dynamic-too`: fails as above.
Not a release blocker.
The first case
* `Foo` was compiled with `-dynamic`: loads `Foo.o`
does not seem to be the case in 7.8.2, at least on the Mac where the .o file does not get loaded {{{ ghc --make -O2 -DYNAMIC pfp1.hs [1 of 1] Compiling Main ( pfp1.hs, pfp1.o ) Linking pfp1 ... bash-3.2$ ghci -ignore-dot-ghci GHCi, version 7.8.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> :load pfp1 [1 of 1] Compiling Main ( pfp1.hs, interpreted ) Ok, modules loaded: Main. }}} Should I file a bug? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------ Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.8.4 Component: Compiler | Version: 7.8.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: #9282 -------------------------------------+------------------------------------ Changes (by rwbarton): * related: => #9282 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------- Reporter: | Owner: thoughtpolice thoughtpolice | Status: new Type: bug | Milestone: 7.8.4 Priority: high | Version: 7.8.1-rc2 Component: Compiler | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #9282 None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by int-e): I believe that this also affects users of 'cabal repl', because cabal- install uses -dynamic-too for compiling. So after 'cabal build', 'cabal repl' will still recompile all modules of a package as bytecode. With ghc-7.6.3 (and vanilla objects), 'cabal repl' would load the compiled object files. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------- Reporter: thoughtpolice | Owner: Type: bug | thoughtpolice Priority: high | Status: new Component: Compiler | Milestone: 7.12.1 Resolution: | Version: 7.8.1-rc2 Operating System: Unknown/Multiple | Keywords: Type of failure: None/Unknown | Architecture: Blocked By: | Unknown/Multiple Related Tickets: #9282 | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by gidyn): * cc: gideon@… (removed) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------- Reporter: thoughtpolice | Owner: | thoughtpolice Type: bug | Status: new Priority: high | Milestone: 7.12.1 Component: GHCi | Version: 7.8.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9282 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by ezyang): * component: Compiler => GHCi -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------- Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: GHCi | Version: 7.8.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9282 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by duncan): I should point out (as in my dupe ticket #11118) that this causes `cabal repl` to never be able to load .o files for modules previously compiled, and that there is no sensible workaround that `cabal` can use. The only way to make it work, afaics, is to call ghc to build things twice, once for `-static` and once for `-dynamic` outputs. We don't want to do this since it'll almost double compile times compared to using `-dynamic-too`. So this is perhaps more important than spj realised (in #comment:4). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------- Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: GHCi | Version: 7.8.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9282 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonmar): This will be fixed by #11100 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8736: GHCi doesn't load .dyn_o files appropriately -------------------------------------+------------------------------------- Reporter: thoughtpolice | Owner: thoughtpolice Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: GHCi | Version: 7.8.1-rc2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #9282 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed Comment: The remote GHCi support described in #11100 has been merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8736#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC