diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index bbdb366bbd..ea5bcdda9e 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -46,8 +46,11 @@ jobs: strategy: fail-fast: false matrix: - ghc: ['8.10.7', '9.2.5'] - os: [ubuntu-latest] + ghc: + - '8.10.7' + - '9.2.5' + os: + - ubuntu-latest # This code is fitted to the strategy: assumes Linux is used ... etc, # change of the strategy may require changing the bootstrapping/run code diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index a5f57d6ddd..5abedd5a26 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -54,8 +54,13 @@ jobs: pre_job: runs-on: ubuntu-latest outputs: + ghcs: ${{ steps.ghcs.outputs.ghcs }} should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: + # Need the repo checked out in order to read the file + - uses: actions/checkout@v3 + - id: ghcs + run: echo "ghcs=$(cat ./.github/workflows/supported-ghc-versions.json)" >> $GITHUB_OUTPUT - id: skip_check uses: fkirc/skip-duplicate-actions@v5.3.0 with: @@ -80,17 +85,11 @@ jobs: strategy: fail-fast: false matrix: - # This list of GHC (including the "exclude" list) versions must match - # to the list of GHC versions specified in 'test.yml' - ghc: [ "9.4.4" - , "9.2.5" - , "9.0.2" - , "8.10.7" - ] - os: [ "ubuntu-latest" - , "macOS-latest" - , "windows-latest" - ] + ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }} + os: + - ubuntu-latest + - macOS-latest + - windows-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/flags.yml b/.github/workflows/flags.yml index 775c4037ff..f9cde8910e 100644 --- a/.github/workflows/flags.yml +++ b/.github/workflows/flags.yml @@ -18,8 +18,13 @@ jobs: pre_job: runs-on: ubuntu-latest outputs: + ghcs: ${{ steps.ghcs.outputs.ghcs }} should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: + # Need the repo checked out in order to read the file + - uses: actions/checkout@v3 + - id: ghcs + run: echo "ghcs=$(cat ./.github/workflows/supported-ghc-versions.json)" >> $GITHUB_OUTPUT - id: skip_check uses: fkirc/skip-duplicate-actions@v5.3.0 with: @@ -44,12 +49,9 @@ jobs: strategy: fail-fast: true matrix: - ghc: [ "9.2.5" - , "9.0.2" - , "8.10.7" - ] - os: [ "ubuntu-latest" - ] + ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }} + os: + - ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/supported-ghc-versions.json b/.github/workflows/supported-ghc-versions.json new file mode 100644 index 0000000000..bee88eb5a7 --- /dev/null +++ b/.github/workflows/supported-ghc-versions.json @@ -0,0 +1 @@ +[ "9.4.4" , "9.2.5" , "9.0.2" , "8.10.7" ] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 112b548c15..43e03c3493 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,12 @@ jobs: outputs: should_skip: ${{ steps.skip_check.outputs.should_skip }} should_skip_ghcide: ${{ steps.skip_ghcide_check.outputs.should_skip }} + ghcs: ${{ steps.ghcs.outputs.ghcs }} steps: + # Need the repo checked out in order to read the file + - uses: actions/checkout@v3 + - id: ghcs + run: echo "ghcs=$(cat ./.github/workflows/supported-ghc-versions.json)" >> $GITHUB_OUTPUT - id: skip_check uses: fkirc/skip-duplicate-actions@v5.3.0 with: @@ -52,7 +57,8 @@ jobs: test: if: needs.pre_job.outputs.should_skip != 'true' - needs: pre_job + needs: + - pre_job runs-on: ${{ matrix.os }} strategy: fail-fast: true @@ -60,41 +66,17 @@ jobs: # **don't forget** # to update the ghc versions in 'caching.yml'. matrix: - ghc: [ "9.4.4" - , "9.2.5" - , "9.0.2" - , "8.10.7" - ] - os: [ "ubuntu-latest" - , "macOS-latest" - , "windows-latest" - ] - # Mark which GHC versions on which platform we want to test. + ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }} + os: + - ubuntu-latest + - macOS-latest + - windows-latest + # Mark which GHC versions on which platforms we want to test. include: - # only test supported ghc major versions - - os: ubuntu-latest - ghc: '9.4.4' - test: true - - os: ubuntu-latest - ghc: '9.2.5' - test: true - - os: ubuntu-latest - ghc: '9.0.2' - test: true + # Test all supported versions, but only on ubuntu and windows - os: ubuntu-latest - ghc: '8.10.7' - test: true - - os: windows-latest - ghc: '9.4.4' - test: true - - os: windows-latest - ghc: '9.2.5' - test: true - - os: windows-latest - ghc: '9.0.2' test: true - os: windows-latest - ghc: '8.10.7' test: true steps: diff --git a/plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs b/plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs index f9838b9f0b..89c07e55f1 100644 --- a/plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs +++ b/plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs @@ -20,6 +20,11 @@ {-# OPTIONS_GHC -Wno-orphans #-} +-- On 9.4 we get a new redundant constraint warning, but deleting the +-- constraint breaks the build on earlier versions. Rather than apply +-- lots of CPP, we just disable the warning until later. +{-# OPTIONS_GHC -Wno-redundant-constraints #-} + #ifdef HLINT_ON_GHC_LIB #define MIN_GHC_API_VERSION(x,y,z) MIN_VERSION_ghc_lib_parser(x,y,z) #else @@ -134,8 +139,11 @@ import Development.IDE.Spans.Pragmas (LineSplitTe lineSplitTextEdits, nextPragmaLine) import GHC.Generics (Generic) +#if MIN_VERSION_apply_refact(0,12,0) +#else import System.Environment (setEnv, unsetEnv) +#endif import Text.Regex.TDFA.Text () -- ---------------------------------------------------------------------