Skip to content

Commit b4259b8

Browse files
committed
Merge branch 'master' into cata
2 parents cde1256 + aa4bd29 commit b4259b8

35 files changed

+491
-548
lines changed

.github/mergify.yml

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,9 @@
11
pull_request_rules:
2-
- actions:
3-
merge:
4-
strict: smart+fasttrack
5-
method: squash
6-
name: Automatically merge pull requests
7-
conditions:
8-
- status-success=bench-example (8.10.4, ubuntu-latest, Cabal-3.0.0.0)
9-
- status-success=bench-example (8.10.4, ubuntu-latest, lsp-types-1.0.0.1)
10-
# disabled (too slow, ~4h) until hie-bios >0.7.2 is released
11-
# - status-success=bench-example (8.10.4, ubuntu-latest, bench_example_HLS)
12-
13-
- status-success=nix (default, ubuntu-latest)
14-
- status-success=nix (default, macOS-latest)
15-
16-
- status-success=test (8.10.4, ubuntu-latest)
17-
- status-success=test (8.10.4, macOS-latest)
18-
- status-success=test (8.10.3, ubuntu-latest)
19-
- status-success=test (8.10.3, macOS-latest)
20-
- status-success=test (8.10.2, ubuntu-latest)
21-
- status-success=test (8.10.2, macOS-latest)
22-
- status-success=test (8.8.4, ubuntu-latest)
23-
- status-success=test (8.8.4, macOS-latest)
24-
- status-success=test (8.8.3, ubuntu-latest)
25-
- status-success=test (8.8.3, macOS-latest)
26-
- status-success=test (8.8.2, ubuntu-latest)
27-
- status-success=test (8.8.2, macOS-latest)
28-
- status-success=test (8.6.5, ubuntu-latest)
29-
- status-success=test (8.6.5, macOS-latest)
30-
- status-success=test (8.6.4, ubuntu-latest)
31-
- status-success=test (8.6.4, macOS-latest)
32-
- status-success=test (windows-latest, 8.10.4, true)
33-
- status-success=test (windows-latest, 8.10.3)
34-
- status-success=test (windows-latest, 8.6.5, true)
35-
- status-success=test (windows-latest, 8.10.2.2)
36-
# - status-success=test (windows-latest, 8.6.4)
37-
38-
- 'status-success=ci/circleci: ghc-8.10.4'
39-
- 'status-success=ci/circleci: ghc-8.10.3'
40-
- 'status-success=ci/circleci: ghc-8.10.2'
41-
- 'status-success=ci/circleci: ghc-8.8.4'
42-
- 'status-success=ci/circleci: ghc-8.8.3'
43-
- 'status-success=ci/circleci: ghc-8.8.2'
44-
- 'status-success=ci/circleci: ghc-8.6.5'
45-
- 'status-success=ci/circleci: ghc-8.6.4'
46-
- 'status-success=ci/circleci: ghc-default'
47-
48-
- label=merge me
49-
- '#approved-reviews-by>=1'
2+
- actions:
3+
merge:
4+
strict: smart+fasttrack
5+
method: squash
6+
name: Automatically merge pull requests
7+
conditions:
8+
- label=merge me
9+
- '#approved-reviews-by>=1'

.github/workflows/bench.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
# max-backjumps is increased as a temporary solution
5959
# for dependency resolution failure
6060
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
61-
run: cabal configure --enable-benchmarks --max-backjumps 10000
61+
run: cabal configure --enable-benchmarks --max-backjumps 12000
6262

6363
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
6464
name: Build

.github/workflows/nix.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches:
66
- '**'
7+
push:
8+
branches:
9+
- master
710

811
jobs:
912
pre_job:
@@ -17,14 +20,14 @@ jobs:
1720
cancel_others: true
1821
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**"]'
1922

20-
nix:
23+
# Enter the development shell and run `cabal build`
24+
develop:
2125
needs: pre_job
2226
runs-on: ${{ matrix.os }}
2327

2428
strategy:
2529
fail-fast: false
2630
matrix:
27-
ghc: ['default']
2831
os: [ubuntu-latest, macOS-latest]
2932

3033
steps:
@@ -33,13 +36,52 @@ jobs:
3336
with:
3437
submodules: true
3538
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
36-
uses: cachix/install-nix-action@v12
39+
uses: cachix/install-nix-action@v13
3740
with:
41+
install_url: https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install
42+
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
43+
extra_nix_config: |
44+
experimental-features = nix-command flakes
3845
nix_path: nixpkgs=channel:nixos-unstable
3946
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
40-
uses: cachix/cachix-action@v8
47+
uses: cachix/cachix-action@v10
4148
with:
4249
name: haskell-language-server
43-
authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
50+
# Disable pushing, we will do that in job `build`
51+
skipPush: true
4452
- if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
45-
run: nix-shell --argstr compiler ${{ matrix.ghc }} --run "cabal update && cabal build"
53+
run: |
54+
nix develop --command cabal update
55+
nix develop --command cabal build
56+
57+
# Build and then push HLS binaries with developmet shell to cachix
58+
# This job runs when PRs are merged to master, and should be excluded from branch protections
59+
build:
60+
runs-on: ${{ matrix.os }}
61+
if: ${{ github.repository_owner == 'haskell' && github.ref == 'refs/heads/master' }}
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
os: [ubuntu-latest, macOS-latest]
66+
67+
steps:
68+
- uses: actions/checkout@v2
69+
with:
70+
submodules: true
71+
- uses: cachix/install-nix-action@v13
72+
with:
73+
install_url: https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install
74+
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
75+
extra_nix_config: |
76+
experimental-features = nix-command flakes
77+
nix_path: nixpkgs=channel:nixos-unstable
78+
- uses: cachix/cachix-action@v10
79+
with:
80+
name: haskell-language-server
81+
authToken: ${{ secrets.HLS_CACHIX_AUTH_TOKEN }}
82+
- name: Push development shell
83+
run: nix develop --profile dev && cachix push haskell-language-server dev
84+
- name: Build and push binaries
85+
run: |
86+
nix build
87+
nix path-info --json | jq -r '.[].path' | cachix push haskell-language-server

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ test/testdata/**/hie.yaml
4141
# ghcide-bench
4242
*.identifierPosition
4343
/bench/example
44+
45+
# nix
46+
result
47+
result-doc

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ background](https://neilmitchell.blogspot.com/2020/01/one-haskell-ide-to-rule-th
7878
- [Using Cabal](#using-cabal)
7979
- [Using Stack](#using-stack)
8080
- [Using Nix](#using-nix)
81+
- [Flakes support](#flakes-support)
8182
- [Introduction tutorial](#introduction-tutorial)
8283
- [Test your hacked HLS in your editor](#test-your-hacked-hls-in-your-editor)
8384
- [Adding support for a new editor](#adding-support-for-a-new-editor)
@@ -807,8 +808,27 @@ $ cabal update
807808
$ cabal build
808809
```
809810

811+
##### Flakes support
812+
813+
If you are using nix 2.4 style command (enabled by `experimental-features = nix-command`),
814+
you can use `nix develop` instead of `nix-shell` to enter the development shell. To enter the shell with specific GHC versions:
815+
816+
* `nix develop` or `nix develop .#haskell-language-server-dev` - default GHC version
817+
* `nix develop .#haskell-language-server-8104-dev` - GHC 8.10.4
818+
* `nix develop .#haskell-language-server-884-dev` - GHC 8.8.4
819+
* `nix develop .#haskell-language-server-901-dev` - GHC 9.0.1
820+
810821
If you are looking for a Nix expression to create haskell-language-server binaries, see https://github.com/haskell/haskell-language-server/issues/122
811822

823+
To create binaries:
824+
825+
* `nix build` or `nix build .#haskell-language-server` - default GHC version
826+
* `nix build .#haskell-language-server-8104` - GHC 8.10.4
827+
* `nix build .#haskell-language-server-884` - GHC 8.8.4
828+
* `nix build .#haskell-language-server-901` - GHC 9.0.1
829+
830+
GHC 8.6.5 is not supported here because `nixpkgs-unstable` no longer maintains the corresponding packages set.
831+
812832
#### Introduction tutorial
813833

814834
Pepeiborra [wrote an tutorial](https://github.com/pepeiborra/hls-tutorial) on writing a plugin in HLS.

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ package *
3030

3131
write-ghc-environment-files: never
3232

33-
index-state: 2021-03-29T21:23:14Z
33+
index-state: 2021-05-21T05:01:41Z
3434

3535
allow-newer:
3636
active:base,

default.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is the compt layer of flakes: https://github.com/edolstra/flake-compat
2+
# See flake.nix for details
3+
(import (
4+
let
5+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
6+
in fetchTarball {
7+
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
8+
sha256 = lock.nodes.flake-compat.locked.narHash; }
9+
) {
10+
src = ./.;
11+
}).defaultNix

flake.lock

Lines changed: 101 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)