aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Distribution/Helper.hs7
-rw-r--r--src/CabalHelper/Compiletime/Types.hs6
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs
index 167db45..1505063 100644
--- a/lib/Distribution/Helper.hs
+++ b/lib/Distribution/Helper.hs
@@ -279,14 +279,9 @@ compilerVersion = Query $ \qe ->
-- ^ ASSUMPTION: Here we assume the compiler version is uniform across all
-- units so we just pick any one.
case piImpl proj_info of
- ProjInfoV1 { piV1SetupHeader=UnitHeader{..} } ->
- return $ first BS8.unpack $ uhCompilerId
- -- ^ The package name here is restricted to Latin-1 because of the way
- -- Cabal writes the header. Shouldn't matter too much V1 is legacy
- -- anyways and GHC and it's glorious ASCII name rule the Haskell world.
+ ProjInfoV1 {} -> uiCompilerId <$> getUnitInfo qe someUnit
ProjInfoV2 { piV2CompilerId } -> return piV2CompilerId
ProjInfoStack {} -> uiCompilerId <$> getUnitInfo qe someUnit
- -- ^ TODO: Any way to get this faster for stack?
-- | All local units currently active in a project\'s build plan.
projectUnits :: Query pt (NonEmpty (Unit pt))
diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs
index 653497d..ec24f2d 100644
--- a/src/CabalHelper/Compiletime/Types.hs
+++ b/src/CabalHelper/Compiletime/Types.hs
@@ -246,12 +246,14 @@ data UnitHeader = UnitHeader
{ uhBrokenPackageId :: !(ByteString, Version)
-- ^ Name and version of the source package. Don't use this, it's broken
-- when the package name contains Unicode characters. See 'uiPackageId'
- -- instead.
+ -- instead. Note: This was fixed by hvr in Cabal HEAD actually.
, uhSetupId :: !(ByteString, Version)
-- ^ Name and version of the @Setup.hs@ implementation. We expect
-- @"Cabal"@ here, naturally.
, uhCompilerId :: !(ByteString, Version)
- -- ^ Name and version of the compiler this Unit is configured to use.
+ -- ^ Name and version of the compiler that was used to build
+ -- Setup.hs. WARNING: This does not identify the GHC version the project
+ -- is configured to use!
} deriving (Eq, Ord, Read, Show)
newtype UnitId = UnitId String