Skip to content

Add support for GHC 9-9.12#20

Merged
waddlaw merged 24 commits intowaddlaw:mainfrom
jimbob88:fix-ghc-9
Jan 1, 2025
Merged

Add support for GHC 9-9.12#20
waddlaw merged 24 commits intowaddlaw:mainfrom
jimbob88:fix-ghc-9

Conversation

@jimbob88
Copy link
Copy Markdown
Collaborator

@jimbob88 jimbob88 commented Dec 28, 2024

Adds support for ghc 9.12, 9.10, 9.8, 9.6 (and will start working on support for 9.2 and 9.4)

Test Results

Running cabal with ghc-9.12
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.12.1.0 supports
'ghc' version < 9.12): /home/user/.ghcup/bin/ghc-9.12 is version 9.12.1
Resolving dependencies...
Build profile: -w ghc-9.12.1 -O1
In order, the following will be built (use -v for more details):
 - haskell-stack-trace-plugin-0.1.3.0 (lib) (configuration changed)
 - haskell-stack-trace-plugin-0.1.3.0 (exe:example) (configuration changed)
Configuring library for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing library for haskell-stack-trace-plugin-0.1.3.0...
Building library for haskell-stack-trace-plugin-0.1.3.0...
Configuring executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Building executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
example: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:

fError

HasCallStack backtrace:
  error, called at example/Main.hs:47:10 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  fError, called at example/Main.hs:43:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f10, called at example/Main.hs:40:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f9, called at example/Main.hs:37:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f8, called at example/Main.hs:33:16 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f7, called at example/Main.hs:29:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f6, called at example/Main.hs:25:15 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f5, called at example/Main.hs:21:8 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f4, called at example/Main.hs:17:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f3, called at example/Main.hs:13:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f2, called at example/Main.hs:10:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f1, called at example/Main.hs:7:14 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  main, called at example/Main.hs:7:1 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main

Running cabal with ghc-9.10
Resolving dependencies...
Build profile: -w ghc-9.10.1 -O1
In order, the following will be built (use -v for more details):
 - haskell-stack-trace-plugin-0.1.3.0 (lib) (configuration changed)
 - haskell-stack-trace-plugin-0.1.3.0 (exe:example) (configuration changed)
Configuring library for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing library for haskell-stack-trace-plugin-0.1.3.0...
Building library for haskell-stack-trace-plugin-0.1.3.0...
Configuring executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Building executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
example: fError
CallStack (from HasCallStack):
  error, called at example/Main.hs:47:10 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  fError, called at example/Main.hs:43:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f10, called at example/Main.hs:40:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f9, called at example/Main.hs:37:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f8, called at example/Main.hs:33:16 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f7, called at example/Main.hs:29:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f6, called at example/Main.hs:25:15 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f5, called at example/Main.hs:21:8 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f4, called at example/Main.hs:17:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f3, called at example/Main.hs:13:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f2, called at example/Main.hs:10:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f1, called at example/Main.hs:7:14 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  main, called at example/Main.hs:7:1 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
HasCallStack backtrace:
  collectBacktraces, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:92:13 in ghc-internal:GHC.Internal.Exception
  toExceptionWithBacktrace, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:128:3 in ghc-internal:GHC.Internal.Exception


Running cabal with ghc-9.8
Resolving dependencies...
Build profile: -w ghc-9.8.4 -O1
In order, the following will be built (use -v for more details):
 - haskell-stack-trace-plugin-0.1.3.0 (lib) (configuration changed)
 - haskell-stack-trace-plugin-0.1.3.0 (exe:example) (configuration changed)
Configuring library for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing library for haskell-stack-trace-plugin-0.1.3.0...
Building library for haskell-stack-trace-plugin-0.1.3.0...
[1 of 1] Compiling StackTrace.Plugin ( src/StackTrace/Plugin.hs, /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.8.4/haskell-stack-trace-plugin-0.1.3.0/build/StackTrace/Plugin.o, /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.8.4/haskell-stack-trace-plugin-0.1.3.0/build/StackTrace/Plugin.dyn_o ) [Source file changed]
Configuring executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Building executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
[1 of 1] Compiling Main             ( example/Main.hs, /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.8.4/haskell-stack-trace-plugin-0.1.3.0/x/example/build/example/example-tmp/Main.o ) [/home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.8.4/haskell-stack-trace-plugin-0.1.3.0/build/libHShaskell-stack-trace-plugin-0.1.3.0-inplace-ghc9.8.4.so changed]

example/Main.hs:25:10: warning: [GHC-63394] [-Wx-partial]
    In the use of ‘head’
    (imported from Prelude, but defined in GHC.List):
    "This is a partial function, it throws an error on empty lists. Use pattern matching or Data.List.uncons instead. Consider refactoring to use Data.List.NonEmpty."
   |
25 | f5 _ _ = head f6
   |          ^^^^
[2 of 2] Linking /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.8.4/haskell-stack-trace-plugin-0.1.3.0/x/example/build/example/example [Objects changed]
example: fError
CallStack (from HasCallStack):
  error, called at example/Main.hs:47:10 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  fError, called at example/Main.hs:43:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f10, called at example/Main.hs:40:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f9, called at example/Main.hs:37:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f8, called at example/Main.hs:33:16 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f7, called at example/Main.hs:29:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f6, called at example/Main.hs:25:15 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f5, called at example/Main.hs:21:8 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f4, called at example/Main.hs:17:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f3, called at example/Main.hs:13:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f2, called at example/Main.hs:10:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f1, called at example/Main.hs:7:14 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  main, called at example/Main.hs:7:1 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
Running cabal with ghc-9.6
Resolving dependencies...
Build profile: -w ghc-9.6.6 -O1
In order, the following will be built (use -v for more details):
 - haskell-stack-trace-plugin-0.1.3.0 (lib) (configuration changed)
 - haskell-stack-trace-plugin-0.1.3.0 (exe:example) (configuration changed)
Configuring library for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing library for haskell-stack-trace-plugin-0.1.3.0...
Building library for haskell-stack-trace-plugin-0.1.3.0...
[1 of 1] Compiling StackTrace.Plugin ( src/StackTrace/Plugin.hs, /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.6.6/haskell-stack-trace-plugin-0.1.3.0/build/StackTrace/Plugin.o, /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.6.6/haskell-stack-trace-plugin-0.1.3.0/build/StackTrace/Plugin.dyn_o ) [Source file changed]
Configuring executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Building executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
[1 of 1] Compiling Main             ( example/Main.hs, /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.6.6/haskell-stack-trace-plugin-0.1.3.0/x/example/build/example/example-tmp/Main.o ) [/home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.6.6/haskell-stack-trace-plugin-0.1.3.0/build/libHShaskell-stack-trace-plugin-0.1.3.0-inplace-ghc9.6.6.so changed]
[2 of 2] Linking /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-9.6.6/haskell-stack-trace-plugin-0.1.3.0/x/example/build/example/example [Objects changed]
example: fError
CallStack (from HasCallStack):
  error, called at example/Main.hs:47:10 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  fError, called at example/Main.hs:43:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f10, called at example/Main.hs:40:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f9, called at example/Main.hs:37:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f8, called at example/Main.hs:33:16 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f7, called at example/Main.hs:29:11 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f6, called at example/Main.hs:25:15 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f5, called at example/Main.hs:21:8 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f4, called at example/Main.hs:17:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f3, called at example/Main.hs:13:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f2, called at example/Main.hs:10:6 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  f1, called at example/Main.hs:7:14 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
  main, called at example/Main.hs:7:1 in haskell-stack-trace-plugin-0.1.3.0-inplace-example:Main
Running cabal with ghc-8.10
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - haskell-stack-trace-plugin-0.1.3.0 (lib) (configuration changed)
 - haskell-stack-trace-plugin-0.1.3.0 (exe:example) (configuration changed)
Configuring library for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing library for haskell-stack-trace-plugin-0.1.3.0...
Building library for haskell-stack-trace-plugin-0.1.3.0...
[1 of 1] Compiling StackTrace.Plugin ( src/StackTrace/Plugin.hs, /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-8.10.7/haskell-stack-trace-plugin-0.1.3.0/build/StackTrace/Plugin.o, /home/user/Documents/Development/Haskell/haskell-stack-trace-plugin/dist-newstyle/build/x86_64-linux/ghc-8.10.7/haskell-stack-trace-plugin-0.1.3.0/build/StackTrace/Plugin.dyn_o )
Configuring executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Preprocessing executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
Building executable 'example' for haskell-stack-trace-plugin-0.1.3.0...
example: fError
CallStack (from HasCallStack):
  error, called at example/Main.hs:47:10 in main:Main
  fError, called at example/Main.hs:43:11 in main:Main
  f10, called at example/Main.hs:40:6 in main:Main
  f9, called at example/Main.hs:37:11 in main:Main
  f8, called at example/Main.hs:33:16 in main:Main
  f7, called at example/Main.hs:29:11 in main:Main
  f6, called at example/Main.hs:25:15 in main:Main
  f5, called at example/Main.hs:21:8 in main:Main
  f4, called at example/Main.hs:17:6 in main:Main
  f3, called at example/Main.hs:13:6 in main:Main
  f2, called at example/Main.hs:10:6 in main:Main
  f1, called at example/Main.hs:7:14 in main:Main
  main, called at example/Main.hs:7:1 in main:Main

@jimbob88
Copy link
Copy Markdown
Collaborator Author

Tested working on 9.4, still have fixes to make 9.2 and 9.0 working

@jimbob88 jimbob88 marked this pull request as draft December 28, 2024 22:27
@waddlaw waddlaw marked this pull request as ready for review January 1, 2025 12:44
@waddlaw waddlaw merged commit 72b3698 into waddlaw:main Jan 1, 2025
@waddlaw
Copy link
Copy Markdown
Owner

waddlaw commented Jan 1, 2025

@jimbob88 Thank you for the PR!

@jimbob88
Copy link
Copy Markdown
Collaborator Author

jimbob88 commented Jan 1, 2025

Hi, no problem! This extension was really useful to me. I predict 9.0 and 9.2 still will not work. There were some crazy changes to ghc at this time!

@waddlaw
Copy link
Copy Markdown
Owner

waddlaw commented Jan 1, 2025

Indeed, the CI is failing. Should we add support? (I wonder if anyone is actually using this version of GHC.)

@jimbob88
Copy link
Copy Markdown
Collaborator Author

jimbob88 commented Jan 1, 2025

Indeed, the CI is failing. Should we add support? (I wonder if anyone is actually using this version of GHC.)

I think it is worth supporting 9.4, should be relatively trivial. Currently working on getting CI working now. I hadn't tried running the same tests as the CI, a potential problem is the verbosity of 9.12 with the tests matching ghc output.

I do agree though about 9.0 and 9.2. I do not see much reason in supporting them (and they did some odd changes to the syntax tree, like wrapping quite a few things in Maybes).

@waddlaw
Copy link
Copy Markdown
Owner

waddlaw commented Jan 2, 2025

Then, shall we drop support for 9.0 and 9.2 and proceed with 9.4 if the cost of support is low? I’m also thinking of adding CI settings for 9.6 and later. (If the output changes in 9.12, it seems like preparing a new ghc.output specifically for 9.12 would be a good approach.)

Currently working on getting CI working now

Thank you. Are you currently working on the support for ghc-9.4?

@jimbob88 jimbob88 deleted the fix-ghc-9 branch January 2, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants