Skip to content

Commit

Permalink
Include non-absolute paths
Browse files Browse the repository at this point in the history
The main motivation of the commits for issue ulidtko#57 is to make it easier to use
Cabal-doctests with Haskell.nix.  Haskell.nix has built everything by the time
everything is run, so there are no intermediate directories around like `build/`
or `dist/`.

What Haskell.nix does instead is just make the original source available.  So it
seems convenient to include not just absolute paths, but relative paths as well.

Otherwise, we have to munge the "-i" flags after the fact.
  • Loading branch information
shajra committed Dec 30, 2019
1 parent 4e3c021 commit 3206543
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Distribution/Extra/Doctest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ generateBuildModule testSuiteName flags pkg lbi = do
$ lookup "x-doctest-source-dirs"
$ customFieldsBI testBI

additionalDirs <- mapM (fmap ("-i" ++) . makeAbsolute) additionalDirs'
additionalDirs <- fmap ("-i" ++) . (additionalDirs' ++) <$> mapM makeAbsolute additionalDirs'

let recordComponent mbCompName compExposedModules compMainIs compBuildInfo comp compCfg = do
let compBI = compBuildInfo comp
Expand Down

0 comments on commit 3206543

Please sign in to comment.