#5584: ghc -odir is incompatible with .hs-boot files for hierarchical modules
-------------------------------+--------------------------------------------
    Reporter:  georgevdd       |       Owner:                    
        Type:  bug             |      Status:  new               
    Priority:  normal          |   Component:  Compiler          
     Version:  7.0.4           |    Keywords:                    
    Testcase:                  |   Blockedby:                    
          Os:  Linux           |    Blocking:                    
Architecture:  x86_64 (amd64)  |     Failure:  Compile-time crash
-------------------------------+--------------------------------------------
 == Steps to reproduce ==

 1) Adapt the example of
 [http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-
 compilation.html#mutual-recursion how to compile mutually recursive
 modules] so that the modules involved have hierarchical names:

 File S/A.hs:
 {{{
 module S.A where
     import S.B( TB(..) )

     newtype TA = MkTA Int

     f :: TB -> TA
     f (MkTB x) = MkTA x
 }}}

 File S/A.hs-boot:
 {{{
 module S.A where
     newtype TA = MkTA Int
 }}}

 File S/B.hs:
 {{{
 module S.B where
     import {-# SOURCE #-} S.A( TA(..) )

     data TB = MkTB !Int

     g :: TA -> TB
     g (MkTA x) = MkTB x
 }}}

 2) Compile as the example suggests, but with -odir:
 {{{
 mkdir out
 ghc -odir out -c S/A.hs-boot
 }}}

 == Expected behaviour ==

 GHC silently creates the directory out/S and then emits the file A.o-boot
 in that directory.

 == Observed behaviour ==

 GHC produces the error message:
 {{{
 touch: cannot touch `out/S/A.o-boot': No such file or directory
 }}}

 Note: this happens with ghc --make as well.

 == Workaround ==

 Create the directory out/S beforehand.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5584>
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