Skip to content

Commit 0db26b1

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 abe6585 commit 0db26b1

File tree

5 files changed

+194
-247
lines changed

5 files changed

+194
-247
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,6 @@ GIT_COMMIT_ID
232232
.bash_history
233233
.gitconfig
234234

235-
# Should be equal to testdir_suffix from testsuite/driver/testlib.py.
236-
*.run
237-
238235
# -----------------------------------------------------------------------------
239236
# ghc.nix
240237
ghc.nix/

cabal.project.rts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
-- NOTE: Yes. The strings have to be escaped like this.
2+
3+
package rts
4+
ghc-options: "-optc-DProjectVersion=\"914\""
5+
ghc-options: "-optc-DBuildPlatform=\"FIXME\""
6+
ghc-options: "-optc-DBuildArch=\"FIXME\""
7+
ghc-options: "-optc-DBuildOS=\"FIXME\""
8+
ghc-options: "-optc-DBuildVendor=\"FIXME\""
9+
ghc-options: "-optc-DGhcUnregisterised=\"FIXME\""
10+
ghc-options: "-optc-DTablesNextToCode=\"FIXME\""
11+
ghc-options: "-optc-DFS_NAMESPACE=rts"
12+
ghc-options: -no-rts
13+
flags: +tables-next-to-code
14+
15+
if os(linux)
16+
package rts
17+
ghc-options: "-optc-DHostArch=\"x86_64\""
18+
ghc-options: "-optc-DHostOS=\"linux\""
19+
ghc-options: "-optc-DHostPlatform=\"x86_64-unknown-linux\""
20+
ghc-options: "-optc-DHostVendor=\"unknown\""
21+
22+
if os(darwin)
23+
package rts
24+
ghc-options: "-optc-DHostArch=\"aarch64\""
25+
ghc-options: "-optc-DHostOS=\"darwin\""
26+
ghc-options: "-optc-DHostPlatform=\"aarch64-apple-darwin\""
27+
ghc-options: "-optc-DHostVendor=\"unknown\""
28+
flags: +leading-underscore
29+
30+
if os(freebsd)
31+
package rts
32+
ghc-options: "-optc-DHostArch=\"x86_64\""
33+
ghc-options: "-optc-DHostOS=\"freebsd\""
34+
ghc-options: "-optc-DHostPlatform=\"x86_64-portbld-freebsd\""
35+
ghc-options: "-optc-DHostVendor=\"unknown\""
36+
37+
if os(wasi)
38+
package rts
39+
ghc-options: "-optc-DHostArch=\"wasm32\""
40+
ghc-options: "-optc-DHostOS=\"unknown\""
41+
ghc-options: "-optc-DHostPlatform=\"wasm32-wasi\""
42+
ghc-options: "-optc-DHostVendor=\"unknown\""
43+
ghc-options: -optl-Wl,--export-dynamic
44+
ghc-options: -optc-fvisibility=default
45+
ghc-options: -optc-fvisibility-inlines-hidden
46+
47+
package rts-headers
48+
ghc-options: -no-rts
49+
50+
package rts-fs
51+
ghc-options: -no-rts

cabal.project.stage1

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
index-state: 2025-10-26T19:17:08Z
2+
allow-boot-library-installs: True
3+
benchmarks: False
4+
tests: False
25

36
packages:
47
-- NOTE: we need rts-headers, because the _newly_ built compiler depends
@@ -10,39 +13,51 @@ packages:
1013
rts-headers
1114
rts-fs
1215

13-
-- other packages.
16+
-- Compiler
1417
ghc
1518
compiler
16-
libraries/directory
17-
libraries/file-io
18-
libraries/filepath
19-
libraries/ghc-platform
19+
20+
-- Internal libraries
2021
libraries/ghc-boot
2122
libraries/ghc-boot-th-next
2223
libraries/ghc-heap
24+
libraries/ghc-platform
2325
libraries/ghci
2426
libraries/libffi-clib
27+
28+
-- Internal tools
29+
utils/deriveConstants
30+
utils/genapply
31+
utils/genprimopcode
32+
utils/ghc-pkg
33+
utils/ghc-toolchain
34+
utils/ghc-toolchain/exe
35+
utils/unlit
36+
37+
-- The following are packages available on Hackage but included as submodules
38+
libraries/Cabal/Cabal
39+
libraries/Cabal/Cabal-syntax
40+
libraries/directory
41+
libraries/file-io
42+
libraries/filepath
2543
libraries/os-string
2644
libraries/process
2745
libraries/semaphore-compat
28-
-- libraries/time
2946
libraries/unix
3047
libraries/Win32
31-
libraries/Cabal/Cabal-syntax
32-
libraries/Cabal/Cabal
33-
utils/ghc-pkg
3448
utils/hsc2hs
35-
utils/unlit
36-
utils/genprimopcode
37-
utils/genapply
38-
utils/deriveConstants
39-
utils/ghc-toolchain
40-
utils/ghc-toolchain/exe
4149

4250

43-
benchmarks: False
44-
tests: False
45-
allow-boot-library-installs: True
51+
--
52+
-- Constraints
53+
--
54+
55+
constraints:
56+
template-haskell <= 2.22
57+
58+
--
59+
-- Package level configuration
60+
--
4661

4762
package *
4863
library-vanilla: True
@@ -67,8 +82,9 @@ package ghc-boot-th-next
6782
package hsc2hs
6883
flags: +in-ghc-tree
6984

70-
constraints:
71-
template-haskell <= 2.22
85+
--
86+
-- Program options
87+
--
7288

7389
program-options
7490
ghc-options: -fhide-source-paths -j

0 commit comments

Comments
 (0)