id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,testcase,blockedby,blocking,related,differential
4063,"target ""is not a module name or a source file""",beroal,,"Create a standalone Haskell program ""/tmp/delme.hs"". Then do
{{{
$ cd /tmp
{- 0 -}$ ghc --make -o delme.exe /tmp/delme.hs
[1 of 1] Compiling Main ( /tmp/delme.hs, /tmp/delme.o )
Linking delme.exe ...
$ rm delme.o
{- 1 -}$ ghc --make -o delme.exe /tmp/delme
[1 of 1] Compiling Main ( /tmp/delme.hs, /tmp/delme.o )
Linking delme.exe ...
$ rm delme.o
$ mv delme.hs delme
{- 2 -}$ ghc --make -o delme.exe /tmp/delme
target `/tmp/delme' is not a module name or a source file
}}}
We see that:[[BR]]
- in ""1"" GHC compiles ""/tmp/delme.hs"" though I say ""/tmp/delme"";[[BR]]
- in ""2"" GHC can not see file ""/tmp/delme"".
The problem is that a target (the last argument) may be a module name or a source file. GHC uses heuristics to determine this. Though heuristics may seem neat and clever, they draw GHC more '''intricate and unpredictable''' (see also [http://en.wikipedia.org/wiki/KISS_principle KISS]).
I encountered this intricacy when ran ""ghc"" on a shell script. Shell scripts in Unix commonly do not have extensions, because interpreter name is included in a shell script. And ""runghc"" runs them fine. ""ghc"" in theory also does not require a file to have an extension because it clearly contains Haskell source code — what else?
I propose to introduce a GHC flag which says explicitly which type a target is of.",feature request,closed,normal,,Compiler,6.12.2,fixed,"target,module name,source file,flag",rabeslik@…,Unknown/Multiple,Unknown/Multiple,None/Unknown,,,,,