Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate all cabal.project files #2866

Merged
merged 12 commits into from
May 5, 2022
Merged
1 change: 1 addition & 0 deletions .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ runs:

- name: Form the package list ('cabal.project.freeze')
run: |
rm cabal.project.freeze || \
cabal v2-freeze && \
echo "" && \
echo 'Output:' && \
Expand Down
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ variables:
- GHC_VERSION: 8.10.7
CABAL_PROJECT: cabal.project
- GHC_VERSION: 9.0.2
CABAL_PROJECT: cabal-ghc90.project
CABAL_PROJECT: cabal.project
- GHC_VERSION: 9.2.2
CABAL_PROJECT: cabal-ghc92.project
CABAL_PROJECT: cabal.project
- GHC_VERSION: 9.2.1
CABAL_PROJECT: cabal-ghc92.project
CABAL_PROJECT: cabal.project

workflow:
rules:
Expand Down
6 changes: 3 additions & 3 deletions bindist/ghcs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
8.6.5,cabal.project
8.8.4,cabal.project
8.10.7,cabal.project
9.0.2,cabal-ghc90.project
9.2.1,cabal-ghc92.project
9.2.2,cabal-ghc92.project
9.0.2,cabal.project
9.2.1,cabal.project
9.2.2,cabal.project
2 changes: 1 addition & 1 deletion bindist/ghcs-FreeBSD
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
8.10.7,cabal.project
9.0.2,cabal-ghc90.project
9.0.2,cabal.project
6 changes: 3 additions & 3 deletions bindist/ghcs-Msys
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
8.10.7,cabal.project
9.0.2,cabal-ghc90.project
9.2.2,cabal-ghc92.project
9.2.1,cabal-ghc92.project
9.0.2,cabal.project
9.2.2,cabal.project
9.2.1,cabal.project
58 changes: 0 additions & 58 deletions cabal-ghc90.project

This file was deleted.

93 changes: 0 additions & 93 deletions cabal-ghc92.project

This file was deleted.

29 changes: 22 additions & 7 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,27 @@ write-ghc-environment-files: never
index-state: 2022-04-27T09:22:49Z

constraints:
hyphenation +embed,
-- remove this when hlint sets ghc-lib to true by default
-- https://github.com/ndmitchell/hlint/issues/1376
hlint +ghc-lib
hyphenation +embed,
-- remove this when hlint sets ghc-lib to true by default
-- https://github.com/ndmitchell/hlint/issues/1376
hlint +ghc-lib,
ghc-lib-parser-ex -auto,
stylish-haskell +ghc-lib

allow-newer:
-- for shake-bench
Chart-diagrams:diagrams-core,
SVGFonts:diagrams-core
-- ghc-9.2
----------
hiedb:base,
retrie:ghc-exactprint,

-- for brittany
-- https://github.com/lspitzner/multistate/pull/8
multistate:base,
-- https://github.com/lspitzner/data-tree-print/pull/3
data-tree-print:base,
-- https://github.com/lspitzner/butcher/pull/8
butcher:base,

-- for shake-bench
Chart:lens,
Chart-diagrams:lens,
36 changes: 0 additions & 36 deletions configuration-ghc-901.nix

This file was deleted.

51 changes: 0 additions & 51 deletions configuration-ghc-921.nix

This file was deleted.

2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ghcup compile hls -v 1.6.1.0 --ghc 8.10.7 --ghc 8.8.4

Use a different `cabal.project` for a GHC version:
```
ghcup compile hls -v 1.6.1.0 --ghc 9.2.1 --cabal-project cabal-ghc92.project
ghcup compile hls -v 1.6.1.0 --ghc 9.2.1 --cabal-project cabal.project
```

Check `ghcup compile hls --help` for a full list of compilation options.
Expand Down
14 changes: 1 addition & 13 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,10 @@ The easiest way to obtain a dynamically linked HLS binary is to build HLS locall
cabal update && cabal install :pkg:haskell-language-server
```

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:

```bash
cabal update && cabal install :pkg:haskell-language-server --project-file=cabal-ghc90.project
```

Or with `stack`:

```bash
stack install haskell-language-server --stack-yaml=stack-${ghcVersion}.yaml
stack install haskell-language-server
```

You also can leverage `ghcup compile hls`:
Expand All @@ -189,12 +183,6 @@ You also can leverage `ghcup compile hls`:
ghcup compile hls -v 1.6.1.0 --ghc 8.10.7
```

as it uses cabal underneath you might need to use a specific cabal.project for some ghc versions:

```bash
ghcup compile hls -v 1.6.1.0 --ghc 9.0.2 --cabal-project cabal-ghc90.project
```

### Preprocessors

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.
Expand Down
8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -336,17 +336,17 @@
haskell-language-server-dev = mkDevShell ghcDefault "cabal.project";
haskell-language-server-884-dev = mkDevShell ghc884 "cabal.project";
haskell-language-server-8107-dev = mkDevShell ghc8107 "cabal.project";
haskell-language-server-901-dev = mkDevShell ghc901 "cabal-ghc90.project";
haskell-language-server-921-dev = mkDevShell ghc921 "cabal-ghc92.project";
haskell-language-server-901-dev = mkDevShell ghc901 "cabal.project";
haskell-language-server-921-dev = mkDevShell ghc921 "cabal.project";
};

# Developement shell, haskell packages are also provided by nix
nixDevShells = {
haskell-language-server-dev-nix = mkDevShellWithNixDeps ghcDefault "cabal.project";
haskell-language-server-884-dev-nix = mkDevShellWithNixDeps ghc884 "cabal.project";
haskell-language-server-8107-dev-nix = mkDevShellWithNixDeps ghc8107 "cabal.project";
haskell-language-server-901-dev-nix = mkDevShellWithNixDeps ghc901 "cabal-ghc90.project";
haskell-language-server-921-dev-nix = mkDevShellWithNixDeps ghc921 "cabal-ghc92.project";
haskell-language-server-901-dev-nix = mkDevShellWithNixDeps ghc901 "cabal.project";
haskell-language-server-921-dev-nix = mkDevShellWithNixDeps ghc921 "cabal.project";
};

allPackages = {
Expand Down
2 changes: 1 addition & 1 deletion hie-compat/hie-compat.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ library
default-language: Haskell2010
build-depends:
base < 4.17, array, bytestring, containers, directory, filepath, transformers
if flag(ghc-lib)
if flag(ghc-lib) && impl(ghc < 9)
build-depends: ghc-lib < 9.0
else
build-depends: ghc, ghc-boot
Expand Down
Loading