Skip to content

Commit 8cbefb7

Browse files
authored
Consolidate all cabal.project files (#2866)
1 parent 796b292 commit 8cbefb7

16 files changed

+56
-274
lines changed

.github/actions/setup-build/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ runs:
121121

122122
- name: Form the package list ('cabal.project.freeze')
123123
run: |
124+
rm cabal.project.freeze || \
124125
cabal v2-freeze && \
125126
echo "" && \
126127
echo 'Output:' && \

.gitlab-ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ variables:
1616
- GHC_VERSION: 8.10.7
1717
CABAL_PROJECT: cabal.project
1818
- GHC_VERSION: 9.0.2
19-
CABAL_PROJECT: cabal-ghc90.project
19+
CABAL_PROJECT: cabal.project
2020
- GHC_VERSION: 9.2.2
21-
CABAL_PROJECT: cabal-ghc92.project
21+
CABAL_PROJECT: cabal.project
2222
- GHC_VERSION: 9.2.1
23-
CABAL_PROJECT: cabal-ghc92.project
23+
CABAL_PROJECT: cabal.project
2424

2525
workflow:
2626
rules:

bindist/ghcs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
8.6.5,cabal.project
22
8.8.4,cabal.project
33
8.10.7,cabal.project
4-
9.0.2,cabal-ghc90.project
5-
9.2.1,cabal-ghc92.project
6-
9.2.2,cabal-ghc92.project
4+
9.0.2,cabal.project
5+
9.2.1,cabal.project
6+
9.2.2,cabal.project

bindist/ghcs-FreeBSD

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
8.10.7,cabal.project
2-
9.0.2,cabal-ghc90.project
2+
9.0.2,cabal.project

bindist/ghcs-Msys

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
8.10.7,cabal.project
2-
9.0.2,cabal-ghc90.project
3-
9.2.2,cabal-ghc92.project
4-
9.2.1,cabal-ghc92.project
2+
9.0.2,cabal.project
3+
9.2.2,cabal.project
4+
9.2.1,cabal.project

cabal-ghc90.project

-58
This file was deleted.

cabal-ghc92.project

-93
This file was deleted.

cabal.project

+22-7
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,27 @@ write-ghc-environment-files: never
4646
index-state: 2022-04-27T09:22:49Z
4747

4848
constraints:
49-
hyphenation +embed,
50-
-- remove this when hlint sets ghc-lib to true by default
51-
-- https://github.com/ndmitchell/hlint/issues/1376
52-
hlint +ghc-lib
49+
hyphenation +embed,
50+
-- remove this when hlint sets ghc-lib to true by default
51+
-- https://github.com/ndmitchell/hlint/issues/1376
52+
hlint +ghc-lib,
53+
ghc-lib-parser-ex -auto,
54+
stylish-haskell +ghc-lib
5355

5456
allow-newer:
55-
-- for shake-bench
56-
Chart-diagrams:diagrams-core,
57-
SVGFonts:diagrams-core
57+
-- ghc-9.2
58+
----------
59+
hiedb:base,
60+
retrie:ghc-exactprint,
61+
62+
-- for brittany
63+
-- https://github.com/lspitzner/multistate/pull/8
64+
multistate:base,
65+
-- https://github.com/lspitzner/data-tree-print/pull/3
66+
data-tree-print:base,
67+
-- https://github.com/lspitzner/butcher/pull/8
68+
butcher:base,
69+
70+
-- for shake-bench
71+
Chart:lens,
72+
Chart-diagrams:lens,

configuration-ghc-901.nix

-36
This file was deleted.

configuration-ghc-921.nix

-51
This file was deleted.

docs/installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ghcup compile hls -v 1.6.1.0 --ghc 8.10.7 --ghc 8.8.4
3636

3737
Use a different `cabal.project` for a GHC version:
3838
```
39-
ghcup compile hls -v 1.6.1.0 --ghc 9.2.1 --cabal-project cabal-ghc92.project
39+
ghcup compile hls -v 1.6.1.0 --ghc 9.2.1 --cabal-project cabal.project
4040
```
4141

4242
Check `ghcup compile hls --help` for a full list of compilation options.

docs/troubleshooting.md

+1-13
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,10 @@ The easiest way to obtain a dynamically linked HLS binary is to build HLS locall
171171
cabal update && cabal install :pkg:haskell-language-server
172172
```
173173

174-
If you are compiling with a ghc version with a specific `cabal-ghc${ghcVersion}.project` in the repo you will have to use it. For example for ghc-9.0.x:
175-
176-
```bash
177-
cabal update && cabal install :pkg:haskell-language-server --project-file=cabal-ghc90.project
178-
```
179-
180174
Or with `stack`:
181175

182176
```bash
183-
stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml
177+
stack install haskell-language-server
184178
```
185179

186180
You also can leverage `ghcup compile hls`:
@@ -189,12 +183,6 @@ You also can leverage `ghcup compile hls`:
189183
ghcup compile hls -v 1.6.1.0 --ghc 8.10.7
190184
```
191185

192-
as it uses cabal underneath you might need to use a specific cabal.project for some ghc versions:
193-
194-
```bash
195-
ghcup compile hls -v 1.6.1.0 --ghc 9.0.2 --cabal-project cabal-ghc90.project
196-
```
197-
198186
### Preprocessors
199187

200188
HLS is [not yet](https://github.com/haskell/haskell-language-server/issues/176) able to find project preprocessors, which may result in `could not execute: <preprocessor>` errors.

flake.nix

+4-4
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,17 @@
336336
haskell-language-server-dev = mkDevShell ghcDefault "cabal.project";
337337
haskell-language-server-884-dev = mkDevShell ghc884 "cabal.project";
338338
haskell-language-server-8107-dev = mkDevShell ghc8107 "cabal.project";
339-
haskell-language-server-901-dev = mkDevShell ghc901 "cabal-ghc90.project";
340-
haskell-language-server-921-dev = mkDevShell ghc921 "cabal-ghc92.project";
339+
haskell-language-server-901-dev = mkDevShell ghc901 "cabal.project";
340+
haskell-language-server-921-dev = mkDevShell ghc921 "cabal.project";
341341
};
342342

343343
# Developement shell, haskell packages are also provided by nix
344344
nixDevShells = {
345345
haskell-language-server-dev-nix = mkDevShellWithNixDeps ghcDefault "cabal.project";
346346
haskell-language-server-884-dev-nix = mkDevShellWithNixDeps ghc884 "cabal.project";
347347
haskell-language-server-8107-dev-nix = mkDevShellWithNixDeps ghc8107 "cabal.project";
348-
haskell-language-server-901-dev-nix = mkDevShellWithNixDeps ghc901 "cabal-ghc90.project";
349-
haskell-language-server-921-dev-nix = mkDevShellWithNixDeps ghc921 "cabal-ghc92.project";
348+
haskell-language-server-901-dev-nix = mkDevShellWithNixDeps ghc901 "cabal.project";
349+
haskell-language-server-921-dev-nix = mkDevShellWithNixDeps ghc921 "cabal.project";
350350
};
351351

352352
allPackages = {

hie-compat/hie-compat.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ library
2424
default-language: Haskell2010
2525
build-depends:
2626
base < 4.17, array, bytestring, containers, directory, filepath, transformers
27-
if flag(ghc-lib)
27+
if flag(ghc-lib) && impl(ghc < 9)
2828
build-depends: ghc-lib < 9.0
2929
else
3030
build-depends: ghc, ghc-boot

0 commit comments

Comments
 (0)