@@ -497,9 +497,9 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi
497
497
{ IPI. sourcePackageId = packageId pkg
498
498
, IPI. installedUnitId = componentUnitId clbi
499
499
, IPI. installedComponentId_ = componentComponentId clbi
500
- , IPI. instantiatedWith = componentInstantiatedWith clbi
500
+ , IPI. instantiatedWith = expectLibraryComponent (maybeComponentInstantiatedWith clbi)
501
501
, IPI. sourceLibName = libName lib
502
- , IPI. compatPackageKey = componentCompatPackageKey clbi
502
+ , IPI. compatPackageKey = expectLibraryComponent (maybeComponentCompatPackageKey clbi)
503
503
, -- If GHC >= 8.4 we register with SDPX, otherwise with legacy license
504
504
IPI. license =
505
505
if ghc84
@@ -518,7 +518,7 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi
518
518
, IPI. indefinite = componentIsIndefinite clbi
519
519
, IPI. exposed = libExposed lib
520
520
, IPI. exposedModules =
521
- componentExposedModules clbi
521
+ expectLibraryComponent (maybeComponentExposedModules clbi)
522
522
-- add virtual modules into the list of exposed modules for the
523
523
-- package database as well.
524
524
++ map (\ name -> IPI. ExposedModule name Nothing ) (virtualModules bi)
@@ -601,6 +601,8 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi
601
601
)
602
602
| otherwise =
603
603
(libdir installDirs : dynlibdir installDirs : extraLibDirs', [] )
604
+ expectLibraryComponent (Just attribute) = attribute
605
+ expectLibraryComponent Nothing = (error " generalInstalledPackageInfo: Expected a library component, got something else." )
604
606
605
607
-- the compiler doesn't understand the dynamic-library-dirs field so we
606
608
-- add the dyn directory to the "normal" list in the library-dirs field
0 commit comments