summaryrefslogtreecommitdiff
path: root/Biz/Bild.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-12-14 08:14:12 -0500
committerBen Sima <ben@bsima.me>2021-12-14 08:17:46 -0500
commit58d00038a26efad6f103f020410d11f9c114899d (patch)
treead82924da4bd5c1bcf8c492a8a427a0cb4bed757 /Biz/Bild.hs
parentddd8ca76de7fb32f2253986e425f161c11472cf0 (diff)
Add custom package db to ghcPkgFindModule
This means my call to ghc-pkg will look at the full package set from Hoogle.
Diffstat (limited to 'Biz/Bild.hs')
-rw-r--r--Biz/Bild.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs
index 17fb883..4d7fadd 100644
--- a/Biz/Bild.hs
+++ b/Biz/Bild.hs
@@ -413,13 +413,11 @@ analyze path = do
}
ghcPkgFindModule :: Set String -> String -> IO (Set String)
-ghcPkgFindModule acc m =
+ghcPkgFindModule acc m = do
+ packageDb <- Env.getEnv "GHC_PACKAGE_PATH"
Process.readProcess
"ghc-pkg"
- -- instead of relying on global deps declared in ./Bild/Deps/Haskell.nix, I
- -- could fetch a global package-db from hackage API and pass it here with
- -- --package-db=FILE
- ["--names-only", "--simple-output", "find-module", m]
+ ["--package-db", packageDb, "--names-only", "--simple-output", "find-module", m]
""
/> String.lines
/> Set.fromList