Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
56c9c67c
Commit
56c9c67c
authored
9 years ago
by
Duncan Coutts
Browse files
Options
Downloads
Plain Diff
Merge pull request #2696 from dcoutts/master
Use the version macros when building Setup.hs
parents
17959b8c
fb7a840d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cabal-install/Distribution/Client/SetupWrapper.hs
+20
-7
20 additions, 7 deletions
cabal-install/Distribution/Client/SetupWrapper.hs
with
20 additions
and
7 deletions
cabal-install/Distribution/Client/SetupWrapper.hs
+
20
−
7
View file @
56c9c67c
...
...
@@ -46,6 +46,8 @@ import Distribution.Simple.Compiler
(
Compiler
(
compilerId
),
compilerFlavor
,
PackageDB
(
..
),
PackageDBStack
)
import
Distribution.Simple.PreProcess
(
runSimplePreProcessor
,
ppUnlit
)
import
Distribution.Simple.Build.Macros
(
generatePackageVersionMacros
)
import
Distribution.Simple.Program
(
ProgramConfiguration
,
emptyProgramConfiguration
,
getProgramSearchPath
,
getDbProgramOutput
,
runDbProgram
,
ghcProgram
...
...
@@ -57,6 +59,7 @@ import Distribution.Simple.Program.Run
import
qualified
Distribution.Simple.Program.Strip
as
Strip
import
Distribution.Simple.BuildPaths
(
defaultDistPref
,
exeExtension
)
import
Distribution.Simple.Command
(
CommandUI
(
..
),
commandShowOptions
)
import
Distribution.Simple.Program.GHC
...
...
@@ -548,7 +551,16 @@ externalSetupMethod verbosity options pkg bt mkargs = do
_
->
(
ghcProgram
,
[
"-threaded"
])
cabalDep
=
maybe
[]
(
\
ipkgid
->
[(
ipkgid
,
cabalPkgid
)])
maybeCabalLibInstalledPkgId
-- We do a few things differently once packages opt-in and declare
-- a custom-settup stanza. In particular we then enforce the deps
-- specified, but also let the Setup.hs use the version macros.
newPedanticDeps
=
useDependenciesExclusive
options'
selectedDeps
|
newPedanticDeps
=
useDependencies
options'
|
otherwise
=
useDependencies
options'
++
cabalDep
addRenaming
(
ipid
,
pid
)
=
(
ipid
,
pid
,
defaultRenaming
)
cppMacrosFile
=
setupDir
</>
"setup_macros.h"
ghcOptions
=
mempty
{
ghcOptVerbosity
=
Flag
verbosity
,
ghcOptMode
=
Flag
GhcModeMake
...
...
@@ -559,16 +571,17 @@ externalSetupMethod verbosity options pkg bt mkargs = do
,
ghcOptSourcePathClear
=
Flag
True
,
ghcOptSourcePath
=
toNubListR
[
workingDir
]
,
ghcOptPackageDBs
=
usePackageDB
options''
,
ghcOptHideAllPackages
=
Flag
(
useDependenciesExclusive
options'
)
,
ghcOptPackages
=
toNubListR
$
map
addRenaming
$
if
useDependenciesExclusive
options'
then
useDependencies
options'
else
useDependencies
options'
++
cabalDep
,
ghcOptHideAllPackages
=
Flag
newPedanticDeps
,
ghcOptCabal
=
Flag
newPedanticDeps
,
ghcOptPackages
=
toNubListR
$
map
addRenaming
selectedDeps
,
ghcOptCppIncludes
=
toNubListR
[
cppMacrosFile
|
newPedanticDeps
]
,
ghcOptExtra
=
toNubListR
extraOpts
}
let
ghcCmdLine
=
renderGhcOptions
compiler
ghcOptions
when
newPedanticDeps
$
rewriteFile
cppMacrosFile
(
generatePackageVersionMacros
[
pid
|
(
_ipid
,
pid
)
<-
selectedDeps
])
case
useLoggingHandle
options
of
Nothing
->
runDbProgram
verbosity
program
conf
ghcCmdLine
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment