[GHC] #8443: cannot find normal object file when compiling TH code

#8443: cannot find normal object file when compiling TH code ----------------------------+---------------------------------------------- Reporter: snoyberg | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Operating System: Linux Architecture: x86_64 | Type of failure: GHC rejects valid program (amd64) | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | ----------------------------+---------------------------------------------- Unfortunately, I haven't been able to whittle this down to a smaller test case. In order to reproduce, just run `cabal install yesod-core-1.2.4.5 --enable-tests`. The result is: {{{ test/YesodCoreTest/NoOverloadedStrings.hs:16:26: cannot find normal object file ‛dist/build/tests/tests- tmp/YesodCoreTest/NoOverloadedStringsSub.dyn_o’ while linking an interpreted expression }}} Tested using: The Glorious Glasgow Haskell Compilation System, version 7.7.20131012 cabal-install version 1.18.0.2 using version 1.18.0 of the Cabal library I'm on Ubuntu 12.04 64-bit. Compiling with GHC 7.6.3 and 7.4.2 works correctly. Let me know if there's any other information I can provide. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8443 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8443: cannot find normal object file when compiling TH code ----------------------------------------------+---------------------------- Reporter: snoyberg | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: GHC rejects valid program | (amd64) Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------------+---------------------------- Changes (by igloo): * status: new => closed * resolution: => invalid Comment: `test/YesodCoreTest/NoOverloadedStrings.hs` uses `TemplateHaskell`, but the `.cabal` file doesn't declare that it uses TH. Cabal should DTRT if it knows that TH is used. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8443#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8443: cannot find normal object file when compiling TH code ----------------------------------------------+---------------------------- Reporter: snoyberg | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: GHC rejects valid program | (amd64) Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------------+---------------------------- Comment (by snoyberg): Can you clarify what the recommended fix is? I'm not certain if you're saying this is a bug in Cabal, or if there is a new requirement to somehow state that code will be using TemplateHaskell and, if such a requirement exists, how a user is supposed to do so. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8443#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8443: cannot find normal object file when compiling TH code ----------------------------------------------+---------------------------- Reporter: snoyberg | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: GHC rejects valid program | (amd64) Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: ----------------------------------------------+---------------------------- Comment (by igloo): It's a bug in `yesod-core`. You need something like `extensions: TemplateHaskell` somewhere. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8443#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8443: cannot find normal object file when compiling TH code -------------------------------------+------------------------------------- Reporter: snoyberg | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: GHC | Difficulty: Unknown rejects valid program | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by nh2): For readers who pass by: `other-extensions: TemplateHaskell` in your cabal file is the recommended way to deal with this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8443#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8443: cannot find normal object file when compiling TH code -------------------------------------+------------------------------------- Reporter: snoyberg | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: GHC rejects | (amd64) valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by nh2): 2 years later, some insight on *why* `other-extensions: TemplateHaskell` helps here:
thoughtpolice: -dynamic-too is sort of designed to not have too much overhead but it's a giant shitshow how it works
In short, it will only re-run the assembler, mostly, since it 'just' has to change some stuff like relocations, etc in the backend for a shared object. It used to not be so easy on windows; the way it's implemented is a hack.
And yeah, Cabal does use the knowledge of TemplateHaskell to know when to turn on -dynamic-too automatically for GHC, so it will build shared object files, which it can link in the background and load in GHCi
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8443#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC