Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ghc 9.0.2 #2567

Merged
merged 50 commits into from Jan 17, 2022
Merged

Add support for ghc 9.0.2 #2567

merged 50 commits into from Jan 17, 2022

Conversation

jneira
Copy link
Member

@jneira jneira commented Jan 5, 2022

@@ -144,7 +147,7 @@ jobs:

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.0.1'
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what would happen if we did this unconditionally but set the test suite to not be buildable on GHC 9 🤔 might error, might just succeed...

Copy link
Member Author

@jneira jneira Jan 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm i think it is good to build it even if the tests are gonna fail, or it will rot even with compile errors.
We are building all the test suites (with tests: true) and cabal doesnt have runnable: false 😉

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fair.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative is mark them as ignored or broken for that hls version using tasty modifiers, but we are not using them that way for now

@fendor
Copy link
Collaborator

fendor commented Jan 6, 2022

There is no release of hie-bios with support for GHC 9.0.2 yet. Going to make one now.

@wz1000 wz1000 mentioned this pull request Jan 6, 2022
@wz1000
Copy link
Collaborator

wz1000 commented Jan 6, 2022

We don't need a whole new cabal.project for GHC 9.0.2. The one for 9.0.1 will suffice with a few small tweaks.

@pepeiborra
Copy link
Collaborator

Is there any way to avoid introducing a cabal-ghc902.project file? I see two reasonable options:

  • Keep it, and delete cabal-ghc901.project
  • Rename cabal-ghc901.project to cabal-ghc9.project and make it work for both

@thomasjm
Copy link

thomasjm commented Jan 10, 2022

Thanks for putting this together! FWIW I tried to build it with stack build --stack-yaml stack-9.0.2.yaml and it doesn't build.

I had to add unix to extra-deps, and then it hit errors building ghc-parser-ex, hie-bios, ormolu, and fourmolu. Also a GHC panic building primitive-unlifted. Logs

@jneira
Copy link
Member Author

jneira commented Jan 10, 2022

Thanks for putting this together! FWIW I tried to build it with stack build --stack-yaml stack-9.0.2.yaml and it doesn't build.

I had to add unix to extra-deps, and then it hit errors building ghc-parser-ex, hie-bios, ormolu, and fourmolu. Also a GHC panic building primitive-unlifted. Logs

thank for trying, circleci is asking unix too, will try to fix it asap

@jneira
Copy link
Member Author

jneira commented Jan 10, 2022

Is there any way to avoid introducing a cabal-ghc902.project file? I see two reasonable options:

* Keep it, and delete `cabal-ghc901.project`

* Rename `cabal-ghc901.project` to `cabal-ghc9.project` and make it work for both

i am for renaming to cabal-ghc9.project, there is a small chance of make the 9.0.1 build fail or fail in hackage due to 9.0.2 specific tweaks but i suppose is small enough to worth the deduplication

@jneira
Copy link
Member Author

jneira commented Jan 10, 2022

after adding unix ci reached the error commented by @thomasjm for primitive-unlifted:

primitive-unlifted                > [ 7 of 18] Compiling Data.Primitive.Unlifted.MVar.Primops
primitive-unlifted                > ghc: panic! (the 'impossible' happened)
primitive-unlifted                >   (GHC version 9.0.2:
primitive-unlifted                > 	findSlot
primitive-unlifted                >   Can't find slot
primitive-unlifted                >   [PtrUnliftedSlot]
primitive-unlifted                >   [PtrLiftedSlot]
primitive-unlifted                >   Call stack:
primitive-unlifted                >       CallStack (from HasCallStack):
primitive-unlifted                >         callStackDoc, called at compiler/GHC/Utils/Outputable.hs:1230:37 in ghc:GHC.Utils.Outputable
primitive-unlifted                >         pprPanic, called at compiler/GHC/Types/RepType.hs:217:9 in ghc:GHC.Types.RepType
primitive-unlifted                > 
primitive-unlifted                > Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

@jneira
Copy link
Member Author

jneira commented Jan 10, 2022

after adding unix ci reached the error commented by @thomasjm for primitive-unlifted:

issue in the ghc issue tracker: https://gitlab.haskell.org/ghc/ghc/-/issues/20908 😟

@wz1000
Copy link
Collaborator

wz1000 commented Jan 10, 2022

The solution is to use primitive-unlifted < 1.0

primitive-unflifted-1.0 does some shady things which aren't semantically valid.

@jneira
Copy link
Member Author

jneira commented Jan 10, 2022

The solution is to use primitive-unlifted < 1.0

thanks for the suggestion, it is not a direct dependency of hls so i guess it will be hard to make the hackage build works although we can force that version using cabal.project/stack.yaml

@wz1000
Copy link
Collaborator

wz1000 commented Jan 10, 2022

See nikita-volkov/primitive-extras#6

@jneira
Copy link
Member Author

jneira commented Jan 10, 2022

Ok we hit the hie-bios error with cabal:

 src/HIE/Bios/Ghc/Gap.hs:260:7: error:
Error:     • Couldn't match expected type ‘IncludeSpecs’
                  with actual type ‘[String] -> IncludeSpecs’
    • Probable cause: ‘IncludeSpecs’ is applied to too few arguments
      In the ‘includePaths’ field of a record
      In the expression:
        df
          {includePaths = IncludeSpecs
                            (map f $ G.includePathsQuote (includePaths df))
                            (map f $ G.includePathsGlobal (includePaths df))}
      In an equation for ‘mapOverIncludePaths’:
          mapOverIncludePaths f df
            = df
                {includePaths = IncludeSpecs
                                  (map f $ G.includePathsQuote (includePaths df))
                                  (map f $ G.includePathsGlobal (includePaths df))}
    |
260 |       G.IncludeSpecs
    |       ^^^^^^^^^^^^^^...

so we have to upgrade hie-bios

In stack we got another error, already pointed out by @thomasjm :

ghc-lib-parser-ex                 > /tmp/stack-bcedea5ffccdf320/ghc-lib-parser-ex-9.0.0.6/src/Language/Haskell/GhclibParserEx/GHC/Settings/Config.hs:18:1: error:
ghc-lib-parser-ex                 >     Could not load module ‘GHC.Platform’
ghc-lib-parser-ex                 >     It is a member of the hidden package ‘ghc-boot-9.0.2’.
ghc-lib-parser-ex                 >     Perhaps you need to add ‘ghc-boot’ to the build-depends in your .cabal file.
ghc-lib-parser-ex                 >     Use -v (or `:set -v` in ghci) to see a list of the files searched for.
ghc-lib-parser-ex                 >    |
ghc-lib-parser-ex                 > 18 | import GHC.Platform
ghc-lib-parser-ex                 >    | ^^^^^^^^^^^^^^^^^^^

We cant use 9.0.2 until all deps do not need allow-newer
And bump up index state to get lastest hie-bios
@jneira
Copy link
Member Author

jneira commented Jan 13, 2022

As expected the caching workflow was succesful: https://github.com/jneira/haskell-language-server/runs/4804786986?check_suite_focus=true

@jneira
Copy link
Member Author

jneira commented Jan 16, 2022

@michaelpj @Anton-Latukha I ve changed the caching workflow to build bench deps adding some comments (and in other workflow filed) hope it makes thing a little bit clearer

Copy link
Collaborator

@Anton-Latukha Anton-Latukha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was Ok with previous (pre 9.2.1 changes merge), & I am Ok with the recently mentioned caching changes.

@jneira
Copy link
Member Author

jneira commented Jan 16, 2022

The new caching workflow has been succesful here: https://github.com/jneira/haskell-language-server/actions/runs/1704688585

.github/workflows/build.yml Outdated Show resolved Hide resolved
@jneira jneira added the merge me Label to trigger pull request merge label Jan 16, 2022
@mergify mergify bot merged commit 3f46851 into haskell:master Jan 17, 2022
@jneira jneira mentioned this pull request Jan 24, 2022
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please, support GHC 9.0.2
7 participants