summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorromes <rodrigo.m.mesquita@gmail.com>2023-03-16 11:35:17 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-04 14:58:14 -0400
commitdb4be3395cb74eb07355339184123d5ded331dc3 (patch)
tree69ccc565d5e4253d74adc44cfbabf39d41061424 /utils
parent6689c9c6eba6f538bedfe7a08316d7c5dec8bfae (diff)
downloadhaskell-db4be3395cb74eb07355339184123d5ded331dc3.tar.gz
Add hashes to unit-ids created by hadrian
This commit adds support for computing an inputs hash for packages compiled by hadrian. The result is that ABI incompatible packages should be given different hashes and therefore be distinct in a cabal store. Hashing is enabled by the `--flag`, and is off by default as the hash contains a hash of the source files. We enable it when we produce release builds so that the artifacts we distribute have the right unit ids.
Diffstat (limited to 'utils')
-rw-r--r--utils/ghc-pkg/Main.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 8746b0296e..0bfc2d159a 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -23,6 +23,7 @@
module Main (main) where
+import Debug.Trace
import qualified GHC.Unit.Database as GhcPkg
import GHC.Unit.Database hiding (mkMungePathUrl)
import GHC.HandleEncoding
@@ -1600,7 +1601,7 @@ listPackages verbosity my_flags mPackageName mModuleName = do
simplePackageList :: [Flag] -> [InstalledPackageInfo] -> IO ()
simplePackageList my_flags pkgs = do
let showPkg :: InstalledPackageInfo -> String
- showPkg | FlagShowUnitIds `elem` my_flags = display . installedUnitId
+ showPkg | FlagShowUnitIds `elem` my_flags = traceId . display . installedUnitId
| FlagNamesOnly `elem` my_flags = display . mungedName . mungedId
| otherwise = display . mungedId
strs = map showPkg pkgs