#893: Bad cabal build error message with mangled top of file ------------------------------+--------------------------------------------- Reporter: rrnewton | Owner: Type: defect | Status: new Priority: low | Milestone: Component: Cabal library | Version: 1.8.0.6 Severity: normal | Keywords: Difficulty: easy (<4 hours) | Ghcversion: Platform: | ------------------------------+--------------------------------------------- I accidentally executed an Emacs keystroke that switched tokens around and mangled the top of my file:
{-# Language BangPatterns, CPP #-} # OPTIONS_GHC {--fno-warn-name-shadowing -fwarn-unused-imports #-} When GHC is run directly on this file it gives a sensible error message Control/Monad/Par/Stream.hs:1:36: parse error on input `#' But when building through cabal build it looks like there is a module- name-finding heuristic that is failing (and defaulting to Main), resulting in this weird error message: Building monad-par-0.1.0.2... Control/Monad/Par/Stream.hs:1:1: File name does not match module name: Saw: `Main' Expected: `Control.Monad.Par.Stream' Which really caused me to scratch my head when I saw it ;-). ("No where does it say Main!!") I was afraid I had messed up paths and was loading a different version of the file from another directory or something... -- Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/893> Hackage <http://haskell.org/cabal/> Hackage: Cabal and related projects _______________________________________________ cabal-devel mailing list cabal-devel@haskell.org http://www.haskell.org/mailman/listinfo/cabal-devel