Skip to content

Commit

Permalink
Merge pull request #6406 from commercialhaskell/sd-prefix
Browse files Browse the repository at this point in the history
Remove sd prefix from SublibDump field names
  • Loading branch information
mpilgrem authored Jan 13, 2024
2 parents 1a95a24 + 1f2d354 commit aa0712e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions src/Stack/Build/Installed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import Stack.Prelude
import Stack.SourceMap ( getPLIVersion, loadVersion )
import Stack.Types.CompilerPaths ( getGhcPkgExe )
import Stack.Types.DumpPackage
( DumpPackage (..), SublibDump (..), dpParentLibIdent
, sdPackageName
)
( DumpPackage (..), SublibDump (..), dpParentLibIdent )
import Stack.Types.EnvConfig
( HasEnvConfig, packageDatabaseDeps, packageDatabaseExtra
, packageDatabaseLocal
Expand Down Expand Up @@ -311,12 +309,12 @@ gatherAndTransformSubLoadHelper lh =
onPreviousLoadHelper newVal _oldVal = newVal
(key, value) = case lh.lhSublibrary of
Nothing -> (rawPackageName, rawValue)
Just sd -> (sd.sdPackageName, updateAsSublib sd <$> rawValue)
Just sd -> (sd.packageName, updateAsSublib sd <$> rawValue)
(rawPackageName, rawValue) = lh.lhPair
updateAsSublib
sd
(Library (PackageIdentifier _sublibMungedPackageName version) libInfo)
= Library
(PackageIdentifier key version)
libInfo {iliSublib = Map.singleton sd.sdLibraryName libInfo.iliId}
libInfo {iliSublib = Map.singleton sd.libraryName libInfo.iliId}
updateAsSublib _ v = v
6 changes: 3 additions & 3 deletions src/Stack/Types/DumpPackage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ data DumpPackage = DumpPackage
-- | ghc-pkg has a notion of sublibraries when using ghc-pkg dump. We can only
-- know it's different through the fields it shows.
data SublibDump = SublibDump
{ sdPackageName :: PackageName
{ packageName :: PackageName
-- ^ "package-name" field from ghc-pkg
, sdLibraryName :: StackUnqualCompName
, libraryName :: StackUnqualCompName
-- ^ "lib-name" field from ghc-pkg
}
deriving (Eq, Read, Show)
Expand All @@ -56,4 +56,4 @@ dpParentLibIdent dp = case (dp.sublib, dp.packageIdent) of
(Just sublibDump, PackageIdentifier _ v) ->
Just $ PackageIdentifier libParentPackageName v
where
SublibDump { sdPackageName = libParentPackageName } = sublibDump
SublibDump { packageName = libParentPackageName } = sublibDump

0 comments on commit aa0712e

Please sign in to comment.