Ticket #5584 (closed bug: fixed)
ghc -odir is incompatible with .hs-boot files for hierarchical modules
| Reported by: | georgevdd | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 7.4.1 |
| Component: | Compiler | Version: | 7.0.4 |
| Keywords: | Cc: | ||
| Operating System: | Linux | Architecture: | x86_64 (amd64) |
| Type of failure: | Compile-time crash | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Steps to reproduce
1) Adapt the example of 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.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

