From 2e9fbe391ff004c577fae316c850c6dc4198bfc8 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 07:11:34 +0800 Subject: [PATCH 01/11] Update cabal.project and shake-bench.cabal: remove obsolete flags and add source repository --- cabal.project | 9 ++++++--- shake-bench/shake-bench.cabal | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cabal.project b/cabal.project index 7e488eae8c..2e376688c2 100644 --- a/cabal.project +++ b/cabal.project @@ -49,9 +49,7 @@ constraints: -- in the future, thus: TODO: remove this flag. bitvec -simd, -if impl(ghc >= 9.9) - -- https://github.com/haskell/haskell-language-server/issues/4324 - benchmarks: False +-- https://github.com/haskell/haskell-language-server/issues/4324 if impl(ghc >= 9.8.4) && impl(ghc < 9.8.5) -- By depending on ghc-lib-parser and ghc, we are encountering @@ -62,3 +60,8 @@ if impl(ghc >= 9.8.4) && impl(ghc < 9.8.5) ghc-lib-parser:filepath constraints: ghc-lib-parser==9.8.4.20241130 + +source-repository-package + type: git + location: https://github.com/soulomoon/hp2pretty.git + tag: 2c794fb0ef8cfae3fa6fcdaa6797fa381207d48e diff --git a/shake-bench/shake-bench.cabal b/shake-bench/shake-bench.cabal index d5852a6310..eccd84edeb 100644 --- a/shake-bench/shake-bench.cabal +++ b/shake-bench/shake-bench.cabal @@ -16,8 +16,6 @@ source-repository head location: https://github.com/haskell/haskell-language-server.git library - if impl(ghc >= 9.10) - buildable: False exposed-modules: Development.Benchmark.Rules hs-source-dirs: src build-depends: From 4404a080cf0ca787698376e552b2492533ad0fd1 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 07:13:20 +0800 Subject: [PATCH 02/11] cabal.project: Add comment regarding specific hp2pretty version due to bug --- cabal.project | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index 2e376688c2..d21517e99e 100644 --- a/cabal.project +++ b/cabal.project @@ -49,7 +49,6 @@ constraints: -- in the future, thus: TODO: remove this flag. bitvec -simd, --- https://github.com/haskell/haskell-language-server/issues/4324 if impl(ghc >= 9.8.4) && impl(ghc < 9.8.5) -- By depending on ghc-lib-parser and ghc, we are encountering @@ -61,6 +60,8 @@ if impl(ghc >= 9.8.4) && impl(ghc < 9.8.5) constraints: ghc-lib-parser==9.8.4.20241130 +-- We need to use a specific version of hp2pretty because of a bug +-- https://github.com/haskell/haskell-language-server/issues/4324 source-repository-package type: git location: https://github.com/soulomoon/hp2pretty.git From c351c2bb8a552da352f67aa93e6c0ed3b43a5ebe Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 07:15:13 +0800 Subject: [PATCH 03/11] workflow: Update performance label condition for bench job skipping --- .github/workflows/bench.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 659352e4e6..9e778db607 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -17,7 +17,6 @@ on: jobs: pre_job: runs-on: ubuntu-latest - if: contains(github.event.pull_request.labels.*.name, 'performance') outputs: should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: @@ -40,7 +39,7 @@ jobs: ]' bench_init: - if: needs.pre_job.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' && contains(github.event.pull_request.labels.*.name, 'performance') needs: pre_job runs-on: ${{ matrix.os }} From 8fb39de173edba5212e75d0008fe535ab8e3131e Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 07:16:32 +0800 Subject: [PATCH 04/11] workflow: Adjust bench job conditions for performance label handling --- .github/workflows/bench.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 9e778db607..72778d92b4 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -39,7 +39,7 @@ jobs: ]' bench_init: - if: needs.pre_job.outputs.should_skip != 'true' && contains(github.event.pull_request.labels.*.name, 'performance') + if: needs.pre_job.outputs.should_skip != 'true' needs: pre_job runs-on: ${{ matrix.os }} @@ -114,6 +114,7 @@ jobs: path: ~/.cabal/cabal.tar.gz bench_example: + if: contains(github.event.pull_request.labels.*.name, 'performance') needs: [bench_init, pre_job] runs-on: ${{ matrix.os }} From 1723762d09b20dd62536eba78468ed062907c63a Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 07:18:28 +0800 Subject: [PATCH 05/11] workflow: Update GitHub Actions to use latest versions of actions and GHC --- .github/workflows/bench.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 72778d92b4..fe3e2e99d3 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -52,8 +52,8 @@ jobs: # see discussion https://github.com/haskell/haskell-language-server/pull/4118 # also possible to add more GHCs if we performs better in the future. ghc: - - '9.6' - '9.8' + - '9.10' os: - ubuntu-latest @@ -61,7 +61,7 @@ jobs: # change of the strategy may require changing the bootstrapping/run code steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # By default, the `pull_request` event has a `GITHUB_SHA` env variable @@ -100,14 +100,14 @@ jobs: tar -czf cabal.tar.gz * - name: Upload workspace - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: workspace-${{ matrix.ghc }}-${{ matrix.os }} retention-days: 1 path: workspace.tar.gz - name: Upload .cabal - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cabal-home-${{ matrix.ghc }}-${{ matrix.os }} retention-days: 1 @@ -134,13 +134,13 @@ jobs: enable-stack: false - name: Download cabal home - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cabal-home-${{ matrix.ghc }}-${{ matrix.os }} path: . - name: Download workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: workspace-${{ matrix.ghc }}-${{ matrix.os }} path: . @@ -165,7 +165,7 @@ jobs: run: find bench-results -name "*.csv" -or -name "*.svg" -or -name "*.html" | xargs tar -czf benchmark-artifacts.tar.gz - name: Archive benchmarking artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: bench-results-${{ matrix.example }}-${{ runner.os }}-${{ matrix.ghc }} path: benchmark-artifacts.tar.gz @@ -175,7 +175,7 @@ jobs: run: find bench-results -name "*.log" -or -name "*.hp" | xargs tar -czf benchmark-logs.tar.gz - name: Archive benchmark logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: bench-logs-${{ matrix.example }}-${{ runner.os }}-${{ matrix.ghc }} path: benchmark-logs.tar.gz From 8a1139cca8ac2ebefaf0c30f21c08322271511ee Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 20:50:32 +0800 Subject: [PATCH 06/11] Replace hp2pretty with eventlog2html in benchmark dependencies and heap profile rules --- haskell-language-server.cabal | 2 +- shake-bench/src/Development/Benchmark/Rules.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index dcbb546733..5f011472fb 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -2100,7 +2100,7 @@ benchmark benchmark hs-source-dirs: bench build-tool-depends: haskell-language-server:ghcide-bench, - hp2pretty:hp2pretty, + eventlog2html:eventlog2html, default-extensions: LambdaCase RecordWildCards diff --git a/shake-bench/src/Development/Benchmark/Rules.hs b/shake-bench/src/Development/Benchmark/Rules.hs index 98cfd717d2..81510b3101 100644 --- a/shake-bench/src/Development/Benchmark/Rules.hs +++ b/shake-bench/src/Development/Benchmark/Rules.hs @@ -535,7 +535,7 @@ heapProfileRules build = do build -/- "*/*/*/*/*.heap.svg" %> \out -> do let hpFile = dropExtension2 out <.> "hp" need [hpFile] - cmd_ ("hp2pretty" :: String) [hpFile] + cmd_ ("eventlog2html" :: String) ["--heap-profile", hpFile] liftIO $ renameFile (dropExtension hpFile <.> "svg") out dropExtension2 :: FilePath -> FilePath From 35d686fd72324979675ef16d8f55ce595787c2df Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 20:50:40 +0800 Subject: [PATCH 07/11] cabal.project: Remove hp2pretty source repository due to bug resolution --- cabal.project | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cabal.project b/cabal.project index d21517e99e..6111ff4ad6 100644 --- a/cabal.project +++ b/cabal.project @@ -60,9 +60,3 @@ if impl(ghc >= 9.8.4) && impl(ghc < 9.8.5) constraints: ghc-lib-parser==9.8.4.20241130 --- We need to use a specific version of hp2pretty because of a bug --- https://github.com/haskell/haskell-language-server/issues/4324 -source-repository-package - type: git - location: https://github.com/soulomoon/hp2pretty.git - tag: 2c794fb0ef8cfae3fa6fcdaa6797fa381207d48e From 48e452b878c5abbb80b699f49a114fa4aa87d6b1 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 20:51:34 +0800 Subject: [PATCH 08/11] cabal.project: Remove unnecessary newline in constraints section --- cabal.project | 1 - 1 file changed, 1 deletion(-) diff --git a/cabal.project b/cabal.project index 6111ff4ad6..d63c47ff99 100644 --- a/cabal.project +++ b/cabal.project @@ -59,4 +59,3 @@ if impl(ghc >= 9.8.4) && impl(ghc < 9.8.5) ghc-lib-parser:filepath constraints: ghc-lib-parser==9.8.4.20241130 - From 89422d5df1834a7bf0cfbc6e4fb0970cd394a18e Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 7 Mar 2025 22:26:09 +0800 Subject: [PATCH 09/11] workflow: Downgrade download-artifact action to v3 for compatibility --- .github/workflows/bench.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index fe3e2e99d3..27df32048b 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -134,7 +134,7 @@ jobs: enable-stack: false - name: Download cabal home - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: cabal-home-${{ matrix.ghc }}-${{ matrix.os }} path: . From 25c1fc1822f030f1d895c6ca95c88f550c21785d Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 8 Mar 2025 22:19:15 +0800 Subject: [PATCH 10/11] workflow: Upgrade download-artifact action to v4 for improved functionality --- .github/workflows/bench.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 27df32048b..fe3e2e99d3 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -134,7 +134,7 @@ jobs: enable-stack: false - name: Download cabal home - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cabal-home-${{ matrix.ghc }}-${{ matrix.os }} path: . From 38567f6f11b565fd7e68a51d63ad398d5e3803b5 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 9 Mar 2025 00:10:00 +0800 Subject: [PATCH 11/11] workflow: Update GHC version matrix to include 9.10 --- .github/workflows/bench.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index fe3e2e99d3..cb345c806e 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -121,7 +121,7 @@ jobs: strategy: fail-fast: false matrix: - ghc: ['9.6', '9.8'] + ghc: ['9.8', '9.10'] os: [ubuntu-latest] cabal: ['3.10'] example: ['cabal', 'lsp-types']