Commit Graph

23 Commits

Author SHA1 Message Date
Akshay Mankar
73b02ef3f7
Fix nix developement shell (#3257)
Upgrade a few packages which needed upgrade and avoid building hiedb in
nix as it has a dependency on a package in this repository (hie-compat).
2022-10-07 13:19:53 +00:00
Berk Özkütük
468db6f2aa
Use nixpkgs variants of Sphinx packages (#3227)
This commit replaces manually specified `myst-parser` and `sphinx_rtd_theme`
packages with their counterparts already packaged on nixpkgs. With this
change, `poetry2nix` is no more used, therefore that is removed as well.
2022-09-27 10:16:14 +01:00
Guillaume Bouchard
88a1dbbbfb nix: fix nix environment
- Bumped nixpkgs, so that's a true GHC 9.4.2 and not 9.4.0, which was
  failing in cabal which because it was detecting <=9.4.1.
- Fixed GHC 9.4 overrides for dependencies
- Use the "default" GHC environment for tooling in the shell. Hence it
  rebuilds less.
- I introduced a flake for cabal-hashes, hence it can be updated
  automatically (with `nix flake update`) and hence we can use
  `callHackage` for any hackage package.
2022-09-16 10:35:01 +02:00
Kobayashi
255498147a
upgrade lsp to 1.5 (#3072)
* upgrade lsp to 1.5

* fix stack.yaml

* try fix tests

* disable verbose logging in ghcide

* fix more tests in ghcide

* fix floskell test

* disable debug log in func-test

* disable debug log in lsp itself

* Revert "disable debug log in func-test"

This reverts commit 1fd6658c77.

* remove unused import

* fix hls test utils

* upgrade lsp in nix

* fix func-tests

* Revert "fix func-tests"

This reverts commit 2ecd76d0ba.

* fix waitForDiagnosticsFromSourceWithTimeout

* use Null as dummy message in waitForDiagnosticsFromSourceWithTimeout

* simplify a test case

* add comment about lsp bad logs
2022-08-12 09:09:07 +00:00
cydparser
524ef15234
Bump Nix flake GHC 9.2.3 to 9.2.4 (#3081) 2022-08-08 15:26:15 +01:00
Matthieu Coudron
100b53a474
build(nix): ghc922 -> ghc923 (#3049)
* build(nix): ghc922 -> ghc923

bumped nixpkgs and add support for ghc923 (replacing ghc922)

* fixes

* fixing for ghc90?

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-07-20 16:59:54 +00:00
Matthieu Coudron
2e2b3f125f
build(nix): bumped gitignore dependency (#3048)
to avoid the issue specified at https://github.com/NixOS/nixpkgs/issues/179172
2022-07-18 17:26:17 +01:00
Kobayashi
771d8f44e6
unify pre-commit hook & update Gitpod config (#2991)
* update Gitpod config

* update nix shellHook & docs

* install pre-commit hook

* add kokobd as code owner to .gitpod.*

* add gen-hie to Gitpod

* add tools for doc

* remove .pre-commit-config.yaml from .gitignore

* set vscode formatter to stylish-haskell in Gitpod
2022-06-28 08:54:32 +00:00
Matthieu Coudron
140f9040ae
chore(nix): bump nixpkgs to prevent glibc issues (#2937) 2022-06-01 22:51:30 +01:00
Michael Peyton Jones
b1bf549915
nix update (#2892)
* Drop -haddock as ghc 8.10.7 fails to build ghc-lib with:

```
compiler/GHC/CmmToAsm/AArch64/CodeGen.hs:176:15: error:
2081
Error:     parse error on input {- | debugIsOn -}
2082
    |
2083
176 | ann doc instr {- | debugIsOn -} = ANN doc instr
2084
    |               ^^^^^^^^^^^^^^^^^
```

  # Please enter the commit message for your changes. Lines starting

* flake.lock: Update

Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/b7547d3eed6f32d06102ead8991ec52ab0a4f1a7' (2022-01-03)
  → 'github:edolstra/flake-compat/b4a34015c698c7793d592d66adbab377907a2be8' (2022-04-19)
• Updated input 'flake-utils':
    'github:numtide/flake-utils/997f7efcb746a9c140ce1f13c72263189225f482' (2021-08-20)
  → 'github:numtide/flake-utils/a4b154ebbdc88c8498a5c7b01589addc9e9cb678' (2022-04-11)
• Updated input 'gitignore':
    'github:hercules-ci/gitignore.nix/211907489e9f198594c0eb0ca9256a1949c9d412' (2021-01-26)
  → 'github:hercules-ci/gitignore.nix/bff2832ec341cf30acb3a4d3e2e7f1f7b590116a' (2022-03-05)
• Updated input 'hie-bios':
    'https://hackage.haskell.org/package/hie-bios-0.9.0/hie-bios-0.9.0.tar.gz?narHash=sha256-nd+FfUQVZNxJfKZkAWA3dF0JwRgXntL+1gGvyNHDbKc='
  → 'https://hackage.haskell.org/package/hie-bios-0.9.1/hie-bios-0.9.1.tar.gz?narHash=sha256-5RqspT27rb%2ftMBwrKr4VfSSbq0+c0LMNuaKlTun0Kkk='
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c473cc8714710179df205b153f4e9fa007107ff9' (2021-12-13)
  → 'github:NixOS/nixpkgs/ab83c5d70528f1edc7080dead3a5dee61797b3ff' (2022-04-24)
• Updated input 'pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/397f0713d007250a2c7a745e555fa16c5dc8cadb' (2021-06-29)
  → 'github:cachix/pre-commit-hooks.nix/e5e7b3b542e7f4f96967966a943d7e1c07558042' (2022-04-04)
• Updated input 'pre-commit-hooks/flake-utils':
    'github:numtide/flake-utils/74f7e4319258e287b0f9cb95426c9853b282730b' (2021-11-28)
  → 'github:numtide/flake-utils/3cecb5b042f7f209c56ffd8371b2711a290ec797' (2022-02-07)
• Updated input 'pre-commit-hooks/nixpkgs':
    'github:NixOS/nixpkgs/6f05cfdb1e78d36c0337516df674560e4b51c79b' (2022-01-01)
  → 'github:nixos/nixpkgs/77a7a4197740213879b9a1d2e1788c6c8ade4274' (2022-02-23)

* nix flake update & bump ghc921 -> ghc922
ghc921 is no longer available on Nix, see:
  https://github.com/NixOS/nixpkgs/pull/163426

* myst-parser: bump docutils version requirements

* fix devShells and packages default

* use ghc-exactprint 1.5.0 for ghc922

* ghc902: add flag hlint34 to nix

* macosx: add SSE-enabled ptr-poker dependency

* ghc902 requires ghc-lib-parser >= 9.2

* nix: ghcDefault supports HLS tweaks

* fix typo

* add support for pre-commit in mkDevShell

* fix typo

* add ptr-poker to nix shell

* add ghc-884 configuration tweaks

* fix stylish-haskell for ghc-884

* fix default ghc lookup

* ghc884: fixup brittany version to 0.13.1.2

* ghc884: fixup aeson version to 1.5.2.0

* ghc884: fixup ormolu/fourmolu

* add configuration tweak for ghc8107

* rename configuration-ghc-xxx.nix files

* update hackage index

* use current cabal/hackage to fetch ptr-poker in mkDevShell

* reinstate .pre-commit.yaml

* nix: temporary disable "build binaries" from the work flow

* nix: temporary disable builds and partially populate cachix

* nix: temporarily disable ghc 884 and 8107

* nix: temporarily disable nix develop run

* nix: re-enable ghc8107/ghc884 builds, disable "build all binaries"

* nix: noop push commit to test cachix

* nix: touch flake.nix, remove ghc 884

* nix: rm ghc 810, ghc88 + disableLibraryProfiling

* nix: build all binaries again

* Update flake.nix

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>

* Update flake.nix

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>

* Update flake.nix

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>

* revert change made on comment

* rm myst-parser.nix

* fix typo (thanks @guibou)

* explain why we disable library profiling with nix

* ghc922, disable "hls-hlint-plugin"

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Providence Salumu <Providence.Salumu@smunix.com>
Co-authored-by: Providence Salumu <smunix@users.noreply.github.com>
2022-05-13 10:09:51 +01:00
Michael Peyton Jones
e43a8b602f
Fix flake.lock (#2743) 2022-03-01 13:56:05 -05:00
Guillaume Bouchard
96ea854deb
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins

* nix: use current ghc for tools in the shell

Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.

This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.

* nix: disable shake-bench for ghc921

* nix: fix ghc 9.2 shell

* nix: explicit cabal project in devShell

Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.

* nix: remove special case for different ghc versions

* nix: move implicit-hie-cradle as a flake input

* nix: restore dev shell

This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.

When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.

Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:

- It won't try to build any dependency with nix. This mean that it won't
  benefit from nix caching, but on the other hand, it will perfectly
  match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
  was failing to build.

Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.

The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).

* nix: New entries which build all target at once

All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.

I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.

All packages and shells are now named with a unique package name
containing the GHC version.

* nix: Build all devShells and all binaries in CI

* nix: build HLS with dynamic linking

Related to #2668.

This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.

* nix; fix CI command

* nix: only build dev shell with nix packages for current GHC version

* Another tentative to fix the build

* fix: Eval and alternate number format works with ghc 9.2

* fix CI build

* ANother tentative fix
2022-02-16 12:24:22 +00:00
Guillaume Bouchard
ccce756e47
Move hackage back to flake.nix (#2652)
Apparently `flake-compat` does not work correctly with local flake.

Reported by @teto and @smunix in 2621.

Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
2022-01-29 13:41:54 +00:00
Kobayashi
310e6a4683
support selection range lsp feature (#2565)
* add selection range support

* add the whole import area as a selection step

* add selection range plugin to all project files

* merge type signature with value definition

* support ghc 9

* fix it for ghc-9.0

* remove unnecessary import

* reformat GhcIde.hs

* selection range: make it easier to understand

* selection range: improve error handling

* update lsp-types to 1.4.0.1

* add selection range to doc

* fix comment for findSelectionRangesByPositions

* remove a use of partial function

* update author & maintainer

* use foldlM1 instead of foldl1

* add testdata to cabal file

* update performace tips and log level

* update lsp-types in nix

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-01-24 13:13:56 +00:00
Guillaume Bouchard
6123268215
Flake ghc 92 (#2621)
* refactor(flake): Use a separate flake for hackage sources

This will be easier to update, and pass them as one dictionary.

* flake: support for GHC 9.2

I've naively copied most of the special cases for `GHC 9.0.1`.

- `nix develop .\#haskell-language-server-921` gives me a shell in
  which I'm able to `cabal build`
- `nix build .#haskell-language-server-921` builds HLS binary. I was
  able to use it in a proprietary codebase (by importing the flake) and
  it works fine.
- some plugins are disabled, `brittany`, `stylishhaskell`, `hlint`,
  `haddockComments`, `alternateNumberFormat`. I didn't fight too much to
  fix this because I'm not using them. I'll do an effort in the future
  to fix them.
- `nix develop .\#haskell-language-server-921-dev` does not starts, I
  need to investigate.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
2022-01-24 08:54:08 +00:00
Guillaume Bouchard
5dac6af4c2 Fix nix flake by explicit version for lsp-xxx packages
The nix flake was failing:

```
nix build .#haskell-language-server
```

Was failing because of bounds issue related to hackage `lsp`,
`lsp-types` and `lsp-test` projects.

I've bump theses version, introducing new flake input (so they can be
changed easily in the future) and now the build works.
2022-01-01 16:29:10 +01:00
Junyoung "Clare" Jang
11241379e0
Update flake to use fourmolu plugin in GHC 9 (#2482)
* Update nixpkgs to add fourmolu plugin to GHC 9

* Fix GHCIDE build in nix
2021-12-13 23:09:17 +00:00
Michael Peyton Jones
7f96754e4c
Fix the nix build
Bumped nixpkgs, removed some unnecessary overrides, added a few newly
needed ones.
2021-12-08 16:04:06 +00:00
Jade
384902c14a
Update nix flake (#2159)
* Update nix flake

Doing a nixpkgs update gains ghc 8.10.6 support.

lsp-types needed updating to satisfy bounds so I did that.

* Add ghc-lib-parser override required for ormolu

* Put the override in the right spot, oopsie

* Pass --print-build-logs to nix commands

* Fix tracy on darwin

* Remove the macOS hack since it got merged

* It appears this is actually ghc8107 by now

Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: Potato Hatsue <1793913507@qq.com>
2021-09-10 06:31:38 +02:00
Potato Hatsue
8d5e34706c
Update nix flake (#2065)
* Update nix flake

* Fix missing ghc-api-compat in hiedb

* unrelated: Update paths_ignore for #2063

Co-authored-by: Junyoung "Clare" Jang <jjc9310@gmail.com>
2021-08-05 21:38:19 +08:00
Avi Dessauer
f9042bf625
Fix nix flake (#2030)
* Fix nix flake

* Address review
2021-07-22 23:55:10 +00:00
Potato Hatsue
77af21ecea
Update nix to GHC 8.10.5 (#1991)
* Update nix to GHC 8.10.5

* Update hiedb 0.4.0
2021-07-02 00:57:50 +08:00
Potato Hatsue
9abf566e06
nix: refactor with flakes (#1827)
* nix: refactor with flakes

* Update github actions

* Make pre-commit-hooks/flake-utils follows flake-utils

* Update github actions

* Update github actions

* Support multi GHC versions

* Update github actions

* Copy postInstall from nixpkgs

* Remove invalid ghc865

* Update README

* Use nixpkgs-unstable

* Update README

* Add plugins automatically
2021-05-19 03:32:23 -04:00