Skip to content

Commit

Permalink
Merge pull request #19 from commercialhaskell/ghc-9.8.1
Browse files Browse the repository at this point in the history
Futher changes on release of GHC 9.8.1
  • Loading branch information
mpilgrem authored Oct 11, 2023
2 parents 2f0a307 + f12036f commit e9e18f3
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 25 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- master
workflow_dispatch:

# As of 7 October 2023, ubuntu-latest and windows-latest come with Stack 2.13.1.
# macos-latest comes with Stack 2.9.3.
# As of 11 October 2023, ubuntu-latest and windows-latest come with
# Stack 2.13.1. macos-latest comes with Stack 2.9.3.

jobs:
tests:
Expand All @@ -28,6 +28,7 @@ jobs:
- stack-ghc-9.2.8.yaml
- stack-ghc-9.4.7.yaml
- stack-ghc-9.6.3.yaml
- stack-ghc-9.8.1.yaml
steps:
- name: Clone project
uses: actions/checkout@v3
Expand Down
14 changes: 8 additions & 6 deletions hi-file-parser.cabal
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.35.2.
-- This file has been generated from package.yaml by hpack version 0.36.0.
--
-- see: https://github.com/sol/hpack

name: hi-file-parser
version: 0.1.4.0
version: 0.1.5.0
synopsis: Parser for GHC's hi files
description: Please see the README on Github at <https://github.com/commercialhaskell/hi-file-parser/blob/master/README.md>
category: Development
Expand Down Expand Up @@ -39,10 +39,12 @@ extra-source-files:
test-files/iface/x64/ghc9027/X.hi
test-files/iface/x64/ghc9044/Main.hi
test-files/iface/x64/ghc9044/X.hi
test-files/iface/x64/ghc9045/Main.hi
test-files/iface/x64/ghc9045/X.hi
test-files/iface/x64/ghc9061/Main.hi
test-files/iface/x64/ghc9061/X.hi
test-files/iface/x64/ghc9047/Main.hi
test-files/iface/x64/ghc9047/X.hi
test-files/iface/x64/ghc9063/Main.hi
test-files/iface/x64/ghc9063/X.hi
test-files/iface/x64/ghc9081/Main.hi
test-files/iface/x64/ghc9081/X.hi

source-repository head
type: git
Expand Down
12 changes: 7 additions & 5 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: hi-file-parser
version: 0.1.4.0
version: 0.1.5.0
github: commercialhaskell/hi-file-parser
license: BSD3
author: Hussein Ait-Lahcen
Expand Down Expand Up @@ -28,10 +28,12 @@ extra-source-files:
- test-files/iface/x64/ghc9027/X.hi
- test-files/iface/x64/ghc9044/Main.hi
- test-files/iface/x64/ghc9044/X.hi
- test-files/iface/x64/ghc9045/Main.hi
- test-files/iface/x64/ghc9045/X.hi
- test-files/iface/x64/ghc9061/Main.hi
- test-files/iface/x64/ghc9061/X.hi
- test-files/iface/x64/ghc9047/Main.hi
- test-files/iface/x64/ghc9047/X.hi
- test-files/iface/x64/ghc9063/Main.hi
- test-files/iface/x64/ghc9063/X.hi
- test-files/iface/x64/ghc9081/Main.hi
- test-files/iface/x64/ghc9081/X.hi

# Metadata used when publishing your package
synopsis: Parser for GHC's hi files
Expand Down
8 changes: 4 additions & 4 deletions src/HiFileParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ data IfaceVersion
| V9001
| V9041
| V9045
| V9080
| V9081
deriving (Show,Eq,Ord,Enum)
-- careful, the Ord matters!

Expand Down Expand Up @@ -601,7 +601,7 @@ getInterfaceRecent version d = do

2 -> do
-- usg_file_path
file_path <- traceShow "File:" $ if version >= V9080
file_path <- traceShow "File:" $ if version >= V9081
then Text.unpack . Text.decodeUtf8 <$> getFastString
else getString
void $ traceShow "FP:" getFP' -- usg_file_hash
Expand Down Expand Up @@ -658,7 +658,7 @@ getInterface = do
traceGet ("Version: " ++ version)

let !ifaceVersion
| version >= "9080" = V9080
| version >= "9081" = V9081
| version >= "9045" = V9045
| version >= "9041" = V9041
| version >= "9001" = V9001
Expand Down Expand Up @@ -694,7 +694,7 @@ getInterface = do
void getPtr

case ifaceVersion of
V9080 -> getInterfaceRecent ifaceVersion dict
V9081 -> getInterfaceRecent ifaceVersion dict
V9045 -> getInterfaceRecent ifaceVersion dict
V9041 -> getInterfaceRecent ifaceVersion dict
V9001 -> getInterfaceRecent ifaceVersion dict
Expand Down
2 changes: 1 addition & 1 deletion stack-ghc-9.6.3.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# GHC 9.6.3
resolver: nightly-2023-10-04
resolver: nightly-2023-10-09
36 changes: 36 additions & 0 deletions stack-ghc-9.8.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is an experimental snapshot, to see if hi-file-parser can be built with
# GHC 9.8.1.

# GHC 9.8.1
resolver: ghc-9.8.1

packages:
- ansi-terminal-1.0@sha256:640ffecfd95471388d939fcacb57bdc0cef15f0457746c234a12cdd5a6c6d1e8,2706
- ansi-terminal-types-0.11.5@sha256:f78440dfd95c4509e88855ac7cc2d9566ddf956a92c1290404cac93ad1a1b00a,1482
- async-2.2.4@rev:4
- call-stack-0.4.0@sha256:ac44d2c00931dc20b01750da8c92ec443eb63a7231e8550188cb2ac2385f7feb,1200
- colour-2.3.6@sha256:ebdcbf15023958838a527e381ab3c3b1e99ed12d1b25efeb7feaa4ad8c37664a,2378
- hashable-1.4.3.0@sha256:f3bf68acfa0df7a064a378ef2cdcfeb55e6fb96100675f4c593556dcbf3d7194,4718
- haskell-lexer-1.1.1@sha256:4ce310678b7e56b51acb558c0233d2f71a3f3553f8a88e9b48c0bc68301f799b,1296
- hspec-2.11.6@sha256:3b06ca8422508e33d1cfefb9b263d459533b7ef1f1eb14941ea147da5eb377ad,1763
- hspec-core-2.11.6@sha256:4129e8e1d3d3a8a9feaf2f1d77d115b985c51dcae1a8d44917434fb790da1749,6814
- hspec-discover-2.11.6@sha256:a407a35ad79ddc992de3d52bb6d93fc2e1d8db6b30e78615d1211725ea92809a,2169
- hspec-expectations-0.8.4@sha256:4237f094a7931202ff57ac6475542b0b314b50a7024550e2b6eb87cfb0d4ff93,1702
- HUnit-1.6.2.0@sha256:1a79174e8af616117ad39464cac9de205ca923da6582825e97c10786fda933a4,1588
- microlens-0.4.13.1@sha256:0cd8a0da5fe1b5a5c327bb5296d30940dc9f92c169372939bfcecd3faee953d7,4642
- microlens-mtl-0.2.0.3@sha256:0ace1ba95677117219681fb9a8b08b3bf049ab5973eed14453b260aaf1feb582,1965
- primitive-0.8.0.0@sha256:d0ff45fa6e61f92af23611ceb8b9a6a04c236b50fb70c60e2ed3bfa532703670,3241
- QuickCheck-2.14.3@sha256:f03d2f404d5ba465453d0fbc1944832789a759fe7c4f9bf8616bc1378a02fde4,7847
- quickcheck-io-0.2.0@sha256:7bf0b68fb90873825eb2e5e958c1b76126dcf984debb998e81673e6d837e0b2d,1133
- random-1.2.1.1@sha256:e7c1f881159d5cc788619c9ee8b8f340ba2ff0db571cdf3d1a1968ebc5108789,6777
- rio-0.1.22.0@sha256:95fc3725a638bb7d6e11be7a2cf8d601097ebc8cb992661b211a6e36ed1da726,3669
- safe-exceptions-0.1.7.4@sha256:f4aad0eca90044cb1eba53b84f75d5fa142d25d695117730bf31178d409c4fe0,1398
- splitmix-0.1.0.5@sha256:bac0ae8d46a04e410666b0c8081cff63f060f29157983b569ca86ddb6e6e0dc6,6557
- tf-random-0.5@sha256:14012837d0f0e18fdbbe3d56e67da8622ee5e20b180abce952dd50bd9f36b326,3983
- transformers-compat-0.7.2@sha256:044fb9955f63ee138fcebedfdcbe54afe741f2d5892a2d0bdf3a8052bd342643,5601
- typed-process-0.2.11.0@sha256:defde2c4dcd07750381d6e15ee7a517938c8d6353abcf27bba9f290e75a67d39,2070
- unliftio-0.2.25.0@sha256:d015242554890370bcbc3a575019be691d0edc279736ef97d29412fb9d0c4349,3410
- unliftio-core-0.2.1.0@sha256:cb78a95718f9cb2579a8a1208d4a148ea358f0774321c8cb905bfb0b96a2813c,1004
- unordered-containers-0.2.19.1@sha256:9ad8972c2e913c37b1d4f0e1261517fd7a1b8c8a58077e057be69837e3dbaa00,3822
- vector-0.13.0.0@sha256:1d0b2128c7151e06c2417616afedcb1a4d54087afeba623c55dd4b29094d4348,9112
- vector-stream-0.1.0.0@sha256:8977959d4bec54d9f2c5e9d4baa2cac7ab26e804a72591df8db887e0692ae8ae,1404
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file modified test-files/iface/x64/ghc9081/Main.hi
Binary file not shown.
Binary file modified test-files/iface/x64/ghc9081/X.hi
Binary file not shown.
12 changes: 5 additions & 7 deletions test/HiFileParserSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

module HiFileParserSpec (spec) where

import Data.Foldable (traverse_)
import Data.Semigroup ((<>))
import qualified HiFileParser as Iface
import RIO
import Test.Hspec (Spec, describe, it, shouldBe)
Expand Down Expand Up @@ -34,15 +32,15 @@ versions64 =
, "ghc9002" -- Last in GHC 9.0 series, using GHC 9.0.1 format
, "ghc9027" -- Last in GHC 9.2 series, using GHC 9.0.1 format
, "ghc9044" -- Last using GHC 9.4.1 format
, "ghc9045" -- First using GHC 9.4.5 format; last in GHC 9.4 series
, "ghc9061" -- First in GHC 9.6 series, using GHC 9.4.5 format
, "ghc9081" -- First in GHC 9.8 series, using GHC 9.8.1-alpha1 format
, "ghc9047" -- Last in GHC 9.4 series, using GHC 9.4.5 format
, "ghc9063" -- Last in GHC 9.6 series, using GHC 9.4.5 format
, "ghc9081" -- First in GHC 9.8 series, using GHC 9.8.1 format
]

spec :: Spec
spec = describe "should successfully deserialize interface for" $ do
traverse_ (deserialize check32) (("x32/" <>) <$> versions32)
traverse_ (deserialize check64) (("x64/" <>) <$> versions64)
traverse_ (deserialize check32 . ("x32/" <>)) versions32
traverse_ (deserialize check64 . ("x64/" <>)) versions64

check32 :: Iface.Interface -> IO ()
check32 iface = do
Expand Down

0 comments on commit e9e18f3

Please sign in to comment.