Skip to content
Merged
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
ghc: [ghc96, ghc98]
Comment thread
riz0id marked this conversation as resolved.
steps:
- uses: actions/checkout@v3.5.3
name: Checkout
Expand All @@ -17,9 +20,12 @@ jobs:
with:
name: awakesecurity
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-build --attr grpc-haskell
- run: nix-build --attr grpc-haskell --argstr ghc ${{ matrix.ghc }}
build-macos:
runs-on: macos-latest
strategy:
matrix:
ghc: [ghc96, ghc98]
Comment thread
riz0id marked this conversation as resolved.
steps:
- uses: actions/checkout@v3.5.3
name: Checkout
Expand All @@ -30,4 +36,4 @@ jobs:
with:
name: awakesecurity
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-build --attr grpc-haskell-no-tests
- run: nix-build --attr grpc-haskell-no-tests --argstr ghc ${{ matrix.ghc }}
23 changes: 14 additions & 9 deletions core/grpc-haskell-core.cabal
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cabal-version: 3.0

name: grpc-haskell-core
version: 0.6.1
synopsis: Haskell implementation of gRPC layered on shared C library.
Expand All @@ -9,7 +11,6 @@ maintainer: opensource@awakenetworks.com
copyright: Copyright 2016 Awake Networks
category: Network
build-type: Simple
cabal-version: >=1.10
extra-source-files: include/grpc_haskell.h
tests/ssl/localhost.crt
tests/ssl/localhost.key
Expand All @@ -19,15 +20,22 @@ Flag Debug
Manual: True
Default: False

common common
default-language: Haskell2010
ghc-options: -Wall -Werror -fwarn-incomplete-patterns -fno-warn-unused-do-bind -g -threaded -rtsopts
if impl(ghc >= 9.8)
ghc-options: -Wno-x-partial

library
import: common
build-depends:
base >= 4.8 && < 5.0
, clock >= 0.6.0 && < 0.9
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && < 0.13
, stm >= 2.4 && < 2.6
, containers >= 0.5 && < 0.7
, managed >= 1.0.0 && < 1.1
, template-haskell >= 2.16.0 && < 2.21
, template-haskell >= 2.16.0 && < 2.24
, transformers

c-sources:
Expand Down Expand Up @@ -70,9 +78,7 @@ library
, grpc/impl/codegen/compression_types.h
, grpc/slice_buffer.h
, grpc/slice.h
build-tools: c2hs
default-language: Haskell2010
ghc-options: -Wall -Werror -fwarn-incomplete-patterns -fno-warn-unused-do-bind
build-tool-depends: c2hs:c2hs
include-dirs: include
hs-source-dirs: src
default-extensions: CPP
Expand All @@ -82,10 +88,11 @@ library
CC-Options: -DGRPC_HASKELL_DEBUG -std=c99

test-suite tests
import: common
build-depends:
base >=4.8 && <5.0
, grpc-haskell-core
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, unix
, time
, async >=2.1 && <2.3
Expand All @@ -106,8 +113,6 @@ test-suite tests
LowLevelTests,
LowLevelTests.Op,
UnsafeTests
default-language: Haskell2010
ghc-options: -Wall -Werror -fwarn-incomplete-patterns -fno-warn-unused-do-bind -g -threaded -rtsopts
hs-source-dirs: tests
main-is: Properties.hs
type: exitcode-stdio-1.0
Expand Down
18 changes: 9 additions & 9 deletions grpc-haskell.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ flag with-examples
library
build-depends:
base >=4.8 && <5.0
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, proto3-suite >=0.4.3
, proto3-wire >=1.2.2
, grpc-haskell-core >=0.6.0
Expand All @@ -55,7 +55,7 @@ executable hellos-server
build-depends:
base >=4.8 && <5.0
, async
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, containers >=0.5 && <0.7
, grpc-haskell
, grpc-haskell-core >=0.2.0
Expand All @@ -75,7 +75,7 @@ executable hellos-client
build-depends:
base >=4.8 && <5.0
, async
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, containers >=0.5 && <0.7
, grpc-haskell
, grpc-haskell-core >=0.2.0
Expand All @@ -95,7 +95,7 @@ executable echo-server
build-depends:
base >=4.8 && <5.0
, async
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, containers >=0.5 && <0.7
, deepseq
, grpc-haskell
Expand All @@ -120,7 +120,7 @@ executable arithmetic-server
build-depends:
base >=4.8 && <5.0
, async
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, containers >=0.5 && <0.7
, deepseq
, grpc-haskell
Expand All @@ -144,7 +144,7 @@ executable arithmetic-client
build-depends:
base >=4.8 && <5.0
, async
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, containers >=0.5 && <0.7
, deepseq
, grpc-haskell
Expand All @@ -168,7 +168,7 @@ executable echo-client
build-depends:
base >=4.8 && <5.0
, async
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, containers >=0.5 && <0.7
, deepseq
, grpc-haskell
Expand All @@ -191,7 +191,7 @@ executable echo-client
test-suite tests
build-depends:
base >=4.8 && <5.0
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, unix
, time
, async
Expand Down Expand Up @@ -228,7 +228,7 @@ benchmark bench
, async ==2.1.*
, criterion ==1.1.*
, proto3-suite
, bytestring >= 0.10 && <0.12
, bytestring >= 0.10 && <0.13
, random >=1.0.0
hs-source-dirs: bench
main-is: Bench.hs
Expand Down
52 changes: 25 additions & 27 deletions nix/proto3-suite.nix
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
{ mkDerivation, aeson, aeson-pretty, attoparsec, base
, base64-bytestring, binary, bytestring, cereal, containers
, contravariant, deepseq, dhall, doctest, fetchgit, filepath, foldl
, generic-arbitrary, ghc, hashable, hedgehog
, insert-ordered-containers, large-generics, large-records, lens
, lib, mtl, neat-interpolation, optparse-applicative
, optparse-generic, parsec, parsers, pretty, pretty-show
, proto3-wire, QuickCheck, quickcheck-instances, range-set-list
{ mkDerivation, aeson, aeson-pretty, attoparsec, attoparsec-aeson
, base, base64-bytestring, binary, bytestring, cereal, containers
, contravariant, deepseq, doctest, fetchgit, filepath, foldl
, generic-arbitrary, ghc-lib-parser, hashable, hedgehog
, insert-ordered-containers, lens, lib, mtl, neat-interpolation
, optparse-applicative, optparse-generic, parsec, parsers, pretty
, pretty-show, proto3-wire, QuickCheck, quickcheck-instances
, record-hasfield, safe, split, swagger2, system-filepath, tasty
, tasty-hedgehog, tasty-hunit, tasty-quickcheck, text, text-short
, time, transformers, turtle, vector
, tasty-hedgehog, tasty-hunit, tasty-quickcheck, template-haskell
, text, text-short, time, transformers, turtle, vector
}:
mkDerivation {
pname = "proto3-suite";
version = "0.8.2";
version = "0.9.3";
src = fetchgit {
url = "https://github.com/awakesecurity/proto3-suite";
sha256 = "003i6209cp1h82ppb84jgi2ww4zmxm80xd0iz4gw0mh65ilpl6dz";
rev = "4bfa6275ea9d502d7a30d2bd118ca24903898125";
sha256 = "19xxvdi28hlxgs9nci5kdsn58kndlwzfjqdzwd2acwwpwccmj0rq";
rev = "48bf2701622a6b558eb6658cb23fab139efa34db";
fetchSubmodules = true;
};
isLibrary = true;
isExecutable = true;
enableSeparateDataOutput = true;
libraryHaskellDepends = [
aeson aeson-pretty attoparsec base base64-bytestring binary
bytestring cereal containers contravariant deepseq dhall filepath
foldl ghc hashable insert-ordered-containers large-generics
large-records lens mtl neat-interpolation parsec parsers pretty
pretty-show proto3-wire QuickCheck quickcheck-instances safe split
swagger2 system-filepath text text-short time transformers turtle
vector
aeson aeson-pretty attoparsec attoparsec-aeson base
base64-bytestring binary bytestring cereal containers contravariant
deepseq filepath foldl ghc-lib-parser hashable
insert-ordered-containers lens mtl neat-interpolation parsec
parsers pretty pretty-show proto3-wire QuickCheck
quickcheck-instances safe split swagger2 system-filepath
template-haskell text text-short time transformers turtle vector
];
executableHaskellDepends = [
base containers ghc mtl optparse-applicative optparse-generic
proto3-wire range-set-list system-filepath text turtle
base containers ghc-lib-parser mtl optparse-applicative
optparse-generic proto3-wire system-filepath text turtle
];
testHaskellDepends = [
aeson attoparsec base base64-bytestring bytestring cereal
containers deepseq doctest generic-arbitrary ghc hedgehog
large-generics large-records mtl parsec pretty pretty-show
proto3-wire QuickCheck record-hasfield swagger2 tasty
tasty-hedgehog tasty-hunit tasty-quickcheck text text-short
transformers turtle vector
containers deepseq doctest generic-arbitrary ghc-lib-parser
hedgehog mtl parsec pretty pretty-show proto3-wire QuickCheck
record-hasfield swagger2 tasty tasty-hedgehog tasty-hunit
tasty-quickcheck text text-short transformers turtle vector
];
description = "A higher-level API to the proto3-wire library";
license = lib.licenses.asl20;
Expand Down
6 changes: 3 additions & 3 deletions nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# The SHA256 will be printed as the last line of stdout.

import (builtins.fetchTarball {
# "nixos-unstable" as on 2024-12-02
url = "https://github.com/NixOS/nixpkgs/archive/ac35b104800bff9028425fec3b6e8a41de2bbfff.tar.gz";
sha256 = "1fbj7shlmviilmgz5z2gp59j6xwgdr01jfh75qhixx06kib4305p";
# "nixos-unstable" as on 2025-04-18
url = "https://github.com/NixOS/nixpkgs/archive/b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef.tar.gz";
sha256 = "09dahi81cn02gnzsc8a00n945dxc18656ar0ffx5vgxjj1nhgsvy";
})
4 changes: 2 additions & 2 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
# haskellPackages = pkgs.haskellPackages.extend (self: super: {
# your-package = self.callCabal2nix "your-package" ./. { };
# };);

{ ghc ? "ghc96" }:
let
overlay = pkgsNew: pkgsOld: {

haskellPackages = pkgsOld.haskellPackages.override {
haskellPackages = pkgsOld.haskell.packages.${ghc}.override {
overrides = haskellPackagesNew: haskellPackagesOld: {
proto3-wire =
haskellPackagesNew.callPackage ./nix/proto3-wire.nix { };
Expand Down
4 changes: 2 additions & 2 deletions tests/GeneratedTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ testServerGeneration logger = testCase "server generation" $ do
, inputProto = "simple.proto"
, outputDir = hsTmpDir
, stringType = StringType "Data.Text.Lazy" "Text"
, recordStyle = LargeRecords
, typeLevelFormat = True
}
compileDotProtoFileOrDie logger args

Expand Down Expand Up @@ -71,7 +71,7 @@ testClientGeneration logger = testCase "client generation" $ do
, inputProto = "simple.proto"
, outputDir = hsTmpDir
, stringType = StringType "Data.Text.Lazy" "Text"
, recordStyle = LargeRecords
, typeLevelFormat = True
}
compileDotProtoFileOrDie logger args

Expand Down