Skip to content

Commit d4a58d3

Browse files
authored
Merge branch 'haskell:master' into master
2 parents 51df91d + b354202 commit d4a58d3

File tree

55 files changed

+374
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+374
-268
lines changed

.github/workflows/bench.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,18 @@ jobs:
2424
uses: fkirc/skip-duplicate-actions@v3.4.1
2525
with:
2626
cancel_others: false
27-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**.nix", "**/test/**", "flake.lock", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]'
27+
paths_ignore: '[ "**/docs/**"
28+
, "**.md"
29+
, "**/LICENSE"
30+
, ".circleci/**"
31+
, "install/**"
32+
, "**.nix"
33+
, "**/test/**"
34+
, "flake.lock"
35+
, "**/README.md"
36+
, "FUNDING.yml"
37+
, "**/stack*.yaml"
38+
]'
2839

2940
bench_init:
3041
if: needs.pre_job.outputs.should_skip != 'true'
@@ -74,6 +85,15 @@ jobs:
7485
INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-')
7586
echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV
7687
88+
- name: Form the package list ('cabal.project.freeze')
89+
continue-on-error: true
90+
run: |
91+
cabal v2-freeze
92+
echo ''
93+
echo 'Output:'
94+
echo ''
95+
cat 'cabal.project.freeze'
96+
7797
- name: Hackage sources cache
7898
uses: actions/cache@v2
7999
env:
@@ -84,12 +104,13 @@ jobs:
84104
restore-keys: ${{ env.cache-name }}-
85105

86106
- name: Compiled deps cache
107+
id: compiled-deps
87108
uses: actions/cache@v2
88109
env:
89110
cache-name: compiled-deps
90111
with:
91112
path: ${{ steps.HaskEnvSetup.outputs.cabal-store }}
92-
key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }}
113+
key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project.freeze') }}
93114
restore-keys: |
94115
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-
95116
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-

.github/workflows/build.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Builds
22

33
on:
4+
workflow_dispatch:
45
release:
56
types: [created]
67
push:
@@ -17,8 +18,17 @@ jobs:
1718
strategy:
1819
fail-fast: false
1920
matrix:
20-
ghc: ['9.0.1', '8.10.7', '8.10.6', '8.8.4', '8.6.5']
21-
os: [ubuntu-18.04, macOS-latest, windows-latest]
21+
ghc:
22+
[ "9.0.1"
23+
, '8.10.7'
24+
, "8.10.6"
25+
, "8.8.4"
26+
, "8.6.5"
27+
]
28+
os: [ "ubuntu-18.04"
29+
, "macOS-latest"
30+
, "windows-latest"
31+
]
2232
cabal: ['3.6']
2333

2434
steps:
@@ -43,7 +53,7 @@ jobs:
4353
echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local
4454
fi
4555
46-
- name: Use modified cabal.project for ghc9
56+
- name: (GHC 9.0) Use modified cabal.project for GHC 9.0
4757
if: ${{ matrix.ghc == '9.0.1' }}
4858
run: cp cabal-ghc901.project cabal.project
4959

@@ -55,36 +65,36 @@ jobs:
5565
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
5666
src/**/*.hs exe/*.hs
5767
58-
- name: Set some window specific things
68+
- name: (Windows) Platform specifics
5969
if: matrix.os == 'windows-latest'
6070
env:
6171
GHC_VER: ${{ matrix.ghc }}
6272
run: |
6373
echo "EXE_EXT=.exe" >> $GITHUB_ENV
6474
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
6575
66-
- name: Set some linux specific things
76+
- name: (Linux) Platform specifics
6777
if: matrix.os == 'ubuntu-18.04'
6878
env:
6979
GHC_VER: ${{ matrix.ghc }}
7080
run: |
7181
echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV
7282
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
7383
74-
- name: Set some macOs specific things
84+
- name: (macOS) Platform specifics
7585
if: matrix.os == 'macOS-latest'
7686
env:
7787
GHC_VER: ${{ matrix.ghc }}
7888
run: |
7989
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
8090
81-
- name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
91+
- name: (Windows, GHC 8.8.4) Workaround segfaults
8292
if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
8393
run: |
8494
echo "package floskell" >> cabal.project
8595
echo " ghc-options: -O0" >> cabal.project
8696
87-
- name: Build server
97+
- name: Build the server
8898
# Try building it twice in case of flakey builds on Windows
8999
run: |
90100
cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS || \
@@ -108,7 +118,7 @@ jobs:
108118
echo ::set-output name=extension::gz
109119
fi
110120
111-
- name: Upload server to release
121+
- name: (not check) Upload server to release
112122
if: ${{ !contains(github.ref_name, 'check') }}
113123
uses: actions/upload-release-asset@v1.0.2
114124
env:
@@ -125,11 +135,11 @@ jobs:
125135
name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
126136
path: ${{ steps.compress_server_binary.outputs.path }}
127137

128-
- name: Build wrapper
138+
- name: (GHC 8.10) Build the wrapper
129139
if: matrix.ghc == '8.10.7'
130140
run: cabal build --disable-tests exe:hls-wrapper -O2 $LINUX_CABAL_ARGS
131141

132-
- name: Compress wrapper binary
142+
- name: (GHC 8.10) Compress wrapper binary
133143
if: matrix.ghc == '8.10.7'
134144
id: compress_wrapper_binary
135145
run: |
@@ -148,7 +158,7 @@ jobs:
148158
echo ::set-output name=extension::gz
149159
fi
150160
151-
- name: Upload wrapper to the release
161+
- name: (GHC 8.10, not check) Upload wrapper to the release
152162
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }}
153163
uses: actions/upload-release-asset@v1.0.2
154164
env:
@@ -159,7 +169,7 @@ jobs:
159169
asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
160170
asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}}
161171

162-
- name: Upload wrapper to workflow artifacts
172+
- name: (GHC 8.10) Upload wrapper to workflow artifacts
163173
uses: actions/upload-artifact@v2
164174
if: matrix.ghc == '8.10.7'
165175
with:
@@ -182,7 +192,7 @@ jobs:
182192
-o src-dist/haskell-language-server.tar.gz \
183193
HEAD
184194
185-
- name: Upload source tarball to the release
195+
- name: (not check) Upload source tarball to the release
186196
if: ${{ !contains(github.ref_name, 'check') }}
187197
uses: actions/upload-release-asset@v1.0.2
188198
env:
@@ -206,7 +216,10 @@ jobs:
206216
runs-on: ubuntu-18.04
207217
strategy:
208218
matrix:
209-
os: [Linux, macOS, Windows]
219+
os: [ "Linux"
220+
, "macOS"
221+
, "Windows"
222+
]
210223
steps:
211224
- uses: actions/download-artifact@v2
212225

@@ -226,7 +239,7 @@ jobs:
226239
fi
227240
tar -czpf haskell-language-server.tar.gz *
228241
229-
- name: Upload binaries tarball to the release
242+
- name: (not check) Upload binaries tarball to the release
230243
if: ${{ !contains(github.ref_name, 'check') }}
231244
uses: actions/upload-release-asset@v1.0.2
232245
env:
@@ -255,7 +268,7 @@ jobs:
255268
# we clean up tags to match the release file names
256269
sed -i 's/\/.*)/)/g' SHA256SUMS
257270
258-
- name: Upload sha256sums to the release
271+
- name: (not check) Upload sha256sums to the release
259272
if: ${{ !contains(github.ref_name, 'check') }}
260273
uses: actions/upload-release-asset@v1.0.2
261274
env:

.github/workflows/caching.yml

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ concurrency:
2727
cancel-in-progress: true
2828

2929
on:
30+
workflow_dispatch:
3031
push:
3132
branches:
3233
- master
@@ -44,27 +45,29 @@ on:
4445
- cron: "25 2/8 * * *"
4546

4647
env:
47-
cabalBuild: "v2-build all --enable-tests --enable-benchmarks"
48+
cabalBuild: "v2-build all --enable-tests --enable-benchmarks --keep-going"
4849

4950
jobs:
5051

5152
pre_job:
5253
runs-on: ubuntu-latest
5354
outputs:
5455
should_skip: ${{ steps.skip_check.outputs.should_skip }}
55-
should_skip_ghcide: ${{ steps.skip_ghcide_check.outputs.should_skip }}
5656
steps:
5757
- id: skip_check
5858
uses: fkirc/skip-duplicate-actions@v3.4.1
5959
with:
6060
cancel_others: false
61-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**"]'
62-
# If we only change ghcide downstream packages we have not test ghcide itself
63-
- id: skip_ghcide_check
64-
uses: fkirc/skip-duplicate-actions@v3.4.1
65-
with:
66-
cancel_others: false
67-
paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
61+
paths_ignore: '["**/docs/**"
62+
, "**.md"
63+
, "**/LICENSE"
64+
, "install/**"
65+
, "**.nix"
66+
, "flake.lock"
67+
, "**/README.md"
68+
, "FUNDING.yml"
69+
, ".circleci/**"
70+
]'
6871

6972
caching:
7073
if: needs.pre_job.outputs.should_skip != 'true'
@@ -73,8 +76,16 @@ jobs:
7376
strategy:
7477
fail-fast: false
7578
matrix:
76-
ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"]
77-
os: [ubuntu-latest, macOS-latest, windows-latest]
79+
ghc: [ "9.0.1"
80+
, "8.10.7"
81+
, "8.10.6"
82+
, "8.8.4"
83+
, "8.6.5"
84+
]
85+
os: [ "ubuntu-latest"
86+
, "macOS-latest"
87+
, "windows-latest"
88+
]
7889
cabal: ['3.6']
7990

8091
steps:
@@ -100,7 +111,11 @@ jobs:
100111
- if: matrix.ghc == '9.0.1'
101112
name: (GHC 9.0.1) Use modified `cabal.project`
102113
run: |
103-
cp cabal-ghc901.project cabal.project
114+
# File has some protections preventing regular `rm`.
115+
# (most probably sticky bit is set on $HOME)
116+
# `&&` insures `rm -f` return is positive.
117+
# Many platforms also have `alias cp='cp -i'`.
118+
rm -f -v cabal.project && cp -v cabal-ghc901.project cabal.project
104119
- if: runner.os == 'Windows' && matrix.ghc == '8.8.4'
105120
name: (Windows,GHC 8.8) Modify `cabal.project` to workaround segfaults
106121
run: |
@@ -127,6 +142,15 @@ jobs:
127142
INDEX_STATE1=$(echo "$INDEX_STATE_ENTRY" | cut -d' ' -f2 | tr ':' '-')
128143
echo "INDEX_STATE=$INDEX_STATE1" >> $GITHUB_ENV
129144
145+
- name: Form the package list ('cabal.project.freeze')
146+
continue-on-error: true
147+
run: |
148+
cabal v2-freeze
149+
echo ''
150+
echo 'Output:'
151+
echo ''
152+
cat 'cabal.project.freeze'
153+
130154
# 2021-12-02: NOTE: Cabal Hackage source tree storage does not depend on OS or GHC really,
131155
# but can depend on `base`.
132156
# But this caching is happens only inside `master` for `master` purposes of compiling the deps
@@ -137,9 +161,11 @@ jobs:
137161
env:
138162
cache-name: hackage-sources
139163
with:
140-
path: ${{ env.CABAL_PKGS_DIR }}
141-
key: ${{ env.cache-name }}-${{ env.INDEX_STATE }}
142-
restore-keys: ${{ env.cache-name }}-
164+
path: ${{ env.CABAL_PKGS_DIR }}
165+
key: ${{ env.cache-name }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project.freeze') }}
166+
restore-keys: |
167+
${{ env.cache-name }}-${{ env.INDEX_STATE }}-
168+
${{ env.cache-name }}-
143169
144170
- name: Compiled deps cache
145171
id: compiled-deps
@@ -148,17 +174,17 @@ jobs:
148174
cache-name: compiled-deps
149175
with:
150176
path: ${{ steps.HaskEnvSetup.outputs.cabal-store }}
151-
key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }}
177+
key: ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project.freeze') }}
152178
restore-keys: |
153179
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-
154180
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
155181
${{ env.cache-name }}-${{ runner.os }}-
156182
157-
- if: (! steps.compiled-deps.outputs.cache-hit)
183+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
158184
run: |
159185
cabal update
160186
161-
- if: (! steps.compiled-deps.outputs.cache-hit)
187+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
162188
name: Download all sources
163189
run: |
164190
cabal $cabalBuild --only-download
@@ -168,8 +194,13 @@ jobs:
168194
# but to cache what can be cached, so step is fault tolerant & would always succseed.
169195
# 2021-12-11: NOTE: Building all targets, since
170196
# current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies`
171-
- if: (! steps.compiled-deps.outputs.cache-hit)
197+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
172198
name: Build all targets; try 3 times
173199
continue-on-error: true
174200
run: |
175201
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
202+
203+
# Despite the `continue-on-error: true` directive - CI does not ignore the return code of the last step
204+
- name: Workaround to CI platform
205+
run: |
206+
true

.github/workflows/hackage.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ concurrency:
66
cancel-in-progress: true
77

88
on:
9+
workflow_dispatch:
10+
inputs:
11+
upload-candidates:
12+
description: 'Whether packages should be uploaded'
13+
required: true
14+
default: 'true'
915
push:
1016
branches:
1117
- '*-hackage'
@@ -14,7 +20,7 @@ jobs:
1420
check-and-upload-tarballs:
1521
runs-on: ubuntu-latest
1622
strategy:
17-
fail-fast: ${{ !contains(github.ref_name, 'check') }}
23+
fail-fast: ${{ !contains(github.ref_name, 'check') && github.event.inputs.upload-candidates != 'true' }}
1824
matrix:
1925
package: ["hie-compat", "hls-graph", "shake-bench",
2026
"hls-plugin-api", "ghcide", "hls-test-utils",
@@ -28,7 +34,6 @@ jobs:
2834
"hls-call-hierarchy-plugin", "hls-alternate-number-format-plugin",
2935
"hls-qualify-imported-names-plugin",
3036
"haskell-language-server"]
31-
# Uncomment 9.0.1 when ghcide is buildable
3237
ghc: [ "9.0.1",
3338
"8.10.7",
3439
"8.8.4",
@@ -181,7 +186,7 @@ jobs:
181186
path: ${{ steps.generate-dist-tarball.outputs.path }}
182187

183188
upload-candidate:
184-
if: ${{ !contains(github.ref_name, 'check') }}
189+
if: ${{ !contains(github.ref_name, 'check') || github.event.inputs.name == 'true' }}
185190
needs: check-and-upload-tarballs
186191
runs-on: ubuntu-latest
187192
steps:

0 commit comments

Comments
 (0)