Wolfgang Jeltsch pushed to branch wip/jeltsch/improve-closure-property-check at Glasgow Haskell Compiler / GHC Commits: ebd3f23d by Wolfgang Jeltsch at 2026-08-26T13:59:40+03:00 Switch to unit identification via global unit keys - - - - - 2 changed files: - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Unit/External/Index.hs Changes: ===================================== compiler/GHC/Driver/Downsweep.hs ===================================== @@ -55,7 +55,6 @@ import Language.Haskell.Syntax.ImpExp import GHC.Types.UnresolvedImport import GHC.Data.FastString -import GHC.Data.ShortText (ShortText) import GHC.Data.Maybe ( expectJust ) import qualified GHC.Data.Maybe as M import GHC.Data.OsPath ( OsPath, unsafeEncodeUtf ) @@ -93,6 +92,7 @@ import GHC.Unit.Module.Graph import GHC.Unit.Module.Deps import qualified GHC.Unit.Home.Graph as HUG import GHC.Unit.Module.Stage +import GHC.Unit.External.Index (GlobalUnitKey, mkGlobalUnitKey) import Data.Either ( partitionEithers, lefts ) import Data.Map (Map) @@ -961,7 +961,7 @@ checkHomeUnitsClosed unit_env Set.empty where - collect :: [UnitState] -> State (Set ShortText) [(UnitId, UnitId)] + collect :: [UnitState] -> State (Set GlobalUnitKey) [(UnitId, UnitId)] collect [] = pure [] collect (current_unit_state : remaining_unit_states) @@ -973,7 +973,7 @@ checkHomeUnitsClosed unit_env collect_for_home_unit :: UnitInfoMap -> [UnitId] - -> State (Set ShortText) [(UnitId, UnitId)] + -> State (Set GlobalUnitKey) [(UnitId, UnitId)] collect_for_home_unit _ [] = return [] collect_for_home_unit unit_info_map (current_unit : remaining_units) = do @@ -988,14 +988,14 @@ checkHomeUnitsClosed unit_env unit_not_found_msg :: String unit_not_found_msg = "Unit not found during closure property check" - abi_hash :: ShortText - abi_hash = unitAbiHash unit_info + global_unit_key :: GlobalUnitKey + global_unit_key = mkGlobalUnitKey current_unit (unitAbiHash unit_info) - has_been_processed <- gets (Set.member abi_hash) + has_been_processed <- gets (Set.member global_unit_key) if has_been_processed then collect_for_home_unit unit_info_map remaining_units else do - modify (Set.insert abi_hash) + modify (Set.insert global_unit_key) let needed_units :: [UnitId] ===================================== compiler/GHC/Unit/External/Index.hs ===================================== @@ -308,6 +308,7 @@ data GlobalUnitKey = GlobalUnitKey !UnitId -- ^ Unit Id of the 'UnitInfo' !UnitAbiHash -- ^ ABI hash of the 'UnitInfo' + deriving (Eq, Ord) globalUnitKeyFromUnitInfo :: UnitInfo -> GlobalUnitKey globalUnitKeyFromUnitInfo ui = mkGlobalUnitKey (unitId ui) (unitAbiHash ui) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ebd3f23d37929fe81704bafb51069dde... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ebd3f23d37929fe81704bafb51069dde... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Wolfgang Jeltsch (@jeltsch)