Skip to content

Commit

Permalink
Make package db paths absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Jun 11, 2020
1 parent 293baaf commit 08cc8e0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/HIE/Bios/Environment.hs
Expand Up @@ -171,12 +171,19 @@ addCmdOpts cmdOpts df1 = do
-- This makes the 'DynFlags' independent of the current working directory.
makeDynFlagsAbsolute :: FilePath -> DynFlags -> DynFlags
makeDynFlagsAbsolute work_dir df =
mapOverIncludePaths (prependIfNotAbsolute work_dir)
mapOverIncludePaths (prependIfRelative work_dir)
$ df
{ importPaths = map (prependIfNotAbsolute work_dir) (importPaths df)
{ importPaths = map (prependIfRelative work_dir) (importPaths df)
, packageDBFlags =
let makePackageDbAbsolute (PackageDB pkgConfRef) = PackageDB
$ case pkgConfRef of
PkgConfFile fp -> PkgConfFile (prependIfRelative work_dir fp)
conf -> conf
makePackageDbAbsolute db = db
in map makePackageDbAbsolute (packageDBFlags df)
}
where
prependIfNotAbsolute wdir f
prependIfRelative wdir f
| isAbsolute f = f
| otherwise = wdir </> f

Expand Down

0 comments on commit 08cc8e0

Please sign in to comment.