aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CabalHelper/Compiletime/Program/CabalInstall.hs9
-rw-r--r--src/CabalHelper/Compiletime/Types.hs5
2 files changed, 8 insertions, 6 deletions
diff --git a/src/CabalHelper/Compiletime/Program/CabalInstall.hs b/src/CabalHelper/Compiletime/Program/CabalInstall.hs
index 9823c50..71866ae 100644
--- a/src/CabalHelper/Compiletime/Program/CabalInstall.hs
+++ b/src/CabalHelper/Compiletime/Program/CabalInstall.hs
@@ -300,10 +300,13 @@ planPackages plan = do
| otherwise =
ch_unit
- unitTargets :: CP.Unit -> [String]
+ unitTargets :: CP.Unit -> [(ChComponentName, String)]
unitTargets CP.Unit {uComps, uPId=CP.PkgId pkg_name _} =
- map (Text.unpack . (((coerce pkg_name) <> ":") <>) . CP.dispCompNameTarget pkg_name) $
- Map.keys uComps
+ [ (cpCompNameToChComponentName comp, Text.unpack target)
+ | comp <- Map.keys uComps
+ , let comp_str = CP.dispCompNameTarget pkg_name comp
+ , let target = ((coerce pkg_name) <> ":") <> comp_str
+ ]
mkUnit :: Package' () -> CP.Unit -> Unit ('Cabal 'CV2)
mkUnit pkg u@CP.Unit
diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs
index b96101a..bb36df8 100644
--- a/src/CabalHelper/Compiletime/Types.hs
+++ b/src/CabalHelper/Compiletime/Types.hs
@@ -348,8 +348,7 @@ data UnitImpl pt where
UnitImplV1 :: UnitImpl ('Cabal 'CV1)
UnitImplV2 ::
- { uiV2ComponentNames :: ![ChComponentName]
- , uiV2Components :: ![String]
+ { uiV2Components :: ![(ChComponentName, String)]
, uiV2OnlyDependencies :: !Bool
} -> UnitImpl ('Cabal 'CV2)
@@ -366,7 +365,7 @@ deriving instance Show (UnitImpl pt)
-- of helper invocations for clients that don't need to know the entire project
-- structure.
uComponentName :: Unit pt -> Maybe ChComponentName
-uComponentName Unit { uImpl=UnitImplV2 { uiV2ComponentNames=[comp] } } =
+uComponentName Unit { uImpl=UnitImplV2 { uiV2Components=[(comp, _)] } } =
Just comp
uComponentName _ =
Nothing