From 58d00038a26efad6f103f020410d11f9c114899d Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Tue, 14 Dec 2021 08:14:12 -0500 Subject: Add custom package db to ghcPkgFindModule This means my call to ghc-pkg will look at the full package set from Hoogle. --- Biz/Bild.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Biz/Bild.hs') 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 -- cgit v1.2.3