Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg-config: Use --libs --static when building with using --enable-executable-static #6935

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 25 additions & 24 deletions cabal-install/src/Distribution/Client/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,34 +99,35 @@ check verbosity = do

-- Poor man’s “group checks by constructor”.
groupChecks :: [PackageCheck] -> [NE.NonEmpty PackageCheck]
groupChecks ds = NE.groupBy (F.on (==) constInt)
(L.sortBy (F.on compare constInt) ds)
where
constInt :: PackageCheck -> Int
constInt (PackageBuildImpossible {}) = 0
constInt (PackageBuildWarning {}) = 1
constInt (PackageDistSuspicious {}) = 2
constInt (PackageDistSuspiciousWarn {}) = 3
constInt (PackageDistInexcusable {}) = 4
groupChecks ds =
NE.groupBy
(F.on (==) constInt)
(L.sortBy (F.on compare constInt) ds)
where
constInt :: PackageCheck -> Int
constInt (PackageBuildImpossible{}) = 0
constInt (PackageBuildWarning{}) = 1
constInt (PackageDistSuspicious{}) = 2
constInt (PackageDistSuspiciousWarn{}) = 3
constInt (PackageDistInexcusable{}) = 4

groupExplanation :: PackageCheck -> String
groupExplanation (PackageBuildImpossible {}) = "The package will not build sanely due to these errors:"
groupExplanation (PackageBuildWarning {}) = "The following errors are likely to affect your build negatively:"
groupExplanation (PackageDistSuspicious {}) = "These warnings will likely cause trouble when distributing the package:"
groupExplanation (PackageDistSuspiciousWarn {}) = "These warnings may cause trouble when distributing the package:"
groupExplanation (PackageDistInexcusable {}) = "The following errors will cause portability problems on other environments:"
groupExplanation (PackageBuildImpossible{}) = "The package will not build sanely due to these errors:"
groupExplanation (PackageBuildWarning{}) = "The following errors are likely to affect your build negatively:"
groupExplanation (PackageDistSuspicious{}) = "These warnings will likely cause trouble when distributing the package:"
groupExplanation (PackageDistSuspiciousWarn{}) = "These warnings may cause trouble when distributing the package:"
groupExplanation (PackageDistInexcusable{}) = "The following errors will cause portability problems on other environments:"

groupOutputFunction :: PackageCheck -> Verbosity -> String -> IO ()
groupOutputFunction (PackageBuildImpossible {}) ver = warnError ver
groupOutputFunction (PackageBuildWarning {}) ver = warnError ver
groupOutputFunction (PackageDistSuspicious {}) ver = warn ver
groupOutputFunction (PackageDistSuspiciousWarn {}) ver = warn ver
groupOutputFunction (PackageDistInexcusable {}) ver = warnError ver
groupOutputFunction (PackageBuildImpossible{}) ver = warnError ver
groupOutputFunction (PackageBuildWarning{}) ver = warnError ver
groupOutputFunction (PackageDistSuspicious{}) ver = warn ver
groupOutputFunction (PackageDistSuspiciousWarn{}) ver = warn ver
groupOutputFunction (PackageDistInexcusable{}) ver = warnError ver

outputGroupCheck :: Verbosity -> NE.NonEmpty PackageCheck -> IO ()
outputGroupCheck ver pcs = do
let hp = NE.head pcs
outf = groupOutputFunction hp ver
notice ver (groupExplanation hp)
CM.mapM_ (outf . ppPackageCheck) pcs

let hp = NE.head pcs
outf = groupOutputFunction hp ver
notice ver (groupExplanation hp)
CM.mapM_ (outf . ppPackageCheck) pcs
7 changes: 5 additions & 2 deletions cabal-install/src/Distribution/Client/ProjectPlanning.hs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ sanityCheckElaboratedPackage
-- readProjectConfig also loads the global configuration, which is read with
-- loadConfig and convertd to a ProjectConfig with convertLegacyGlobalConfig.
--
-- *Important*

-- * Important*

--
-- You can notice how some project config options are needed to read the
-- project config! This is evident by the fact that rebuildProjectConfig
Expand Down Expand Up @@ -539,9 +541,10 @@ configureCompiler
)
$ defaultProgramDb


------------------------------------------------------------------------------

-- * Deciding what to do: making an 'ElaboratedInstallPlan'

------------------------------------------------------------------------------

-- | Return an up-to-date elaborated install plan.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,24 @@ import Distribution.Solver.Types.PackageConstraint (PackageProperty (..))

import Data.Coerce (Coercible, coerce)
import Network.URI (URI (..), URIAuth (..), isUnreserved)
import Test.QuickCheck (Arbitrary(..), Gen, NonEmptyList(..),
arbitraryBoundedEnum, choose, elements, frequency, genericShrink,
liftArbitrary, listOf, oneof, resize, sized, shrinkBoundedEnum, suchThat, vectorOf)
import Test.QuickCheck
( Arbitrary (..)
, Gen
, NonEmptyList (..)
, arbitraryBoundedEnum
, choose
, elements
, frequency
, genericShrink
, liftArbitrary
, listOf
, oneof
, resize
, shrinkBoundedEnum
, sized
, suchThat
, vectorOf
)
import Test.QuickCheck.GenericArbitrary (genericArbitrary)
import Test.QuickCheck.Instances.Cabal ()

Expand Down
3 changes: 3 additions & 0 deletions changelog.d/pkgconfig-static
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
synopsis: pkg-config: Use --libs --static when building with using --enable-executable-static
packages: Cabal
prs: #6935