Skip to content

Commit

Permalink
Merge ghcide repository (replacing the submodule) (haskell#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Dec 29, 2020
2 parents 9ac127e + 80060b4 commit b2e6886
Show file tree
Hide file tree
Showing 168 changed files with 28,708 additions and 98 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Benchmark

on: [pull_request]
jobs:
bench:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
ghc: ['8.10.2', '8.8.4', '8.6.5']
os: [ubuntu-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- run: git fetch origin master # check the master branch for benchmarking
- uses: actions/setup-haskell@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2'
enable-stack: false

- name: Cache Cabal
uses: actions/cache@v2
with:
path: |
~/.cabal/packages
~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-bench

- run: cabal update

- run: cabal configure --enable-benchmarks

- name: Build
shell: bash
# Retry it three times to workaround compiler segfaults in windows
run: cabal build ghcide:benchHist || cabal build ghcide:benchHist || cabal build ghcide:benchHist

- name: Bench
shell: bash
# run the tests without parallelism, otherwise tasty will attempt to run
# all test cases simultaneously which causes way too many hls
# instances to be spun up for the poor github actions runner to handle
run: cabal bench ghcide:benchHist

- name: Display results
shell: bash
run: |
column -s, -t < ghcide/bench-results/results.csv | tee ghcide/bench-results/results.txt
- name: Archive benchmarking artifacts
uses: actions/upload-artifact@v2
with:
name: bench-results-${{ runner.os }}-${{ matrix.ghc }}
path: |
ghcide/bench-results/results.*
ghcide/bench-results/**/*.svg
3 changes: 1 addition & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Nix

on: [push, pull_request]
on: [pull_request]
jobs:
nix:
runs-on: ${{ matrix.os }}
Expand All @@ -21,6 +21,5 @@ jobs:
- uses: cachix/cachix-action@v8
with:
name: haskell-language-server
extraPullNames: haskell-ghcide
authToken: '${{ secrets.HLS_CACHIX_AUTH_TOKEN }}'
- run: nix-shell --argstr compiler ${{ matrix.ghc }} --run "cabal update && cabal build"
18 changes: 17 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Testing

on: [push, pull_request]
on: [pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
Expand All @@ -9,6 +9,7 @@ jobs:
matrix:
ghc: ["8.10.2", "8.10.1", "8.8.4", "8.8.3", "8.8.2", "8.6.5", "8.6.4"]
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc-lib: [false]
exclude:
- os: windows-latest
ghc: "8.10.2" # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
Expand All @@ -21,6 +22,10 @@ jobs:
include:
- os: windows-latest
ghc: "8.10.2.2" # only available for windows and choco
# one ghc-lib build
- os: ubuntu-latest
ghc: '8.10.1'
ghc-lib: true

steps:
- uses: actions/checkout@v2
Expand All @@ -32,6 +37,9 @@ jobs:
cabal-version: "3.2"
enable-stack: true

- run: ./fmt.sh
name: "HLint via ./fmt.sh"

- name: Cache Cabal
uses: actions/cache@v2
env:
Expand Down Expand Up @@ -61,7 +69,14 @@ jobs:
# Retry it three times to workaround compiler segfaults in windows
run: cabal build || cabal build || cabal build

- name: Test ghcide
if: ${{ !matrix.ghc-lib }}
shell: bash
# run the tests without parallelism to avoid running out of memory
run: cabal test ghcide --test-options="-j1 --rerun-update" || cabal test ghcide --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test ghcide --test-options="-j1 --rerun"

- name: Test func-test suite
if: ${{ !matrix.ghc-lib }}
shell: bash
env:
HLS_TEST_EXE: hls
Expand All @@ -72,6 +87,7 @@ jobs:
run: cabal test func-test --test-options="-j1 --rerun-update" || cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"

- name: Test wrapper-test suite
if: ${{ !matrix.ghc-lib }}
shell: bash
env:
HLS_TEST_EXE: hls
Expand Down
7 changes: 0 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,3 @@
# Commit git commit -m "Removed submodule <name>"
# Delete the now untracked submodule files
# rm -rf path_to_submodule
[submodule "ghcide"]
path = ghcide
# url = https://github.com/alanz/ghcide.git
# url = https://github.com/wz1000/ghcide.git
url = https://github.com/haskell/ghcide.git
# url = https://github.com/fendor/ghcide.git
# url = https://github.com/bubba/ghcide.git
17 changes: 15 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
packages:
./
./ghcide/hie-compat
./hie-compat
./shake-bench
./ghcide
./hls-plugin-api
./plugins/tactics
Expand All @@ -23,4 +24,16 @@ write-ghc-environment-files: never

index-state: 2020-12-13T11:31:58Z

allow-newer: data-tree-print:base
allow-newer:
active:base,
data-tree-print:base,
diagrams-contrib:base,
diagrams-core:base,
diagrams-lib:base,
diagrams-postscript:base,
diagrams-svg:base,
dual-tree:base,
force-layout:base,
monoid-extras:base,
statestack:base,
svg-builder:base
3 changes: 3 additions & 0 deletions fmt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -eou pipefail
curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s ghcide/src ghcide/exe ghcide/bench shake-bench/src ghcide/test/exe --with-group=extra --hint=ghcide/.hlint.yaml
1 change: 0 additions & 1 deletion ghcide
Submodule ghcide deleted from 6de5ac
39 changes: 39 additions & 0 deletions ghcide/.azure/linux-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
jobs:
- job: ghcide_stack_linux
timeoutInMinutes: 60
pool:
vmImage: 'ubuntu-latest'
variables:
STACK_ROOT: $(Pipeline.Workspace)/.stack
steps:
- checkout: self
- task: Cache@2
inputs:
key: stack-root-cache | $(Agent.OS) | $(Build.SourcesDirectory)/stack.yaml | $(Build.SourcesDirectory)/ghcide.cabal
path: $(STACK_ROOT)
cacheHitVar: STACK_ROOT_CACHE_RESTORED
displayName: "Cache stack root"
- task: Cache@2
inputs:
key: stack-work-cache | $(Agent.OS) | $(Build.SourcesDirectory)/stack.yaml | $(Build.SourcesDirectory)/ghcide.cabal
path: .stack-work
cacheHitVar: STACK_WORK_CACHE_RESTORED
displayName: "Cache stack work"
- bash: |
./fmt.sh
displayName: "HLint via ./fmt.sh"
- bash: |
sudo add-apt-repository ppa:hvr/ghc
sudo apt-get update
sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev cabal-install-3.2
if ! which stack >/dev/null 2>&1; then
curl -sSL https://get.haskellstack.org/ | sh
fi
mkdir -p $STACK_ROOT
displayName: 'Install Stack'
- bash: stack setup
displayName: 'stack setup'
- bash: cabal update # some tests use Cabal cradles
displayName: 'cabal update'
- bash: stack build --test --no-run-tests
displayName: 'stack build --test --no-run-tests'
41 changes: 41 additions & 0 deletions ghcide/.azure/windows-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
jobs:
- job: ghcide_stack_windows
timeoutInMinutes: 120
pool:
vmImage: 'windows-2019'
variables:
STACK_ROOT: "C:\\sr"
steps:
- checkout: self
- task: Cache@2
inputs:
key: stack-root-cache | $(Agent.OS) | $(Build.SourcesDirectory)/stack-windows.yaml | $(Build.SourcesDirectory)/ghcide.cabal
path: $(STACK_ROOT)
cacheHitVar: STACK_ROOT_CACHE_RESTORED
displayName: "Cache stack root"
- task: Cache@2
inputs:
key: stack-work-cache | $(Agent.OS) | $(Build.SourcesDirectory)/stack-windows.yaml | $(Build.SourcesDirectory)/ghcide.cabal
path: .stack-work
cacheHitVar: STACK_WORK_CACHE_RESTORED
displayName: "Cache stack work"
- bash: |
./fmt.sh
displayName: "HLint via ./fmt.sh"
- bash: |
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
unzip -o /usr/bin/stack.zip -d /usr/bin/
mkdir -p "$STACK_ROOT"
displayName: 'Install Stack'
- bash: stack setup --stack-yaml stack-windows.yaml
displayName: 'stack setup'
- bash: |
# Installing happy and alex standalone to avoid error "strip.exe: unable to rename ../*.exe; reason: File exists"
stack install happy --stack-yaml stack-windows.yaml
stack install alex --stack-yaml stack-windows.yaml
choco install -y cabal --version=$CABAL_VERSION
$(cygpath $ProgramData)/chocolatey/bin/RefreshEnv.cmd
# GHC 8.10.1 fails with ghc segfaults, using -fexternal-interpreter seems to make it working
# There are other transient errors like timeouts downloading from stackage so we retry 3 times
stack build --test --no-run-tests --stack-yaml stack-windows.yaml --ghc-options="-fexternal-interpreter" || stack build --test --no-run-tests --stack-yaml stack-windows.yaml --ghc-options="-fexternal-interpreter" || stack build --test --no-run-tests --stack-yaml stack-windows.yaml --ghc-options="-fexternal-interpreter"
displayName: 'stack build --test'
11 changes: 11 additions & 0 deletions ghcide/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://EditorConfig.org

root = true

[*]
end_of_line = LF
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
29 changes: 29 additions & 0 deletions ghcide/.ghci
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
:set -Wunused-binds -Wunused-imports -Worphans -Wunused-matches -Wincomplete-patterns

:set -XBangPatterns
:set -XDeriveFunctor
:set -XDeriveGeneric
:set -XGeneralizedNewtypeDeriving
:set -XLambdaCase
:set -XNamedFieldPuns
:set -XOverloadedStrings
:set -XRecordWildCards
:set -XScopedTypeVariables
:set -XStandaloneDeriving
:set -XTupleSections
:set -XTypeApplications
:set -XViewPatterns

:set -package=ghc
:set -ignore-package=ghc-lib-parser
:set -DGHC_STABLE
:set -Iinclude
:set -idist/build/autogen
:set -isrc
:set -isession-loader
:set -iexe

:set -isrc-ghc88
:set -idist-newstyle/build/x86_64-osx/ghc-8.8.3/ghcide-0.2.0/build/autogen

:load Main
18 changes: 18 additions & 0 deletions ghcide/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
dist/
.stack-work/
dist-newstyle/
cabal.project.local
*~
*.lock
/.tasty-rerun-log
.vscode
/.hlint-*
bench/example/
bench-results/
bench-temp/
.shake/
ghcide
ghcide-bench
ghcide-preprocessor
*.benchmark-gcStats
tags
Loading

0 comments on commit b2e6886

Please sign in to comment.