[GHC] #8180: ghc --make uses wrong way with Template Haskell

#8180: ghc --make uses wrong way with Template Haskell ----------------------------------+--------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Operating System: MacOS X Architecture: x86_64 (amd64) | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------------+--------------------------------- I have the following files: {{{ {-# LANGUAGE TemplateHaskell #-} module THSplice where number3 = [| 3 |] }}} {{{ {-# LANGUAGE TemplateHaskell #-} module Main where import THSplice main = putStrLn (show $number3) }}} When I say `ghc Main.hs`, I get this: {{{ [1 of 2] Compiling THSplice ( THSplice.hs, THSplice.o ) [2 of 2] Compiling Main ( Main.hs, Main.o ) Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Main.hs:7:23: cannot find normal object file ‛./THSplice.dyn_o’ while linking an interpreted expression }}} It's possible a different collection of flags could get this to work, but I think this behavior goes against the intended "it just works" flavor of `--make`. This is a regression bug -- ghc 7.6.3 does the right thing. I'm on MacOS 10.7.5, Xcode 4.3.3. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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 igloo): Replying to [comment:1 simonmar]:
And if you use `-dynamic-too` with `-o`, you also get this bogus-looking error:
{{{ '/home/simon/code-all/work/ghc-validate/inplace/bin/ghc-stage2' -fforce- recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history --make -o TH_spliceE5 TH_spliceE5.hs -v0 -XTemplateHaskell -package template-haskell -dynamic-too <command line>: With -dynamic-too, must give -dyno iff giving -o }}}
The rationale for the error is that {{{ ghc -dynamic-too Foo.hs -o Some.Filename }}} says "compile both the vanilla and dynamic ways, and put the result in `Some.Filename`, which doesn't make much sense. Then again, I suppose the `.hi` filename is already generated from the output filename, so perhaps it would be more consistent to generate the dynamic filenames too. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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 simonmar): Here's a straw man proposal: * In `--make` mode, if any modules require `TemplateHaskell`, then we switch on `-dynamic-too` automatically, if GHC is dynamically-linked and we're compiling statically * Make `-dynamic-too` work with `-o`, by using some sensible convention for object file names * Document this behavior in the release notes and User's Guide -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: thoughtpolice Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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 simonpj): * owner: => thoughtpolice -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: thoughtpolice Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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 awson): Please, please, remember {{{-dynamic-too}}} does not work on Windows yet! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too
-------------------------------------+------------------------------------
Reporter: goldfire | Owner: thoughtpolice
Type: bug | Status: new
Priority: highest | Milestone: 7.8.1
Component: Compiler | Version: 7.7
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 Austin Seipp

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: thoughtpolice Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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): I've fixed the clash between `-o` and `-dynamic-too`, so now when you say: {{{ ghc -dynamic-too Main.hs }}} the inferred file names should be appropriately generated. The rule is that if you're specifying `-o` but not `-dyno`, then the `-dyno` name should simply be the same filename, but with the dynamic object extension. (Note this doesn't affect linking executables - `-dyno` has no effect there.) I'm now looking to finish the other half (enable `-dynamic-too` if we detect `-XTemplateHaskell` during module loading,) but my first-try patch doesn't seem to work yet. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too
-------------------------------------+------------------------------------
Reporter: goldfire | Owner: thoughtpolice
Type: bug | Status: new
Priority: highest | Milestone: 7.8.1
Component: Compiler | Version: 7.7
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 Austin Seipp

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: thoughtpolice Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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): This should now be fixed - with the example above, `ghc Main.hs` should Just Work. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: thoughtpolice Type: bug | Status: closed Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Resolution: fixed | 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): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: thoughtpolice Type: bug | Status: closed Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonmar): I think you want to add `-dynamic-too` only if (a) `dyanmicGhc==True` and (b) The `-dynamic` flag is off. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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 simonmar): * owner: thoughtpolice => * status: closed => new * resolution: fixed => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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 nomeata): Is this build failure a fallout from your changes? https://s3.amazonaws.com/archive.travis-ci.org/jobs/16832833/log.txt Note that I build (to keep the build time low) with {{{ echo 'DYNAMIC_GHC_PROGRAMS = NO' >> mk/build.mk echo 'GhcLibWays = v' >> mk/build.mk }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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): Yep, sorry about that. Fix incoming. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: thoughtpolice Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 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 nomeata): * owner: => thoughtpolice Comment: If you can’t fix a broken test right away, please consider marking them as `known_broken`. It reduces confusion for other developers and keeps CI tools useful. (Reopening so that this is not forgotten.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too
-------------------------------------+------------------------------------
Reporter: goldfire | Owner: thoughtpolice
Type: bug | Status: new
Priority: highest | Milestone: 7.8.1
Component: Compiler | Version: 7.7
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 Austin Seipp

#8180: Template Haskell now requires -dynamic or -dynamic-too -------------------------------------+------------------------------------ Reporter: goldfire | Owner: thoughtpolice Type: bug | Status: closed Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Resolution: fixed | 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): * status: new => closed * resolution: => fixed Comment: This should now be fixed properly. Joachim, I checked your build here and I think it looks good: https://travis-ci.org/nomeata/ghc-complete/builds/16922297 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8180#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8180: Template Haskell now requires -dynamic or -dynamic-too
-------------------------------------+------------------------------------
Reporter: goldfire | Owner: thoughtpolice
Type: bug | Status: closed
Priority: highest | Milestone: 7.8.1
Component: Compiler | Version: 7.7
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Austin Seipp
participants (1)
-
GHC