Skip to content

Commit

Permalink
Support GHC 9.10
Browse files Browse the repository at this point in the history
  • Loading branch information
j6carey committed Jan 15, 2025
1 parent 2d48ee3 commit 842746e
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 76 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- 948
- 962
- 981
- 9101
exclude:
- os: macos-latest
ghc: 902
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.4.4
- Support GHC 9.10

1.4.3
- Support GHC 9.8
- Support GHC 9.6
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ stack build [--test] [--haddock]

### GHC Versions

#### GHC 9.10

Supported on Linux and Darwin.

#### GHC 9.8

Supported on Linux and Darwin.
Expand Down
12 changes: 4 additions & 8 deletions nix/haskell-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ pkgsNew: pkgsOld:
adjunctions =
pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.adjunctions;

# With nixpkgs-23.11 and ghc981, aeson-2.1.2.1 thinks that th-abstraction is out of bounds.
# Also, in order to avoid the breaking change to package structure in aeson-2.2.0.0,
# we patch the import list of aeson-2.1.2.1.
aeson =
pkgsNew.haskell.lib.doJailbreak
( pkgsNew.haskell.lib.appendPatches haskellPackagesPrev.aeson
[ ./patches/aeson-2.1.2.1.patch ] );

# With nixpkgs-23.11 and ghc981, base-compat-batteries wants hspec for testing,
# which causes problems.
base-compat-batteries =
Expand Down Expand Up @@ -102,6 +94,10 @@ pkgsNew: pkgsOld:
iproute =
pkgsNew.haskell.lib.dontCheck haskellPackagesPrev.iproute;

# With nixpkgs-24.11 and our overrides, lens thinks that template-haskell is out of bounds.
lens =
pkgsNew.haskell.lib.doJailbreak haskellPackagesPrev.lens;

# With nixpkgs-23.11 and ghc981, monad-par wants test-framework for testing, which
# wants language-haskell-extract, which does not support modern template-haskell.
monad-par =
Expand Down
9 changes: 5 additions & 4 deletions nix/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ args:

let
nixpkgs = builtins.fetchTarball {
# build: https://hydra.nixos.org/build/258096332
# commit: 0638fe2715d998fa81d173aad264eb671ce2ebc1
url = "https://hydra.nixos.org/build/258096332/download/2/nixpkgs-23.11pre558121.0638fe2715d9.tar.xz";
sha256 = "1z3s1hqg3b72g608pf9sv474d4y9s00p86nsvfw5i9xgwhjncjjb";
# from: https://hydra.nixos.org/job/nixos/release-24.11/nixpkgs.tarball
# build: https://hydra.nixos.org/build/284195557
# commit: cbd8ec4de4469333c82ff40d057350c30e9f7d36
url = "https://hydra.nixos.org/build/284195557/download/2/nixpkgs-24.11pre712431.cbd8ec4de446.tar.xz";
sha256 = "0ljq084fq784fgvm7n9081dmnjhksz20vwzca2zics0kkkzjxh5k";
};
in import nixpkgs ({ config = { }; } // args)
19 changes: 0 additions & 19 deletions nix/packages/free.nix

This file was deleted.

40 changes: 0 additions & 40 deletions nix/packages/hpack.nix

This file was deleted.

2 changes: 1 addition & 1 deletion proto3-wire.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: >=1.10

name: proto3-wire
version: 1.4.3
version: 1.4.4
synopsis: A low-level implementation of the Protocol Buffers (version 3) wire format
license: Apache-2.0
license-file: LICENSE
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ compiler ? "ghc8107", enableStack ? false }:
{ compiler ? "ghc948", enableStack ? false }:

let
pkgs = import ./nix/pkgs.nix {
Expand Down
3 changes: 3 additions & 0 deletions src/Proto3/Wire/Decode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
-- from the untyped 'Map' representation obtained from 'decodeWire'.

{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
Expand Down Expand Up @@ -86,7 +87,9 @@ import Data.Bits
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Short as BS
#if !MIN_VERSION_base(4,20,0)
import Data.Foldable ( foldl' )
#endif
import qualified Data.IntMap.Strict as M -- TODO intmap
import Data.Maybe ( fromMaybe )
import Data.Serialize.Get ( Get, getWord8, getInt32le
Expand Down
6 changes: 3 additions & 3 deletions src/Proto3/Wire/Reverse/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ sealBuffer# addr unused s0 =
-- until a state action frees the stable pointer or modifies the state
-- variable, the stable pointer will reference the state variable,
-- which in turn will reference the current buffer.
let allocation = P.sizeofMutableByteArray buffer - metaDataSize
allocation <- subtract metaDataSize <$> P.getSizeofMutableByteArray buffer
if allocation <= I# unused
then
pure (oldSealed, total, stateVar, statePtr, Just buffer)
Expand Down Expand Up @@ -573,8 +573,8 @@ afterPrependChunks# SealedState
Just buf -> do
-- Recycle the old current buffer, from which
-- we already copied what we wished to keep.
let u1 = P.sizeofMutableByteArray buf - metaDataSize
!(PTR base) = P.mutableByteArrayContents buf
u1 <- subtract metaDataSize <$> P.getSizeofMutableByteArray buf
let !(PTR base) = P.mutableByteArrayContents buf
!v1 = plusPtr (Ptr base) (metaDataSize + u1)
!m = plusPtr (Ptr base) metaDataSize
writeSpace m (u1 + total)
Expand Down

0 comments on commit 842746e

Please sign in to comment.