#3321: -fhpc assumes original sources relative to the current directory
-----------------------------+----------------------------------------------
Reporter: duncan | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.10.1 | Severity: minor
Keywords: | Testcase:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
-----------------------------+----------------------------------------------
For the most part, ghc can be invoked in a manner that is independent of
the current directory by suitable use of `-i` options.
With `-fhpc` it appears that the hpc bits always look in the current
directory to find original source files.
Consider the following file layout:
{{{
Codec/Compression/Zlib/Stream.hsc
dist/build/Codec/Compression/Zlib/Stream.hs
examples/gunzip.hs
}}}
Now if we `cd` to `examples` and run:
{{{
ghc --make gunzip.hs -lz -i../ -i../dist/build
}}}
then it works fine. It finds `Codec/Compression/Zlib/Stream.hs` in
`../dist/build` and it never bothers to look for the original source of
course.
Now in `-fhpc` mode it has to also find the original sources so that it
can match things back to them. However just adding -fhpc to the above
command fails:
{{{
ghc --make gunzip.hs -lz -i../ -i../dist/build -fhpc
[1 of 4] Compiling Codec.Compression.Zlib.Stream (
../dist/build/Codec/Compression/Zlib/Stream.hs,
../dist/build/Codec/Compression/Zlib/Stream.o )
Codec/Compression/Zlib/Stream.hsc: getModificationTime: does not exist (No
such file or directory)
}}}
So it's clearly not looking in the directory given by `-i..` for the
original sources. Also, the failure mode is a bit unfriendly.
Cabal sometimes takes advantage of the fact that ghc can be invoked in a
manner that is independent of the current directory, and we would like to
add hpc support into Cabal.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3321>
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