Skip to content

Commit 7c92fe2

Browse files
authored
Enable bench for 9.10 (#4512)
* Update cabal.project and shake-bench.cabal: remove obsolete flags and add source repository * cabal.project: Add comment regarding specific hp2pretty version due to bug * workflow: Update performance label condition for bench job skipping * workflow: Adjust bench job conditions for performance label handling * workflow: Update GitHub Actions to use latest versions of actions and GHC * Replace hp2pretty with eventlog2html in benchmark dependencies and heap profile rules * cabal.project: Remove hp2pretty source repository due to bug resolution * cabal.project: Remove unnecessary newline in constraints section * workflow: Downgrade download-artifact action to v3 for compatibility * workflow: Upgrade download-artifact action to v4 for improved functionality * workflow: Update GHC version matrix to include 9.10
1 parent 980c846 commit 7c92fe2

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

.github/workflows/bench.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ on:
1717
jobs:
1818
pre_job:
1919
runs-on: ubuntu-latest
20-
if: contains(github.event.pull_request.labels.*.name, 'performance')
2120
outputs:
2221
should_skip: ${{ steps.skip_check.outputs.should_skip }}
2322
steps:
@@ -53,16 +52,16 @@ jobs:
5352
# see discussion https://github.com/haskell/haskell-language-server/pull/4118
5453
# also possible to add more GHCs if we performs better in the future.
5554
ghc:
56-
- '9.6'
5755
- '9.8'
56+
- '9.10'
5857
os:
5958
- ubuntu-latest
6059

6160
# This code is fitted to the strategy: assumes Linux is used ... etc,
6261
# change of the strategy may require changing the bootstrapping/run code
6362

6463
steps:
65-
- uses: actions/checkout@v3
64+
- uses: actions/checkout@v4
6665
with:
6766

6867
# By default, the `pull_request` event has a `GITHUB_SHA` env variable
@@ -101,27 +100,28 @@ jobs:
101100
tar -czf cabal.tar.gz *
102101
103102
- name: Upload workspace
104-
uses: actions/upload-artifact@v3
103+
uses: actions/upload-artifact@v4
105104
with:
106105
name: workspace-${{ matrix.ghc }}-${{ matrix.os }}
107106
retention-days: 1
108107
path: workspace.tar.gz
109108

110109
- name: Upload .cabal
111-
uses: actions/upload-artifact@v3
110+
uses: actions/upload-artifact@v4
112111
with:
113112
name: cabal-home-${{ matrix.ghc }}-${{ matrix.os }}
114113
retention-days: 1
115114
path: ~/.cabal/cabal.tar.gz
116115

117116
bench_example:
117+
if: contains(github.event.pull_request.labels.*.name, 'performance')
118118
needs: [bench_init, pre_job]
119119
runs-on: ${{ matrix.os }}
120120

121121
strategy:
122122
fail-fast: false
123123
matrix:
124-
ghc: ['9.6', '9.8']
124+
ghc: ['9.8', '9.10']
125125
os: [ubuntu-latest]
126126
cabal: ['3.10']
127127
example: ['cabal', 'lsp-types']
@@ -134,13 +134,13 @@ jobs:
134134
enable-stack: false
135135

136136
- name: Download cabal home
137-
uses: actions/download-artifact@v3
137+
uses: actions/download-artifact@v4
138138
with:
139139
name: cabal-home-${{ matrix.ghc }}-${{ matrix.os }}
140140
path: .
141141

142142
- name: Download workspace
143-
uses: actions/download-artifact@v3
143+
uses: actions/download-artifact@v4
144144
with:
145145
name: workspace-${{ matrix.ghc }}-${{ matrix.os }}
146146
path: .
@@ -165,7 +165,7 @@ jobs:
165165
run: find bench-results -name "*.csv" -or -name "*.svg" -or -name "*.html" | xargs tar -czf benchmark-artifacts.tar.gz
166166

167167
- name: Archive benchmarking artifacts
168-
uses: actions/upload-artifact@v3
168+
uses: actions/upload-artifact@v4
169169
with:
170170
name: bench-results-${{ matrix.example }}-${{ runner.os }}-${{ matrix.ghc }}
171171
path: benchmark-artifacts.tar.gz
@@ -175,7 +175,7 @@ jobs:
175175
run: find bench-results -name "*.log" -or -name "*.hp" | xargs tar -czf benchmark-logs.tar.gz
176176

177177
- name: Archive benchmark logs
178-
uses: actions/upload-artifact@v3
178+
uses: actions/upload-artifact@v4
179179
with:
180180
name: bench-logs-${{ matrix.example }}-${{ runner.os }}-${{ matrix.ghc }}
181181
path: benchmark-logs.tar.gz

cabal.project

-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ constraints:
4949
-- in the future, thus: TODO: remove this flag.
5050
bitvec -simd,
5151

52-
if impl(ghc >= 9.9)
53-
-- https://github.com/haskell/haskell-language-server/issues/4324
54-
benchmarks: False
5552

5653
if impl(ghc >= 9.8.4) && impl(ghc < 9.8.5)
5754
-- By depending on ghc-lib-parser and ghc, we are encountering

haskell-language-server.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -2100,7 +2100,7 @@ benchmark benchmark
21002100
hs-source-dirs: bench
21012101
build-tool-depends:
21022102
haskell-language-server:ghcide-bench,
2103-
hp2pretty:hp2pretty,
2103+
eventlog2html:eventlog2html,
21042104
default-extensions:
21052105
LambdaCase
21062106
RecordWildCards

shake-bench/shake-bench.cabal

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ source-repository head
1616
location: https://github.com/haskell/haskell-language-server.git
1717

1818
library
19-
if impl(ghc >= 9.10)
20-
buildable: False
2119
exposed-modules: Development.Benchmark.Rules
2220
hs-source-dirs: src
2321
build-depends:

shake-bench/src/Development/Benchmark/Rules.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ heapProfileRules build = do
535535
build -/- "*/*/*/*/*.heap.svg" %> \out -> do
536536
let hpFile = dropExtension2 out <.> "hp"
537537
need [hpFile]
538-
cmd_ ("hp2pretty" :: String) [hpFile]
538+
cmd_ ("eventlog2html" :: String) ["--heap-profile", hpFile]
539539
liftIO $ renameFile (dropExtension hpFile <.> "svg") out
540540

541541
dropExtension2 :: FilePath -> FilePath

0 commit comments

Comments
 (0)