[Hackage] #217: .hsc files do not get processed for cabal sdist?
Hackage
trac at galois.com
Sat Jan 26 13:39:42 EST 2008
#217: .hsc files do not get processed for cabal sdist?
----------------------------+-----------------------------------------------
Reporter: gwern | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone: Cabal-1.4
Component: Cabal library | Version: 1.2.3.0
Severity: normal | Resolution:
Keywords: | Difficulty: normal
Ghcversion: 6.8.2 | Platform:
----------------------------+-----------------------------------------------
Changes (by duncan):
* status: closed => reopened
* platform: Linux =>
* resolution: invalid =>
* milestone: => Cabal-1.4
Comment:
Certainly putting .hs files in the extra-source-files is incorrect.
There is a bug here however. The original description is inaccurate as it
specifies
{{{
main-is: Hslock.hsc
}}}
where the actual source at http://gorgias.mine.nu/repos/xmonad-utils uses
{{{
main-is: Hslock.hs
}}}
This explains why the error message above is:
{{{
Setup: Hslock.hs doesn't exist
}}}
So, `main-is:` should always be a `.hs` or `.lhs` file and is relative to
the `hs-source-dirs:`. When building we correctly find the
`src/Hslock.hsc` and pre-process it. The bug is that in sdist we just look
for `Hslock.hs` directly in the `hs-source-dirs` without considering pre-
processors at all.
The current `Distribution/Simple/SrcDist.hs` code just does:
{{{
withExe pkg_descr $ \ (Executable _ mainPath exeBi) -> do
prepareDir verbosity targetDir pps [] exeBi
srcMainFile <- findFile (hsSourceDirs exeBi) mainPath
}}}
So the mainPath is ignored for pre-processing purposes.
--
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/217#comment:4>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects
More information about the cabal-devel
mailing list