[GHC] #11201: ghc --make on Haskell and non-Haskell inputs can silently clobber input

GHC ghc-devs at haskell.org
Wed Dec 16 12:12:04 UTC 2015


#11201: ghc --make on Haskell and non-Haskell inputs can silently clobber input
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.11
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 What is the suggested alternative behavior? Fail when detecting that two
 output filenames would be the same, or just warn that something looks
 fishy? Presumably handling the situation gracefully (e.g. linking the two
 object files together, or choosing a different output file name) is out of
 the question.

 This is just one of a number of ways to shoot oneself in the foot with
 poorly named input files (try compiling both `Foo.hs` and `Foo.lhs` in the
 same command for a good time), so I don't think it is worth investing much
 complexity here.

 The more important issue is to keep the compiler's behavior (i.e.
 "`Foo.hs` gets compiled to `Foo.o` and `Foo.hi`, clobbering the existing
 files) predictable enough that the user can be expected to reason about it
 and not get themselves into situations such as this one.

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


More information about the ghc-tickets mailing list