Skip to content

Commit f24a080

Browse files
committed
refactor: reorganize cabal.project files
- Improve the consistency across the stage cabal.project files by using the same ordering and delimiter comments - "package-dbs: clear, global" is the default so it's removed
1 parent f05155d commit f24a080

File tree

3 files changed

+148
-117
lines changed

3 files changed

+148
-117
lines changed

cabal.project.stage1

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
allow-boot-library-installs: True
2+
benchmarks: False
3+
tests: False
4+
15
packages:
26
-- NOTE: we need rts-headers, because the _newly_ built compiler depends
37
-- on these potentially _new_ headers, we must not rely on those from
@@ -8,37 +12,49 @@ packages:
812
rts-headers
913
rts-fs
1014

11-
-- other packages.
15+
-- Compiler
1216
ghc
1317
compiler
14-
libraries/directory
15-
libraries/file-io
16-
libraries/filepath
17-
libraries/ghc-platform
18+
19+
-- Internal libraries
1820
libraries/ghc-boot
1921
libraries/ghc-boot-th-next
2022
libraries/ghc-heap
23+
libraries/ghc-platform
2124
libraries/ghci
25+
26+
-- Internal tools
27+
utils/deriveConstants
28+
utils/genapply
29+
utils/genprimopcode
30+
utils/ghc-pkg
31+
utils/ghc-toolchain
32+
utils/ghc-toolchain/exe
33+
utils/unlit
34+
35+
-- The following are packages available on Hackage but included as submodules
36+
libraries/Cabal/Cabal
37+
libraries/Cabal/Cabal-syntax
38+
libraries/directory
39+
libraries/file-io
40+
libraries/filepath
2241
libraries/os-string
2342
libraries/process
2443
libraries/semaphore-compat
25-
-- libraries/time
2644
libraries/unix
2745
libraries/Win32
28-
libraries/Cabal/Cabal-syntax
29-
libraries/Cabal/Cabal
30-
utils/ghc-pkg
3146
utils/hsc2hs
32-
utils/unlit
33-
utils/genprimopcode
34-
utils/genapply
35-
utils/deriveConstants
36-
utils/ghc-toolchain
37-
utils/ghc-toolchain/exe
3847

39-
benchmarks: False
40-
tests: False
41-
allow-boot-library-installs: True
48+
--
49+
-- Constraints
50+
--
51+
52+
constraints:
53+
template-haskell <= 2.22
54+
55+
--
56+
-- Package level configuration
57+
--
4258

4359
package *
4460
library-vanilla: True
@@ -63,8 +79,9 @@ package ghc-boot-th-next
6379
package hsc2hs
6480
flags: +in-ghc-tree
6581

66-
constraints:
67-
template-haskell <= 2.22
82+
--
83+
-- Program options
84+
--
6885

6986
program-options
7087
ghc-options: -fhide-source-paths -j

cabal.project.stage2

Lines changed: 65 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,106 @@
1-
package-dbs: clear, global
1+
allow-boot-library-installs: True
2+
benchmarks: False
3+
tests: False
4+
5+
-- Disable Hackage, we explicitly include the packages we need.
6+
active-repositories: :none
27

38
-- Import configure/generated feature toggles (dynamic, etc.) if present.
49
-- A default file is kept in-tree; configure will overwrite with substituted values.
510
import: cabal.project.stage2.settings
611

712
packages:
13+
-- RTS
814
rts-headers
915
rts-fs
1016
rts
1117

12-
libraries/ghc-prim
13-
libraries/ghc-internal
14-
libraries/ghc-experimental
15-
libraries/base
18+
-- Compiler
1619
compiler
1720
ghc
18-
libraries/ghc-platform
19-
libraries/ghc-compact
21+
22+
-- Internal libraries
23+
libraries/base
2024
libraries/ghc-bignum
21-
libraries/integer-gmp
2225
libraries/ghc-boot
2326
libraries/ghc-boot-th
27+
libraries/ghc-compact
28+
libraries/ghc-experimental
2429
libraries/ghc-heap
30+
libraries/ghc-internal
31+
libraries/ghc-platform
32+
libraries/ghc-prim
2533
libraries/ghci
26-
libraries/stm
27-
libraries/template-haskell
28-
libraries/hpc
34+
libraries/integer-gmp
2935
libraries/system-cxx-std-lib
36+
libraries/template-haskell
37+
38+
-- Internal tools
39+
utils/deriveConstants
40+
utils/genapply
41+
utils/genprimopcode
42+
utils/ghc-iserv
43+
utils/ghc-pkg
44+
utils/ghc-toolchain
45+
utils/hp2ps
46+
utils/runghc
47+
utils/unlit
48+
49+
-- The following are packages available on Hackage but included as submodules
3050
libraries/array
3151
libraries/binary
3252
libraries/bytestring
53+
libraries/Cabal/Cabal
54+
libraries/Cabal/Cabal-syntax
3355
libraries/containers/containers
3456
libraries/deepseq
3557
libraries/directory
3658
libraries/exceptions
3759
libraries/file-io
3860
libraries/filepath
61+
libraries/haskeline
62+
libraries/hpc
3963
libraries/mtl
4064
libraries/os-string
4165
libraries/parsec
4266
libraries/pretty
4367
libraries/process
4468
libraries/semaphore-compat
69+
libraries/stm
70+
libraries/terminfo
4571
libraries/text
4672
libraries/time
4773
libraries/transformers
4874
libraries/unix
49-
libraries/xhtml
5075
libraries/Win32
76+
libraries/xhtml
77+
utils/hpc
78+
utils/hsc2hs
5179

52-
libraries/Cabal/Cabal-syntax
53-
libraries/Cabal/Cabal
80+
-- These would be on Hackage but we include them as direct URLs
81+
-- (Hackage is disabled by `active-repositories: :none`)
5482
https://hackage.haskell.org/package/alex-3.5.2.0/alex-3.5.2.0.tar.gz
5583
https://hackage.haskell.org/package/happy-2.1.5/happy-2.1.5.tar.gz
5684
https://hackage.haskell.org/package/happy-lib-2.1.5/happy-lib-2.1.5.tar.gz
5785

58-
utils/genprimopcode
59-
utils/deriveConstants
60-
utils/ghc-pkg
61-
utils/hsc2hs
62-
utils/unlit
63-
utils/ghc-toolchain
64-
65-
libraries/haskeline
66-
libraries/terminfo
67-
utils/hp2ps
68-
utils/hpc
69-
utils/ghc-iserv
70-
utils/genapply
71-
utils/runghc
72-
73-
-- project-rts
74-
-- project-ghc
75-
benchmarks: False
76-
tests: False
77-
allow-boot-library-installs: True
78-
active-repositories: :none
86+
--
87+
-- Constraints
88+
--
7989

8090
constraints:
8191
-- we do not want to use the rts-headers from stage1
82-
rts-headers source, rts-fs source
83-
-- All build dependencies should be installed, i.e. from stage1.
92+
-- FIXME: these as listed in `packages:` so they are always used in source form
93+
rts-headers source,
94+
rts-fs source,
95+
8496
-- I cannot write build:* but ghc-internal is enough to do the job.
85-
, build:any.ghc-internal installed
97+
-- FIXME: it should be possible to write build:*
98+
-- All build dependencies should be installed, i.e. from stage1.
99+
build:any.ghc-internal installed
100+
101+
--
102+
-- Package level configuration
103+
--
86104

87105
package *
88106
library-vanilla: True
@@ -128,18 +146,6 @@ if os(darwin)
128146
flags: +tables-next-to-code +leading-underscore
129147
ld-options: -undefined warning
130148

131-
132-
program-options
133-
ghc-options: -fhide-source-paths -j
134-
135-
-- project-boot-libs
136-
benchmarks: False
137-
tests: False
138-
allow-boot-library-installs: True
139-
active-repositories: :none
140-
141-
-- (removed duplicate global package * stanza; first one applies already)
142-
143149
package rts-headers
144150
ghc-options: -no-rts
145151

@@ -180,32 +186,33 @@ package rts
180186
-- throughout the session. See
181187
-- GHC.Unit.State:mkUnitState
182188
--
183-
package ghc-internal
184-
ghc-options: -no-rts
185189

186190
package ghc
187191
flags: +build-tool-depends +internal-interpreter
188192

193+
package ghc-bin
194+
flags: +internal-interpreter -threaded
195+
189196
package ghci
190197
flags: +internal-interpreter
191198

192199
package ghc-internal
193200
flags: +bignum-native
201+
ghc-options: -no-rts
194202

195203
package text
196204
flags: -simdutf
197205

198-
program-options
199-
ghc-options: -fhide-source-paths -j
200-
201-
package ghc-bin
202-
flags: +internal-interpreter -threaded
203-
206+
-- TODO: What is this? Why do we need _in-ghc-tree_ here?
204207
package hsc2hs
205208
flags: +in-ghc-tree
206209

207210
package haskeline
208211
flags: -terminfo
209212

213+
--
214+
-- Program options
215+
--
216+
210217
program-options
211218
ghc-options: -fhide-source-paths -j

0 commit comments

Comments
 (0)