Skip to content

Commit

Permalink
Remove tracing and Show instance for LabeledPackageConstraint
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 11, 2023
1 parent ec6f599 commit 11d0ad4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion cabal-install-solver/src/Distribution/Solver/Modular.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ modularResolver sc (Platform arch os) cinfo iidx sidx pkgConfigDB pprefs pcs pns
-- Indices have to be converted into solver-specific uniform index.
idx = convPIs os arch cinfo gcs (shadowPkgs sc) (strongFlags sc) (solveExecutables sc) iidx sidx
-- Constraints have to be converted into a finite map indexed by PN.
gcs = M.fromListWith (++) (map pair $ traceShowId pcs)
gcs = M.fromListWith (++) (map pair pcs)
where
pair lpc = (pcName $ unlabelPackageConstraint lpc, [lpc])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import Distribution.Compat.Prelude
import Prelude ()
import Distribution.Solver.Types.ConstraintSource
import Distribution.Solver.Types.PackageConstraint
import Distribution.Types.PackageName
import Distribution.Types.VersionRange
import qualified Data.Map.Strict as Map
import Data.List (groupBy)
Expand All @@ -22,21 +21,6 @@ import Data.List (groupBy)
data LabeledPackageConstraint
= LabeledPackageConstraint PackageConstraint ConstraintSource

instance {-# INCOHERENT #-} Show [LabeledPackageConstraint] where
show [] = ""
show xs = intercalate "\n" $
filter (/= "") (showLabeledPackageConstraint <$> xs)

instance Show LabeledPackageConstraint where
show = showLabeledPackageConstraint

showLabeledPackageConstraint :: LabeledPackageConstraint -> String
showLabeledPackageConstraint (LabeledPackageConstraint pc@(PackageConstraint scope _) src@ConstraintSourceProjectConfig{}) =
if unPackageName (scopeToPackageName scope) == "hashable"
then "SOURCE: " ++ showConstraintSource src ++ ", CONSTRAINT: " ++ show pc
else ""
showLabeledPackageConstraint _ = ""

unlabelPackageConstraint :: LabeledPackageConstraint -> PackageConstraint
unlabelPackageConstraint (LabeledPackageConstraint pc _) = pc

Expand Down

0 comments on commit 11d0ad4

Please sign in to comment.