#3675: load fails with Literate target contents
-------------------------------------+--------------------------------------
    Reporter:  JeanPhilippeMoresmau  |        Owner:                            
       
        Type:  bug                   |       Status:  new                       
       
    Priority:  normal                |    Milestone:  7.2.1                     
       
   Component:  GHC API               |      Version:  6.10.4                    
       
    Keywords:  preprocess Literate   |     Testcase:                            
       
   Blockedby:                        |   Difficulty:                            
       
          Os:  Unknown/Multiple      |     Blocking:                            
       
Architecture:  Unknown/Multiple      |      Failure:  Incorrect warning at 
compile-time
-------------------------------------+--------------------------------------
Description changed by igloo:

Old description:

> I am loading a target with actual contents (targetContents=Just
> (contents, time)). The contents are literate Haskell. I get compilation
> errors instead of the "preprocessing needed, interactive check disabled"
> error I should get. It works if I manually set the Phase to Unlit
> `HsSrcFile`, but the doc says it should guess it's literate from the file
> extension. I'm using 6.10.4 in Windows.
>
> `GHC.hs` line 2240:
> {{{
> Nothing <- mb_phase, Unlit _ <- startPhase src_fn  = True[[BR]]
> }}}
> (src_fn is the file name, endings in .lhs in my case)[[BR]]
>
> `DriverPhase.hs` line 146:
> {{{
> startPhase "lhs"      = Unlit HsSrcFile[[BR]]
> }}}
>
> Somewhere in there we forgot to move from "/drive/dir/foo.lhs" to "lhs".
> We need something like tail $ takeExtension $ src_fn, and handling
> gracefully the case where there is no extension.[[BR]]
>

> I can try to actually code the patch, but I've never tried to build GHC
> on my machine....

New description:

 I am loading a target with actual contents (targetContents=Just (contents,
 time)). The contents are literate Haskell. I get compilation errors
 instead of the "preprocessing needed, interactive check disabled" error I
 should get. It works if I manually set the Phase to Unlit `HsSrcFile`, but
 the doc says it should guess it's literate from the file extension. I'm
 using 6.10.4 in Windows.

 `GHC.hs` line 2240:
 {{{
 Nothing <- mb_phase, Unlit _ <- startPhase src_fn  = True
 }}}
 (src_fn is the file name, endings in .lhs in my case)

 `DriverPhase.hs` line 146:
 {{{
 startPhase "lhs"      = Unlit HsSrcFile
 }}}

 Somewhere in there we forgot to move from "/drive/dir/foo.lhs" to "lhs".
 We need something like tail $ takeExtension $ src_fn, and handling
 gracefully the case where there is no extension.

 I can try to actually code the patch, but I've never tried to build GHC on
 my machine....

--

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3675#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to