aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Compiletime/Program/CabalInstall.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2020-05-02 01:55:55 +0200
committerDaniel Gröber <dxld@darkboxed.org>2020-05-02 15:44:26 +0200
commitf0741c61bd82ec0f94edcfa8d950f349eac86c33 (patch)
treeaa381f24429d2e5f50a7f07eee6dec06f279aa0b /src/CabalHelper/Compiletime/Program/CabalInstall.hs
parent11a515ed0e887eef081e514b51f29589cf6693ca (diff)
Ignore setup components from plan.json in readUnitInfo
Cabal includes the Setup.hs executable as a component in plan.json, however there isn't a target to build it directly so we just ignore it for not when reading unit info.
Diffstat (limited to 'src/CabalHelper/Compiletime/Program/CabalInstall.hs')
-rw-r--r--src/CabalHelper/Compiletime/Program/CabalInstall.hs9
1 files changed, 6 insertions, 3 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