Commit af96c089 authored by Duncan Coutts's avatar Duncan Coutts

Adjust rel/abs path semantics in defaultDistDirLayout

In the ProjectRootExplicit case, findProjectRoot actually returns an
absolute directory but a project file name that is relative to that.

This seems to be the sensible thing to do, so we change what ProjectRoot
is declared to be to match this, and adjust defaultDistDirLayout

This only makes a difference when a custom relative project file is
parent 5b1eca08
......@@ -132,8 +132,9 @@ data ProjectRoot =
ProjectRootImplicit FilePath
-- | -- ^ An explicit project root. It contains the absolute project
-- root dir and the absolute @cabal.project@ file (or explicit override)
-- root dir and the relative @cabal.project@ file (or explicit override)
| ProjectRootExplicit FilePath FilePath
deriving (Eq, Show)
-- | Make the default 'DistDirLayout' based on the project root dir and
-- optional overrides for the location of the @dist@ directory and the
......@@ -148,7 +149,7 @@ defaultDistDirLayout projectRoot mdistDirectory =
(projectRootDir, projectFile) = case projectRoot of
ProjectRootImplicit dir -> (dir, dir </> "cabal.project")
ProjectRootExplicit dir file -> (dir, file)
ProjectRootExplicit dir file -> (dir, dir </> file)
distProjectRootDirectory = projectRootDir
distProjectFile ext = projectFile <.> ext
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment