From dfca9bfb39485d7302aea7911f8c37a6894f5cde Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Mon, 21 Mar 2022 18:19:25 +0100 Subject: [PATCH] Target GHC 9.2.2 (#2787) * Target GHC 9.2.2 * fix with-compiler * attempt to fix Mac build * attempt to fix stack * Apply @July541 suggestion * add missing space * fix yaml * another yaml fix --- .circleci/config.yml | 8 ++++--- .github/workflows/caching.yml | 5 +++- .github/workflows/flags.yml | 4 ++-- .github/workflows/test.yml | 23 +++++++++++-------- .gitlab-ci.yml | 8 ++++++- bindist/ghcs | 2 +- cabal-ghc921.project => cabal-ghc92.project | 2 +- .../Development/IDE/GHC/Compat/Outputable.hs | 2 +- haskell-language-server.cabal | 2 +- .../test/Main.hs | 2 +- stack-9.2.1.yaml => stack-9.2.yaml | 7 +++--- 11 files changed, 39 insertions(+), 26 deletions(-) rename cabal-ghc921.project => cabal-ghc92.project (99%) rename stack-9.2.1.yaml => stack-9.2.yaml (97%) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0f465db571..667700a982f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,9 +105,11 @@ jobs: - STACK_FILE: "stack-9.0.2.yaml" <<: *defaults - ghc-9.2.1: + ghc-9.2.2: environment: - - STACK_FILE: "stack-9.2.1.yaml" + # https://github.com/digital-asset/ghc-lib/issues/352 + - CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH" + - STACK_FILE: "stack-9.2.yaml" <<: *defaults ghc-default: @@ -126,5 +128,5 @@ workflows: - ghc-8.10.7 - ghc-9.0.1 - ghc-9.0.2 - - ghc-9.2.1 + - ghc-9.2.2 - ghc-default diff --git a/.github/workflows/caching.yml b/.github/workflows/caching.yml index 65ac74bf93a..3ae34145d8e 100644 --- a/.github/workflows/caching.yml +++ b/.github/workflows/caching.yml @@ -80,7 +80,7 @@ jobs: strategy: fail-fast: false matrix: - ghc: [ "9.2.1" + ghc: [ "9.2.2" , "9.0.2" , "9.0.1" , "8.10.7" @@ -116,6 +116,9 @@ jobs: run: | # repeating builds to workaround segfaults in windows and ghc-8.8.4 cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild + env: + # needed for GHC 9.2.2 https://github.com/digital-asset/ghc-lib/issues/352 + CPATH:"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi":$CPATH # We build ghcide with benchs and test enabled to include its dependencies in the cache # (including shake-bench) diff --git a/.github/workflows/flags.yml b/.github/workflows/flags.yml index 8a94f12311a..b914ba3b08a 100644 --- a/.github/workflows/flags.yml +++ b/.github/workflows/flags.yml @@ -44,7 +44,7 @@ jobs: strategy: fail-fast: true matrix: - ghc: [ "9.2.1" + ghc: [ "9.2.2" , "9.0.2" , "8.10.7" , "8.8.4" @@ -72,7 +72,7 @@ jobs: run: cabal v2-build ghcide --flags="ghc-patched-unboxed-bytecode test-exe executable bench-exe" # we have to clean up warnings for 9.0 and 9.2 before enable -WAll - - if: matrix.ghc != '9.0.2' && matrix.ghc != '9.2.1' + - if: matrix.ghc != '9.0.2' && matrix.ghc != '9.2.2' name: Build with pedantic (-WError) run: cabal v2-build --flags="pedantic" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 797d872d671..26466c49ac0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,7 @@ jobs: strategy: fail-fast: true matrix: - ghc: [ "9.2.1" + ghc: [ "9.2.2" , "9.0.2" , "9.0.1" , "8.10.7" @@ -71,7 +71,7 @@ jobs: include: # only test supported ghc major versions - os: ubuntu-latest - ghc: '9.2.1' + ghc: '9.2.2' test: true - os: ubuntu-latest ghc: '9.0.2' @@ -86,7 +86,7 @@ jobs: ghc: '8.6.5' test: true - os: windows-latest - ghc: '9.2.1' + ghc: '9.2.2' test: true - os: windows-latest ghc: '9.0.2' @@ -115,6 +115,9 @@ jobs: # repeating builds to workaround segfaults in windows and ghc-8.8.4 - name: Build + # needed for GHC 9.2.2 https://github.com/digital-asset/ghc-lib/issues/352 + env: + CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH" run: cabal build || cabal build || cabal build - name: Set test options @@ -159,7 +162,7 @@ jobs: HLS_WRAPPER_TEST_EXE: hls-wrapper run: cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper" || cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper" || cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper" - - if: matrix.test && matrix.ghc != '9.2.1' + - if: matrix.test && matrix.ghc != '9.2.2' name: Test hls-brittany-plugin run: cabal test hls-brittany-plugin --test-options="$TEST_OPTS" || cabal test hls-brittany-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-brittany-plugin --test-options="$TEST_OPTS" @@ -175,19 +178,19 @@ jobs: name: Test hls-pragmas-plugin run: cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" || cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.2.1' + - if: matrix.test && matrix.ghc != '9.2.2' name: Test hls-eval-plugin run: cabal test hls-eval-plugin --test-options="$TEST_OPTS" || cabal test hls-eval-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-eval-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.2.1' + - if: matrix.test && matrix.ghc != '9.2.2' name: Test hls-haddock-comments-plugin run: cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS" || cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.2.1' + - if: matrix.test && matrix.ghc != '9.2.2' name: Test hls-splice-plugin run: cabal test hls-splice-plugin --test-options="$TEST_OPTS" || cabal test hls-splice-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-splice-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.1' + - if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.2' name: Test hls-stylish-haskell-plugin run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" @@ -199,7 +202,7 @@ jobs: name: Test hls-fourmolu-plugin run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.2.1' + - if: matrix.test && matrix.ghc != '9.2.2' name: Test hls-tactics-plugin test suite run: cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="$TEST_OPTS" @@ -219,7 +222,7 @@ jobs: name: Test hls-rename-plugin test suite run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || cabal test hls-rename-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-rename-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.2.1' + - if: matrix.test && matrix.ghc != '9.2.2' name: Test hls-hlint-plugin test suite run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-hlint-plugin --test-options="$TEST_OPTS" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8fe44a866e2..54941d616fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ variables: CABAL_PROJECT: cabal.project - GHC_VERSION: 9.0.2 CABAL_PROJECT: cabal-ghc90.project - - GHC_VERSION: 9.2.1 + - GHC_VERSION: 9.2.2 CABAL_PROJECT: cabal-ghc921.project workflow: @@ -419,8 +419,10 @@ build-x86_64-darwin: ADD_CABAL_ARGS: "" before_script: - /bin/bash ./.gitlab/brew.sh autoconf automake coreutils make tree + # CPATH https://github.com/digital-asset/ghc-lib/issues/352 script: | export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH" + export CPATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH" /bin/bash ./.gitlab/ci.sh after_script: - rm -Rf /private/tmp/.brew_tmp @@ -469,6 +471,7 @@ build-aarch64-darwin: - export HOMEBREW_CHANGE_ARCH_TO_ARM=1 - arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree # C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592 + # CPATH https://github.com/digital-asset/ghc-lib/issues/352 script: | export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH" export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang @@ -477,6 +480,7 @@ build-aarch64-darwin: export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi" + export CPATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH" arch -arm64 /bin/bash ./.gitlab/ci.sh after_script: - rm -Rf /private/tmp/.brew_tmp @@ -505,9 +509,11 @@ test-aarch64-darwin: - export HOMEBREW_CHANGE_ARCH_TO_ARM=1 - arch -arm64 /bin/bash ./.gitlab/brew.sh make tree # C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592 + # CPATH https://github.com/digital-asset/ghc-lib/issues/352 script: | export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH" export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi" + export CPATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH" arch -arm64 /bin/bash ./.gitlab/test.sh after_script: - rm -Rf /private/tmp/.brew_tmp diff --git a/bindist/ghcs b/bindist/ghcs index f61eef13e68..c230e6d25e7 100644 --- a/bindist/ghcs +++ b/bindist/ghcs @@ -1,3 +1,3 @@ 8.10.7,cabal.project 9.0.2,cabal-ghc90.project -9.2.1,cabal-ghc921.project +9.2.1,cabal-ghc92.project diff --git a/cabal-ghc921.project b/cabal-ghc92.project similarity index 99% rename from cabal-ghc921.project rename to cabal-ghc92.project index b0e9ecad8aa..0bcf8357553 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc92.project @@ -29,7 +29,7 @@ packages: ./plugins/hls-selection-range-plugin ./plugins/hls-change-type-signature-plugin -with-compiler: ghc-9.2.1 +with-compiler: ghc-9.2.2 tests: true diff --git a/ghcide/src/Development/IDE/GHC/Compat/Outputable.hs b/ghcide/src/Development/IDE/GHC/Compat/Outputable.hs index e3a4ecabe28..57f3cc368c8 100644 --- a/ghcide/src/Development/IDE/GHC/Compat/Outputable.hs +++ b/ghcide/src/Development/IDE/GHC/Compat/Outputable.hs @@ -164,7 +164,7 @@ type PsError = ErrMsg mkPrintUnqualifiedDefault :: HscEnv -> GlobalRdrEnv -> PrintUnqualified mkPrintUnqualifiedDefault env = #if MIN_VERSION_ghc(9,2,0) - -- GHC 9.2.1 version + -- GHC 9.2 version -- mkPrintUnqualified :: UnitEnv -> GlobalRdrEnv -> PrintUnqualified mkPrintUnqualified (hsc_unit_env env) #else diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 525edcf081e..13bc2de7a06 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -14,7 +14,7 @@ copyright: The Haskell IDE Team license: Apache-2.0 license-file: LICENSE build-type: Simple -tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1 || == 9.0.2 || == 9.2.1 +tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.2 || == 9.2.2 extra-source-files: README.md ChangeLog.md diff --git a/plugins/hls-change-type-signature-plugin/test/Main.hs b/plugins/hls-change-type-signature-plugin/test/Main.hs index d3f3b72a5c3..e04a0d4944f 100644 --- a/plugins/hls-change-type-signature-plugin/test/Main.hs +++ b/plugins/hls-change-type-signature-plugin/test/Main.hs @@ -74,7 +74,7 @@ testRegexTwo = testGroup "Regex Two" [ where regex = errorMessageRegexes !! 1 --- test ghc-9.2.1 error message regex +-- test ghc-9.2 error message regex testRegex921One :: TestTree testRegex921One = testGroup "Regex One" [ regexTest "ghc921-error1.txt" regex True diff --git a/stack-9.2.1.yaml b/stack-9.2.yaml similarity index 97% rename from stack-9.2.1.yaml rename to stack-9.2.yaml index 0962522f7e6..36efddfd629 100644 --- a/stack-9.2.1.yaml +++ b/stack-9.2.yaml @@ -1,5 +1,5 @@ resolver: nightly-2022-01-14 -compiler: ghc-9.2.1 +compiler: ghc-9.2.2 packages: - . @@ -46,8 +46,8 @@ extra-deps: - floskell-0.10.6 - fourmolu-0.5.0.0 - ghc-exactprint-1.4.1 -- ghc-lib-9.2.1.20220109 -- ghc-lib-parser-9.2.1.20220109 +- ghc-lib-9.2.2.20220307 +- ghc-lib-parser-9.2.2.20220307 - ghc-lib-parser-ex-9.2.0.1 - heapsize-0.3.0.1 - hiedb-0.4.1.0 @@ -89,7 +89,6 @@ extra-deps: # boot libraries - Cabal-3.6.0.0 - directory-1.3.6.2 -- ghc-boot-9.2.1 - process-1.6.13.2 - time-1.11.1.1 - unix-2.7.2.2