Commit a890177c authored by Edward Z. Yang's avatar Edward Z. Yang Committed by GitHub
Browse files

Merge pull request #3829 from ezyang/pr/t3827

Correctly propagate profiling for ALL library dependencies.
parents 2a5e9bc2 a310bf51
......@@ -1573,7 +1573,7 @@ elaborateInstallPlan platform compiler compilerprogdb pkgConfigDB
profLibFlag = lookupPerPkgOption pkgid packageConfigProfLib
--TODO: [code cleanup] unused: the old deprecated packageConfigProfExe
libDepGraph = Graph.fromList (map LibDepSolverPlanPackage
libDepGraph = Graph.fromList (map NonSetupLibDepSolverPlanPackage
(SolverInstallPlan.toList solverPlan))
packagesWithLibDepsDownwardClosedProperty property =
......@@ -1597,20 +1597,21 @@ elaborateInstallPlan platform compiler compilerprogdb pkgConfigDB
-- + ghci or shared lib needed by TH, recursive, ghc version dependent
-- | A newtype for 'SolverInstallPlan.SolverPlanPackage' for which the
-- dependency graph considers only library dependencies (so, no setup
-- dependencies or executable dependencies.) Used to compute the set
-- dependency graph considers only dependencies on libraries which are
-- NOT from setup dependencies. Used to compute the set
-- of packages needed for profiling and dynamic libraries.
newtype LibDepSolverPlanPackage
= LibDepSolverPlanPackage { unLibDepSolverPlanPackage :: SolverInstallPlan.SolverPlanPackage }
instance Package LibDepSolverPlanPackage where
packageId = packageId . unLibDepSolverPlanPackage
instance IsNode LibDepSolverPlanPackage where
type Key LibDepSolverPlanPackage = SolverId
nodeKey = nodeKey . unLibDepSolverPlanPackage
nodeNeighbors (LibDepSolverPlanPackage spkg)
= ordNub $ CD.libraryDeps (resolverPackageLibDeps spkg)
newtype NonSetupLibDepSolverPlanPackage
= NonSetupLibDepSolverPlanPackage
{ unNonSetupLibDepSolverPlanPackage :: SolverInstallPlan.SolverPlanPackage }
instance Package NonSetupLibDepSolverPlanPackage where
packageId = packageId . unNonSetupLibDepSolverPlanPackage
instance IsNode NonSetupLibDepSolverPlanPackage where
type Key NonSetupLibDepSolverPlanPackage = SolverId
nodeKey = nodeKey . unNonSetupLibDepSolverPlanPackage
nodeNeighbors (NonSetupLibDepSolverPlanPackage spkg)
= ordNub $ CD.nonSetupDeps (resolverPackageLibDeps spkg)
---------------------------
-- Build targets
......
......@@ -144,6 +144,12 @@ Extra-Source-Files:
tests/IntegrationTests/regression/t3335/Setup.hs
tests/IntegrationTests/regression/t3335/cabal.project
tests/IntegrationTests/regression/t3335/t3335.cabal
tests/IntegrationTests/regression/t3827.sh
tests/IntegrationTests/regression/t3827/cabal.project
tests/IntegrationTests/regression/t3827/p/P.hs
tests/IntegrationTests/regression/t3827/p/p.cabal
tests/IntegrationTests/regression/t3827/q/Main.hs
tests/IntegrationTests/regression/t3827/q/q.cabal
tests/IntegrationTests/sandbox-reinstalls/p/Main.hs
tests/IntegrationTests/sandbox-reinstalls/p/p.cabal
tests/IntegrationTests/sandbox-reinstalls/q/Q.hs
......
. ./common.sh
cd t3827
cabal new-build exe:q
packages: p q
profiling-detail: all-functions
package q
profiling: True
name: p
version: 1.0
build-type: Simple
cabal-version: >= 1.10
library
build-depends: base
exposed-modules: P
name: q
version: 1.0
build-type: Simple
cabal-version: >= 1.10
executable q
build-depends: base, p
main-is: Main.hs
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment