Skip to content

Friday fixes #44

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

Merged
merged 81 commits into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
83da033
Respect snippets configutation in CompletionItemResolve
lukel97 Oct 25, 2019
72d4ff6
Merge pull request #1424 from bubba/fix-1422
alanz Oct 26, 2019
10bba5a
Register rename and implementation provider
lukel97 Oct 27, 2019
6c0b7fa
Merge pull request #1427 from bubba/register-rename-implementation
lukel97 Oct 27, 2019
257eda5
Drop stack support for GHC 8.2.2
fendor Oct 29, 2019
4d748f5
Drop CPP directives guarding GHC 8.2.2 statements
fendor Oct 30, 2019
2d39a8d
Remove old hlint dependency from cabal file
fendor Oct 30, 2019
7cf1295
Drop CPP directives for GHC 8.2.2 in test folder
fendor Oct 30, 2019
2a6a188
Update LSP options for new haskell-lsp
lukel97 Nov 5, 2019
05220f2
Ignore the PATH fix if it is not set
jneira Nov 6, 2019
4cfe677
Catch IOException instead SomeException
jneira Nov 6, 2019
a1b2f8c
Make sure the liquid haskell test files are generated for unit-test
alanz Nov 6, 2019
e3fa438
Deal properly with increased GHC verbosity.
mpickering Nov 6, 2019
3bfd965
Add eventlog tracing for ghc-events-analyse
mpickering Nov 6, 2019
e0a30bf
typo fix
mpickering Nov 6, 2019
d109948
Remove mapFileFromVFS and some more refactoring in this area
mpickering Nov 6, 2019
e8b4bee
Fix version number back to 1.0
mpickering Nov 6, 2019
b0a01e7
Track changes to haskell-lsp
mpickering Nov 6, 2019
0bbec7d
Merge pull request #1438 from alanz/liquid-tests
alanz Nov 6, 2019
f581cd6
Catch the specific IOException in the getEnv error handler
jneira Nov 7, 2019
b089c8b
Remove unused language extension
jneira Nov 7, 2019
c253cbb
Merge pull request #1437 from jneira/ignore-unset-path
jneira Nov 7, 2019
9fc2dcc
Revert "Track changes to haskell-lsp"
mpickering Nov 7, 2019
73fcf4b
Some documentation
mpickering Nov 7, 2019
702a5f5
Fix profiling docs
mpickering Nov 7, 2019
1ca4e0a
docs typo
mpickering Nov 7, 2019
7a9b563
Adapt liquid haskell tests for version 0.8.6.2
alanz Nov 7, 2019
d228c02
modifyModuleCache rather than setModuleCache
mpickering Nov 8, 2019
523da4d
Revert "Revert "Track changes to haskell-lsp""
mpickering Nov 8, 2019
dc8dab1
Fix module cache
mpickering Nov 8, 2019
d646605
Make sure test dispatcher runs in a clean environment
alanz Nov 9, 2019
acf6c96
Generalise flushing stack environment for tests
alanz Nov 9, 2019
bfb1632
Call flushStackEnvironment before starting a lsp-test session
alanz Nov 9, 2019
0e6742d
Disbale some logging
alanz Nov 9, 2019
98acf41
Merge pull request #1440 from alanz/liquid-tests-0.8.6.2
alanz Nov 9, 2019
865ef78
Add process dep to unit-test
jneira Nov 11, 2019
8d1e590
Unit test over the liquid haskell supported version
jneira Nov 11, 2019
60fae44
Merge pull request #1449 from jneira/test-liquid-version
jneira Nov 11, 2019
6a8f89c
Use explicit list of ghc supported versions
jneira Nov 12, 2019
78fdd5b
Add lastest, change default to it add warn about build-all
jneira Nov 12, 2019
0e2646b
Fix getGhcPathOf for windows
jneira Nov 13, 2019
16be8e7
Sort installed ghcs to fix the lastest target
jneira Nov 13, 2019
bb61dd1
Fix error in splitPaths
jneira Nov 13, 2019
9e70be8
Fix ghc version used to install hie
jneira Nov 13, 2019
36fa815
Formatting options list of cabal build
jneira Nov 13, 2019
6831562
Merge branch 'improve-install' of https://github.com/jneira/haskell-i…
jneira Nov 14, 2019
6e0cf21
Use cabal options consistently
jneira Nov 14, 2019
bf7d4b4
Update documentation about build system
jneira Nov 14, 2019
8e909e8
Mention cabal issue about set custom project file
jneira Nov 14, 2019
0f72de0
Use TargetDescription to print targets
jneira Nov 14, 2019
2140a5a
Remove unnecessary catch over lookupEnv
jneira Nov 14, 2019
15cf8ad
Run stack-install-cabal in azure ci
jneira Nov 14, 2019
7d99319
Change macos STACK_ROOT to avoid permission issues
jneira Nov 14, 2019
6f18dca
Correct suggestion of lastest target
jneira Nov 14, 2019
1876ab5
replace last by lastest
jneira Nov 14, 2019
2c82368
Replace lastest by latest
jneira Nov 15, 2019
72de08b
Use v2 prefix intead new
jneira Nov 15, 2019
e270032
Rephrasing alternative to build-all
jneira Nov 15, 2019
118525d
Replace cabal command suffix and fix installing steps
jneira Nov 15, 2019
db23fa5
Correct typo
jneira Nov 15, 2019
27fb514
Use existing exe function from Shake
jneira Nov 15, 2019
c63d0be
Test build-latest target
jneira Nov 15, 2019
ab1dde8
Remove build-all target
jneira Nov 15, 2019
bb7c702
Bump haskell-lsp et al to 0.18.0.0
alanz Nov 15, 2019
41e4b2a
Merge pull request #1457 from alanz/haskell-lsp-0.18
alanz Nov 17, 2019
0ae6936
Use builtin splitSearchPath
jneira Nov 17, 2019
f37b987
Make clear requirements for cabal
jneira Nov 18, 2019
e839e89
Update README.md
flip111 Nov 18, 2019
81cebbe
Merge branch 'master' of https://github.com/haskell/haskell-ide-engin…
lukel97 Nov 18, 2019
b77dadc
last comma in the json object doesn't parse.
bChiquet Nov 19, 2019
f871712
Merge pull request #1463 from bChiquet/fix-json-comma
lukel97 Nov 19, 2019
756d51d
Use ghc versions from stack-*.yaml files
jneira Nov 19, 2019
cd27b1e
Correct per-os bashrc in win and macos
jneira Nov 19, 2019
d78dadb
Merge pull request #1461 from bubba/new-haskell-lsp-options
lukel97 Nov 19, 2019
6e0b7bf
Merge pull request #1452 from jneira/improve-install
jneira Nov 19, 2019
e9d3322
Add a comment about where to find docs for Core.Options
lukel97 Nov 19, 2019
d467264
Remove writeMTS
mpickering Nov 19, 2019
a0296ae
Merge remote-tracking branch 'upstream/master' into wip/friday-fixes
mpickering Nov 19, 2019
58c4019
Merge remote-tracking branch 'mpickering/hie-bios' into wip/friday-fixes
mpickering Nov 19, 2019
8c3c350
Fix HaRe submodule
mpickering Nov 19, 2019
4c5308b
Remove eventlog, by default, should add a way to turn this on with a …
mpickering Nov 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .azure/linux-installhs-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ jobs:
- bash: |
source .azure/linux.bashrc
stack install.hs help
displayName: Run help of `instal.hs`
displayName: Run help of `install.hs`
- bash: |
source .azure/linux.bashrc
stack install.hs stack-install-cabal
displayName: Run stack-install-cabal target of `install.hs`
- bash: |
source .azure/linux.bashrc
stack install.hs build-latest
displayName: Run build-latest target of `install.hs`
2 changes: 0 additions & 2 deletions .azure/linux-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:
YAML_FILE: stack-8.4.3.yaml
stack-8.4.2:
YAML_FILE: stack-8.4.2.yaml
stack-8.2.2:
YAML_FILE: stack-8.2.2.yaml
variables:
STACK_ROOT: /home/vsts/.stack
steps:
Expand Down
10 changes: 9 additions & 1 deletion .azure/macos-installhs-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ jobs:
- bash: |
source .azure/macos.bashrc
stack install.hs help
displayName: Run help of `instal.hs`
displayName: Run help of `install.hs`
- bash: |
source .azure/macos.bashrc
stack install.hs stack-install-cabal
displayName: Run stack-install-cabal target of `install.hs`
- bash: |
source .azure/macos.bashrc
stack install.hs build-latest
displayName: Run build-latest target of `install.hs`
4 changes: 1 addition & 3 deletions .azure/macos-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ jobs:
YAML_FILE: stack-8.4.3.yaml
stack-8.4.2:
YAML_FILE: stack-8.4.2.yaml
stack-8.2.2:
YAML_FILE: stack-8.2.2.yaml
variables:
STACK_ROOT: /Users/vsts/.stack
STACK_ROOT: $(Build.SourcesDirectory)/.stack
steps:
- task: CacheBeta@0
inputs:
Expand Down
10 changes: 9 additions & 1 deletion .azure/windows-installhs-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ jobs:
- bash: |
source .azure/windows.bashrc
stack install.hs help
displayName: Run help of `instal.hs`
displayName: Run help of `install.hs`
- bash: |
source .azure/windows.bashrc
stack install.hs stack-install-cabal
displayName: Run stack-install-cabal target of `install.hs`
- bash: |
source .azure/windows.bashrc
stack install.hs build-latest
displayName: Run build-latest target of `install.hs`
2 changes: 0 additions & 2 deletions .azure/windows-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
YAML_FILE: stack-8.4.3.yaml
stack-8.4.2:
YAML_FILE: stack-8.4.2.yaml
stack-8.2.2:
YAML_FILE: stack-8.2.2.yaml
variables:
STACK_ROOT: "C:\\sr"

Expand Down
16 changes: 0 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,6 @@ defaults: &defaults

version: 2
jobs:
ghc-8.0.2:
environment:
- STACK_FILE: "stack-8.0.2.yaml"
<<: *defaults

ghc-8.2.1:
environment:
- STACK_FILE: "stack-8.2.1.yaml"
<<: *defaults

ghc-8.2.2:
environment:
- STACK_FILE: "stack-8.2.2.yaml"
<<: *defaults

ghc-8.4.2:
environment:
- STACK_FILE: "stack-8.4.2.yaml"
Expand Down Expand Up @@ -199,7 +184,6 @@ workflows:
version: 2
multiple-ghcs:
jobs:
- ghc-8.2.2
- ghc-8.4.2
- ghc-8.4.3
- ghc-8.4.4
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

[submodule "submodules/HaRe"]
path = submodules/HaRe
url = https://github.com/wz1000/HaRe.git
url = https://github.com/alanz/HaRe.git

[submodule "submodules/cabal-helper"]
path = submodules/cabal-helper
Expand Down
41 changes: 27 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ sudo dnf install libicu-devel ncurses-devel

In order to avoid problems with long paths on Windows you can do the following:

1. Edit the group policy: set "Enable Win32 long paths" to "Enabled" (Works
1. In the `Local Group Policy Editor`: `Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Filesystem` set `Enable Win32 long paths` to `Enabled` (Works
only for Windows 10).

2. Clone the `haskell-ide-engine` to the root of your logical drive (e.g. to
Expand Down Expand Up @@ -216,7 +216,7 @@ cabal v2-run ./install.hs --project-file install/shake.project <target>

Running the script with cabal on windows requires a cabal version greater or equal to `3.0.0.0`.

Unfortunately, it is still required to have `stack` installed so that the install-script can locate the `local-bin` directory (on Linux `~/.local/bin`) and copy the `hie` binaries to `hie-x.y.z`, which is required for the `hie-wrapper` to function as expected.
Unfortunately, it is still required to have `stack` installed so that the install-script can locate the `local-bin` directory (on Linux `~/.local/bin`) and copy the `hie` binaries to `hie-x.y.z`, which is required for the `hie-wrapper` to function as expected. There are plans to remove this requirement and let users build hie only with one build tool or another.

For brevity, only the `stack`-based commands are presented in the following sections.

Expand Down Expand Up @@ -246,13 +246,12 @@ stack ./install.hs hie-8.4.4
stack ./install.hs build-data
```

The Haskell IDE Engine can also be built with `cabal new-build` instead of `stack build`.
The Haskell IDE Engine can also be built with `cabal v2-build` instead of `stack build`.
This has the advantage that you can decide how the GHC versions have been installed.
However, this approach does currently not work for windows due to a missing feature upstream.
To see what GHC versions are available, the command `stack install.hs cabal-ghcs` can be used.
It will list all GHC versions that are on the path and their respective installation directory.
If you think, this list is incomplete, you can try to modify the PATH variable, such that the executables can be found.
Note, that the targets `cabal-build`, `cabal-build-data` and `cabal-build-all` depend on the found GHC versions.
Note, that the targets `cabal-build` and `cabal-build-data` depend on the found GHC versions.
They install Haskell IDE Engine only for the found GHC versions.

An example output is:
Expand All @@ -274,12 +273,6 @@ stack install.hs cabal-hie-8.4.4
stack install.hs cabal-build-data
```

To install HIE for all GHC versions that are present on your system, use:

```bash
stack ./install.hs cabal-build-all
```

In general, targets that use `cabal` instead of `stack` are prefixed with `cabal-*` and are identical to their counterpart, except they do not install a GHC if it is missing but fail.

##### Multiple versions of HIE (optional)
Expand Down Expand Up @@ -503,7 +496,7 @@ Then issue `:CocConfig` and add the following to your Coc config file.
"initializationOptions": {
"languageServerHaskell": {
}
},
}
}
}
```
Expand Down Expand Up @@ -800,12 +793,32 @@ If you think `haskell-ide-engine` is using a lot of memory then the most useful
thing you can do is prepare a profile of the memory usage whilst you're using
the program.

1. Add `profiling: True` to the cabal.project file of `haskell-ide-engine
1. Add `profiling: True` to the cabal.project file of `haskell-ide-engine`
2. `cabal new-build hie`
3. (IMPORTANT) Add `profiling: True` to the `cabal.project` file of the project you want to profile.
4. Make a wrapper script which calls the `hie` you built in step 2 with the additional options `+RTS -hd -l-au`
5. Modify your editor settings to call this wrapper script instead of looking for `hie` on the path
6. Try using `h-i-e` as normal and then process the `*.eventlog` which will be created using `eventlog2html`.
6. Try using `h-i-e` as normal and then process the `*.eventlog` which will be created using [`eventlog2html`](http://hackage.haskell.org/package/eventlog2html).
7. Repeat the process again using different profiling options if you like.

#### Using `ghc-events-analyze`

`haskell-ide-engine` contains the necessary tracing functions to work with [`ghc-events-analyze`](http://www.well-typed.com/blog/2014/02/ghc-events-analyze/). Each
request which is made will emit an event to the eventlog when it starts and finishes. This way you
can see if there are any requests which are taking a long time to complete or are blocking.

1. Make sure that `hie` is linked with the `-eventlog` option. This can be achieved by adding the flag
to the `ghc-options` field in the cabal file.
2. Run `hie` as normal but with the addition of `+RTS -l`. This will produce an eventlog called `hie.eventlog`.
3. Run `ghc-events-analyze` on the `hie.eventlog` file to produce the rendered SVG. Warning, this might take a while and produce a big SVG file.

The default options for `ghc-events-analyze` will produce quite a wide chart which is difficult to view. You can try using less buckets in order
to make the chart quicker to generate and faster to render.

```
ghc-events-analyze hie.eventlog -b 100
```

This support is similar to the logging capabilities [built into GHC](https://www.haskell.org/ghc/blog/20190924-eventful-ghc.html).


1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ environment:
- GHCVER: 8.4.4
- GHCVER: 8.4.3
- GHCVER: 8.4.2
- GHCVER: 8.2.2
install:
- cmd: >-
git submodule update --init --recursive
Expand Down
25 changes: 11 additions & 14 deletions docs/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ The design of the build system has the following main goals:
- `stack`
- `git`
* is completely functional right after a simple `git clone` and after every `git pull`
* one-stop-shop for building and naming all executables required for using `hie` in IDEs.
* prevents certain build failures by either identifying a failed precondition (such as wrong `stack` version) or by performing the necessary steps so users can't forget them (such as invoking `git` to update submodules)


Expand All @@ -28,8 +27,9 @@ See the project's `README` for detailed information about installing `hie`.
The build script `install.hs` defines several targets using the `shake` build system. The targets are roughly:

* `hie-*`: builds and installs the `hie` binaries. Also renames the binaries to contain the correct version-number.
* `build`: builds and installs `hie` binaries for all supported `ghc` versions.
* `build-latest`: builds and installs `hie` for the latest available and supported `ghc` version.
* `build-data`: builds the hoogle-db required by `hie`
* `build`: builds and installs `hie` for the latest supported `ghc` version (like `build-latest`) and the hoogle-db (like `build-data`)
* `cabal-*`: execute the same task as the original target, but with `cabal` instead of `stack`

Each `stack-*.yaml` contains references to packages in the submodules. Calling `stack` with one of those causes the build to fail if the submodules have not been initialized already. The file `shake.yaml` solves this issue invoking the `git` binary itself to update the submodules. Moreover, it specifies the correct version of `shake` and is used for installing all run-time dependencies such as `cabal` and `hoogle` if necessary.
Expand All @@ -38,7 +38,7 @@ Each `stack-*.yaml` contains references to packages in the submodules. Calling `

`hie` depends on a correct environment in order to function properly:

* `cabal-install`: If no `cabal` executable can be found or has an outdated version, `cabal-install` is installed via `stack`.
* `cabal-install`: This dependency is required by `hie` to handle correctly projects that are not `stack` based (without `stack.yaml`). You can install an appropiate version using `stack` with the `stack-install-cabal` target.
* The `hoogle` database: `hoogle generate` needs to be called with the most-recent `hoogle` version.

### Steps to build `hie`
Expand All @@ -47,16 +47,15 @@ Installing `hie` is a multi-step process:

1. `git submodule sync && git submodule update --init`
2. `hoogle generate` (`hoogle>=5.0.17` to be safe)
3. ensure that `cabal-install` is installed in the correct version
4. `stack --stack-yaml=stack-<X>.yaml install` or `cabal new-install -w ghc-<X>`
5. rename `hie` binary to `hie-<X>` in `$HOME/.local/bin`, where `<X>` is the GHC version used
6. repeat step 4 and 5 for all desired GHC versions
3. `stack --stack-yaml=stack-<X>.yaml install` or `cabal v2-install -w ghc-<X>`
4. rename `hie` binary to `hie-<X>` in `$HOME/.local/bin`, where `<X>` is the GHC version used
5. repeat step 3 and 4 for all desired GHC versions

This ensures that a complete install is always possible after each `git pull` or a `git clone`.

#### Building `hie` with profiling support

To build `hie` with profiling enabled `cabal new-install` needs to be used instead of `stack`.
To build `hie` with profiling enabled `cabal v2-install` needs to be used instead of `stack`.

Configure `cabal` to enable profiling by setting `profiling: True` in `cabal.project.local` for all packages. If that file does not already exist, create it as follows:

Expand All @@ -71,7 +70,7 @@ Then `hie` can be compiled for a specific GHC version:

```bash
export GHCP=<path-to-ghc-binary>
cabal new-install exe:hie -w $GHCP \
cabal v2-install exe:hie -w $GHCP \
--write-ghc-environment-files=never --symlink-bindir=$HOME/.local/bin \
--overwrite-policy=always --reinstall
```
Expand All @@ -90,19 +89,17 @@ The final step is to configure the `hie` client to use a custom `hie-wrapper` sc
The `install.hs` script performs some checks to ensure that a correct installation is possible and provide meaningful error messages for known issues.

* `stack` needs to be up-to-date. Version `1.9.3` is required
* `cabal` needs to be up-to-date. Version `2.4.1.0` is required to *use* haskell-ide-engine until the pull request #1126 is merged. Unfortunately cabal version `3.0.0.0` is needed to *install* hie in windows systems but that inconsistence will be fixed by the mentioned pull request.
* `ghc-8.6.3` is broken on windows. Trying to install `hie-8.6.3` on windows is not possible.
* `cabal new-build` does not work on windows at the moment. All `cabal-*` targets exit with an error message about that.
* When the build fails, an error message, that suggests to remove `.stack-work` directory, is displayed.

### Tradeoffs

#### `stack` is a build dependency

Currently, it is not possible to build all `hie-*` executables automatically without `stack`, since the `install.hs` script is executed by `stack`.
Currently, `stack` is needed even if you run the script with `cabal` to get the path where install the binaries but there are plans to remove that dependency (see #1380).

We are open to suggestions of other build systems that honor the requirements above, but are executable without `stack`.

#### `install.hs` installs a GHC before running
#### run `install.hs` with `stack` installs a GHC before running

Before the code in `install.hs` can be executed, `stack` installs a `GHC`, depending on the `resolver` field in `shake.yaml`. This is necessary if `install.hs` should be completely functional right after a fresh `git clone` without further configuration.

Expand Down
18 changes: 8 additions & 10 deletions haskell-ide-engine.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: haskell-ide-engine
version: 0.13.0.0
version: 1.0.0.0
synopsis: Provide a common engine to power any Haskell IDE
description: Please see README.md
homepage: http://github.com/githubuser/haskell-ide-engine#readme
Expand Down Expand Up @@ -69,8 +69,8 @@ library
, gitrev >= 1.1
, haddock-api
, haddock-library
, haskell-lsp == 0.17.*
, haskell-lsp-types == 0.17.*
, haskell-lsp == 0.18.*
, haskell-lsp-types == 0.18.*
, haskell-src-exts
, hie-plugin-api
, hoogle >= 5.0.13
Expand Down Expand Up @@ -98,10 +98,7 @@ library
, hie-bios
, bytestring-trie
, unliftio
if impl(ghc < 8.4)
build-depends: hlint >= 2.0.11 && < 2.1.18
else
build-depends: hlint >= 2.2.2
, hlint >= 2.2.2

ghc-options: -Wall -Wredundant-constraints
if flag(pedantic)
Expand Down Expand Up @@ -203,11 +200,12 @@ test-suite unit-test
, free
, ghc
, haskell-ide-engine
, haskell-lsp-types == 0.17.*
, haskell-lsp-types == 0.18.*
, hie-test-utils
, hie-plugin-api
, hoogle > 5.0.11
, hspec
, process
, quickcheck-instances
, text
, unordered-containers
Expand Down Expand Up @@ -292,8 +290,8 @@ test-suite func-test
, filepath
, lsp-test >= 0.8.0.0
, haskell-ide-engine
, haskell-lsp-types == 0.17.*
, haskell-lsp == 0.17.*
, haskell-lsp-types == 0.18.*
, haskell-lsp == 0.18.*
, hie-test-utils
, hie-plugin-api
, hspec
Expand Down
Loading