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
7931e2f3
Commit
7931e2f3
authored
3 years ago
by
Hannes Siebenhandl
Committed by
Daniel Gröber (dxld)
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add build-info location to plan.json
parent
449fa90d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cabal-install/src/Distribution/Client/ProjectPlanOutput.hs
+18
-3
18 additions, 3 deletions
cabal-install/src/Distribution/Client/ProjectPlanOutput.hs
with
18 additions
and
3 deletions
cabal-install/src/Distribution/Client/ProjectPlanOutput.hs
+
18
−
3
View file @
7931e2f3
...
...
@@ -45,11 +45,13 @@ import Distribution.Simple.GHC
,
GhcEnvironmentFileEntry
(
..
),
simpleGhcEnvironmentFile
,
writeGhcEnvironmentFile
)
import
Distribution.Simple.BuildPaths
(
dllExtension
,
exeExtension
)
(
dllExtension
,
exeExtension
,
buildInfoPref
)
import
qualified
Distribution.Compat.Graph
as
Graph
import
Distribution.Compat.Graph
(
Graph
,
Node
)
import
qualified
Distribution.Compat.Binary
as
Binary
import
Distribution.Simple.Utils
import
Distribution.Types.Version
(
mkVersion
)
import
Distribution.Verbosity
import
Prelude
()
...
...
@@ -150,7 +152,7 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig =
|
Just
hash
<-
[
elabPkgSourceHash
elab
]
]
++
(
case
elabBuildStyle
elab
of
BuildInplaceOnly
->
[
"dist-dir"
J
..=
J
.
String
dist_dir
]
[
"dist-dir"
J
..=
J
.
String
dist_dir
]
++
[
buildInfoFileLocation
]
BuildAndInstall
->
-- TODO: install dirs?
[]
...
...
@@ -175,6 +177,20 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig =
]
++
bin_file
(
compSolverName
comp
)
where
-- | Only add build-info file location if the Setup.hs CLI
-- is recent enough to be able to generate build info files.
-- Otherwise, do not add the expected file location.
--
-- Consumers of `plan.json` can use the absence of this file location
-- to indicate that the given component uses `build-type: Custom`
-- with an old lib:Cabal version.
buildInfoFileLocation
::
J
.
Pair
buildInfoFileLocation
|
elabSetupScriptCliVersion
elab
<
mkVersion
[
3
,
7
,
0
,
0
]
=
(
"build-info"
J
..=
J
.
Null
)
|
otherwise
=
(
"build-info"
J
..=
J
.
String
(
buildInfoPref
dist_dir
))
packageLocationToJ
::
PackageLocation
(
Maybe
FilePath
)
->
J
.
Value
packageLocationToJ
pkgloc
=
case
pkgloc
of
...
...
@@ -262,7 +278,6 @@ encodePlanAsJson distDirLayout elaboratedInstallPlan elaboratedSharedConfig =
jdisplay
::
Pretty
a
=>
a
->
J
.
Value
jdisplay
=
J
.
String
.
prettyShow
-----------------------------------------------------------------------------
-- Project status
--
...
...
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