mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-30 06:59:43 +01:00
Updateproto3-suite
, proto3-wire
, and related deps (#31)
* Update turtle, optparse-{applicative,generic}; remove stack dep from nix-shell env * Track proto3-suite changes to readDotProtoWithContext * Update proto3-suite gitrev, use `compileDotProtoFileOrDie` in `GeneratedTests` * Bump `proto3-suite` rev * Bump `proto3-suite` and `proto3-wire` gitrevs, update `stack.yaml`
This commit is contained in:
parent
087ce6f49c
commit
ab8ec43d17
8 changed files with 81 additions and 32 deletions
15
nix/optparse-applicative.nix
Normal file
15
nix/optparse-applicative.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ mkDerivation, ansi-wl-pprint, base, bytestring, process
|
||||||
|
, QuickCheck, stdenv, transformers, transformers-compat
|
||||||
|
}:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "optparse-applicative";
|
||||||
|
version = "0.14.0.0";
|
||||||
|
sha256 = "06iwp1qsq0gjhnhxwyhdhldwvhlgcik6lx5jxpbb40fispyk4nxm";
|
||||||
|
libraryHaskellDepends = [
|
||||||
|
ansi-wl-pprint base process transformers transformers-compat
|
||||||
|
];
|
||||||
|
testHaskellDepends = [ base bytestring QuickCheck ];
|
||||||
|
homepage = "https://github.com/pcapriotti/optparse-applicative";
|
||||||
|
description = "Utilities and combinators for parsing command line options";
|
||||||
|
license = stdenv.lib.licenses.bsd3;
|
||||||
|
}
|
14
nix/optparse-generic.nix
Normal file
14
nix/optparse-generic.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{ mkDerivation, base, bytestring, optparse-applicative, semigroups
|
||||||
|
, stdenv, system-filepath, text, time, transformers, void
|
||||||
|
}:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "optparse-generic";
|
||||||
|
version = "1.2.1";
|
||||||
|
sha256 = "1dk945dp98mwk1v4y0cky3z0ngmd29nbg6fbaaxnigcrgpbvkjml";
|
||||||
|
libraryHaskellDepends = [
|
||||||
|
base bytestring optparse-applicative semigroups system-filepath
|
||||||
|
text time transformers void
|
||||||
|
];
|
||||||
|
description = "Auto-generate a command-line parser for your datatype";
|
||||||
|
license = stdenv.lib.licenses.bsd3;
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{ mkDerivation, base, bytestring, cereal, containers, deepseq
|
{ mkDerivation, base, bytestring, cereal, containers, deepseq
|
||||||
, fetchgit, filepath, haskell-src, mtl, optparse-generic, parsec
|
, doctest, fetchgit, foldl, haskell-src, lens, mtl
|
||||||
, parsers, pretty, pretty-show, proto3-wire, QuickCheck, safe
|
, neat-interpolation, optparse-generic, parsec, parsers, pretty
|
||||||
|
, pretty-show, proto3-wire, QuickCheck, range-set-list, safe
|
||||||
, semigroups, stdenv, system-filepath, tasty, tasty-hunit
|
, semigroups, stdenv, system-filepath, tasty, tasty-hunit
|
||||||
, tasty-quickcheck, text, transformers, turtle, vector
|
, tasty-quickcheck, text, transformers, turtle, vector
|
||||||
}:
|
}:
|
||||||
|
@ -8,22 +9,24 @@ mkDerivation {
|
||||||
pname = "proto3-suite";
|
pname = "proto3-suite";
|
||||||
version = "0.1.0.0";
|
version = "0.1.0.0";
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://github.com/awakenetworks/proto3-suite";
|
url = "https://github.com/awakesecurity/proto3-suite";
|
||||||
sha256 = "1wqs209sfwjiwvpv8zz49jk9l6pivqz06r0m1rfxvsdmxh80kp7d";
|
sha256 = "1imhijvbliax8n2sz74jwwyb0m6zy8v1xkmixlm6vchwicn2ka3k";
|
||||||
rev = "48d452d42e8d73acfa88a56a54586d17bae711db";
|
rev = "d9d0282978a785385c47642a9a46037e4263a87d";
|
||||||
};
|
};
|
||||||
isLibrary = true;
|
isLibrary = true;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
base bytestring cereal containers deepseq filepath haskell-src mtl
|
base bytestring cereal containers deepseq foldl haskell-src lens
|
||||||
parsec parsers pretty pretty-show proto3-wire QuickCheck safe
|
mtl neat-interpolation parsec parsers pretty pretty-show
|
||||||
semigroups text transformers vector
|
proto3-wire QuickCheck safe semigroups system-filepath text
|
||||||
|
transformers turtle vector
|
||||||
];
|
];
|
||||||
executableHaskellDepends = [
|
executableHaskellDepends = [
|
||||||
base optparse-generic system-filepath turtle
|
base containers optparse-generic proto3-wire range-set-list
|
||||||
|
system-filepath text turtle
|
||||||
];
|
];
|
||||||
testHaskellDepends = [
|
testHaskellDepends = [
|
||||||
base bytestring cereal pretty-show proto3-wire QuickCheck
|
base bytestring cereal doctest pretty-show proto3-wire QuickCheck
|
||||||
semigroups tasty tasty-hunit tasty-quickcheck text transformers
|
semigroups tasty tasty-hunit tasty-quickcheck text transformers
|
||||||
turtle vector
|
turtle vector
|
||||||
];
|
];
|
||||||
|
|
|
@ -6,9 +6,9 @@ mkDerivation {
|
||||||
pname = "proto3-wire";
|
pname = "proto3-wire";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://github.com/awakenetworks/proto3-wire";
|
url = "https://github.com/awakesecurity/proto3-wire";
|
||||||
sha256 = "1979pccp8c8wvl69r203mji51c8s59mccng6zrw3kf2s1wz5xxqg";
|
sha256 = "0pcacsz33n84rkc6yi99yq2dy4fisrhqpfbkqa3nfsjqhlw43gcf";
|
||||||
rev = "8178cc717eb1c438272a7f451862590a8b2d41ff";
|
rev = "077b7e329fd7f43b0628c23b83c5e2e05334002e";
|
||||||
};
|
};
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
base bytestring cereal containers deepseq hashable QuickCheck safe
|
base bytestring cereal containers deepseq hashable QuickCheck safe
|
||||||
|
|
20
nix/turtle.nix
Normal file
20
nix/turtle.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ mkDerivation, ansi-wl-pprint, async, base, bytestring, clock
|
||||||
|
, directory, doctest, foldl, hostname, managed, optional-args
|
||||||
|
, optparse-applicative, process, semigroups, stdenv, stm
|
||||||
|
, system-fileio, system-filepath, temporary, text, time
|
||||||
|
, transformers, unix, unix-compat
|
||||||
|
}:
|
||||||
|
mkDerivation {
|
||||||
|
pname = "turtle";
|
||||||
|
version = "1.3.6";
|
||||||
|
sha256 = "0fr8p6rnk2lrsgbfh60jlqcjr0nxrh3ywxsj5d4psck0kgyhvg1m";
|
||||||
|
libraryHaskellDepends = [
|
||||||
|
ansi-wl-pprint async base bytestring clock directory foldl hostname
|
||||||
|
managed optional-args optparse-applicative process semigroups stm
|
||||||
|
system-fileio system-filepath temporary text time transformers unix
|
||||||
|
unix-compat
|
||||||
|
];
|
||||||
|
testHaskellDepends = [ base doctest system-filepath temporary ];
|
||||||
|
description = "Shell programming, Haskell-style";
|
||||||
|
license = stdenv.lib.licenses.bsd3;
|
||||||
|
}
|
16
release.nix
16
release.nix
|
@ -175,6 +175,12 @@ let
|
||||||
|
|
||||||
haskellPackages = pkgs.haskellPackages.override {
|
haskellPackages = pkgs.haskellPackages.override {
|
||||||
overrides = haskellPackagesNew: haskellPackagesOld: rec {
|
overrides = haskellPackagesNew: haskellPackagesOld: rec {
|
||||||
|
optparse-applicative =
|
||||||
|
haskellPackagesNew.callPackage ./nix/optparse-applicative.nix { };
|
||||||
|
|
||||||
|
optparse-generic =
|
||||||
|
haskellPackagesNew.callPackage ./nix/optparse-generic.nix { };
|
||||||
|
|
||||||
proto3-wire =
|
proto3-wire =
|
||||||
haskellPackagesNew.callPackage ./nix/proto3-wire.nix { };
|
haskellPackagesNew.callPackage ./nix/proto3-wire.nix { };
|
||||||
|
|
||||||
|
@ -218,10 +224,6 @@ let
|
||||||
grpcio-tools
|
grpcio-tools
|
||||||
]);
|
]);
|
||||||
|
|
||||||
# So users can use `stack` inside of `nix-shell` if they do not
|
|
||||||
# already have it installed.
|
|
||||||
stack = haskellPackages.stack;
|
|
||||||
|
|
||||||
in rec {
|
in rec {
|
||||||
buildDepends = [
|
buildDepends = [
|
||||||
pkgs.makeWrapper
|
pkgs.makeWrapper
|
||||||
|
@ -260,9 +262,13 @@ let
|
||||||
shellHook = (oldDerivation.shellHook or "") + ''
|
shellHook = (oldDerivation.shellHook or "") + ''
|
||||||
export DYLD_LIBRARY_PATH=${grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH
|
export DYLD_LIBRARY_PATH=${grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH
|
||||||
# This lets us use our custom ghc and python environments in the shell.
|
# This lets us use our custom ghc and python environments in the shell.
|
||||||
export PATH=${stack}/bin:${ghc}/bin:${python}/bin''${PATH:+:}$PATH
|
export PATH=${ghc}/bin:${python}/bin''${PATH:+:}$PATH
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
turtle =
|
||||||
|
haskellPackagesNew.callPackage ./nix/turtle.nix { };
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,11 +9,11 @@ packages:
|
||||||
- '.'
|
- '.'
|
||||||
- location:
|
- location:
|
||||||
git: git@github.com:awakenetworks/proto3-suite.git
|
git: git@github.com:awakenetworks/proto3-suite.git
|
||||||
commit: 10f592cdd5349e33d4924b066d4f6e27ada5e5c5
|
commit: d9d0282978a785385c47642a9a46037e4263a87d
|
||||||
extra-dep: true
|
extra-dep: true
|
||||||
- location:
|
- location:
|
||||||
git: git@github.com:awakenetworks/proto3-wire.git
|
git: git@github.com:awakenetworks/proto3-wire.git
|
||||||
commit: 4cf2f349cbf27ef36af28ae51e2712d6cf5f7723
|
commit: 077b7e329fd7f43b0628c23b83c5e2e05334002e
|
||||||
extra-dep: true
|
extra-dep: true
|
||||||
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
|
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
|
||||||
extra-deps: [managed-1.0.5]
|
extra-deps: [managed-1.0.5]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
|
||||||
module GeneratedTests where
|
module GeneratedTests where
|
||||||
|
@ -20,7 +21,7 @@ testServerGeneration = testCase "server generation" $ do
|
||||||
mktree hsTmpDir
|
mktree hsTmpDir
|
||||||
mktree pyTmpDir
|
mktree pyTmpDir
|
||||||
|
|
||||||
compileSimpleDotProto
|
compileDotProtoFileOrDie hsTmpDir ["tests"] "simple.proto"
|
||||||
|
|
||||||
do exitCode <- proc "tests/simple-server.sh" [hsTmpDir] empty
|
do exitCode <- proc "tests/simple-server.sh" [hsTmpDir] empty
|
||||||
exitCode @?= ExitSuccess
|
exitCode @?= ExitSuccess
|
||||||
|
@ -48,7 +49,7 @@ testClientGeneration = testCase "client generation" $ do
|
||||||
mktree hsTmpDir
|
mktree hsTmpDir
|
||||||
mktree pyTmpDir
|
mktree pyTmpDir
|
||||||
|
|
||||||
compileSimpleDotProto
|
compileDotProtoFileOrDie hsTmpDir ["tests"] "simple.proto"
|
||||||
|
|
||||||
do exitCode <- proc "tests/simple-client.sh" [hsTmpDir] empty
|
do exitCode <- proc "tests/simple-client.sh" [hsTmpDir] empty
|
||||||
exitCode @?= ExitSuccess
|
exitCode @?= ExitSuccess
|
||||||
|
@ -74,13 +75,3 @@ testClientGeneration = testCase "client generation" $ do
|
||||||
hsTmpDir, pyTmpDir :: IsString a => a
|
hsTmpDir, pyTmpDir :: IsString a => a
|
||||||
hsTmpDir = "tests/tmp"
|
hsTmpDir = "tests/tmp"
|
||||||
pyTmpDir = "tests/py-tmp"
|
pyTmpDir = "tests/py-tmp"
|
||||||
|
|
||||||
compileSimpleDotProto :: IO ()
|
|
||||||
compileSimpleDotProto =
|
|
||||||
do dpRes <- readDotProtoWithContext "tests/simple.proto"
|
|
||||||
case dpRes of
|
|
||||||
Left err -> fail (show err)
|
|
||||||
Right (dp, ctxt) ->
|
|
||||||
case renderHsModuleForDotProto dp ctxt of
|
|
||||||
Left err -> fail ("compileSimpleDotProto: Error compiling test.proto: " <> show err)
|
|
||||||
Right hsSrc -> writeFile (hsTmpDir ++ "/Simple.hs") hsSrc
|
|
||||||
|
|
Loading…
Reference in a new issue