From 39576acdd043065f0edf2e54db59cd2ce7419fc1 Mon Sep 17 00:00:00 2001 From: Jonathan Lorimer Date: Fri, 14 Apr 2023 14:10:13 -0400 Subject: [PATCH 1/3] update swagger and proto-wire --- cabal.project | 5 +++++ proto3-suite.cabal | 12 ++++++------ shell.nix | 1 + stack.yaml | 2 +- stack.yaml.lock | 16 ++++++++-------- tests/ArbitraryGeneratedTestTypes.hs | 5 ----- tests/TestCodeGen.hs | 8 ++++---- 7 files changed, 25 insertions(+), 24 deletions(-) create mode 100644 cabal.project diff --git a/cabal.project b/cabal.project new file mode 100644 index 00000000..58a37167 --- /dev/null +++ b/cabal.project @@ -0,0 +1,5 @@ +packages: ./*.cabal +source-repository-package + type: git + location: https://github.com/awakesecurity/proto3-wire + tag: 8096a1e19431af603655e5c1f2488b5db907836c diff --git a/proto3-suite.cabal b/proto3-suite.cabal index d582be9c..366dcf09 100644 --- a/proto3-suite.cabal +++ b/proto3-suite.cabal @@ -52,13 +52,13 @@ library if flag(dhall) exposed-modules: Proto3.Suite.DhallPB - build-depends: dhall >=1.13 && < 1.39 + build-depends: dhall >=1.13 && < 1.41.2 cpp-options: -DDHALL if flag(swagger) exposed-modules: Proto3.Suite.DotProto.Generate.Swagger Proto3.Suite.DotProto.Generate.Swagger.Wrappers - build-depends: swagger2 >=2.1.6 && <2.8 + build-depends: swagger2 ==2.8.6 cpp-options: -DSWAGGER if flag(swagger-wrapper-format) hs-source-dirs: src/swagger-wrapper-format @@ -67,7 +67,7 @@ library if flag(large-records) -- large-records support uses newer Dhall APIs. So we need at least 1.34. - build-depends: dhall >=1.34 && < 1.39, + build-depends: dhall >=1.34 && < 1.41.2, large-generics, large-records cpp-options: -DLARGE_RECORDS @@ -118,9 +118,9 @@ library parsers >= 0.12 && <0.13, pretty ==1.1.*, pretty-show >= 1.6.12 && < 2.0, - proto3-wire >= 1.2.2 && < 1.5, + proto3-wire, QuickCheck >=2.10 && <2.15, - quickcheck-instances < 0.4, + quickcheck-instances >=0.3.29 && < 0.4, safe ==0.3.*, split, system-filepath, @@ -148,7 +148,7 @@ test-suite tests if flag(dhall) other-modules: TestDhall - build-depends: dhall >=1.13 && < 1.39 + build-depends: dhall >=1.13 && < 1.41.2 cpp-options: -DDHALL if flag(swagger) diff --git a/shell.nix b/shell.nix index 72f3815b..a1ea1873 100644 --- a/shell.nix +++ b/shell.nix @@ -29,5 +29,6 @@ in proto3-suite.env.overrideAttrs (old: { buildInputs = (old.buildInputs or []) ++ [ pkgs.cabal-install pkgs.python36Packages.virtualenv + pkgs.ghcid ]; }) diff --git a/stack.yaml b/stack.yaml index fbc4ab86..1a73bb2d 100644 --- a/stack.yaml +++ b/stack.yaml @@ -8,7 +8,7 @@ packages: extra-deps: - github: awakesecurity/proto3-wire - commit: 9b1c178f8a23a5f03237cb77cce403bc386da523 + commit: 8096a1e19431af603655e5c1f2488b5db907836c nix: packages: diff --git a/stack.yaml.lock b/stack.yaml.lock index 8544acb7..8e2e5629 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -5,20 +5,20 @@ packages: - completed: - size: 45006 - url: https://github.com/awakesecurity/proto3-wire/archive/9b1c178f8a23a5f03237cb77cce403bc386da523.tar.gz name: proto3-wire - version: 1.2.2 - sha256: df812fdfe6c7df641d310c6273c16de4fda8f4d61635f084e24937ca0b91944c pantry-tree: - size: 1325 - sha256: bf3471cb92d5c273bf1163594380e836b48917a076b08827286a32f3d2320dee + sha256: fb014dc4be245b77a8f0cec3729164f213954a207b21a4dfe51bf1f96d26747f + size: 1608 + sha256: 9a76c581dab0709560c5e6cd824b2c95be98cea76f8380f11f64974b399dc650 + size: 48185 + url: https://github.com/awakesecurity/proto3-wire/archive/8096a1e19431af603655e5c1f2488b5db907836c.tar.gz + version: 1.4.1 original: - url: https://github.com/awakesecurity/proto3-wire/archive/9b1c178f8a23a5f03237cb77cce403bc386da523.tar.gz + url: https://github.com/awakesecurity/proto3-wire/archive/8096a1e19431af603655e5c1f2488b5db907836c.tar.gz snapshots: - completed: + sha256: c632012da648385b9fa3c29f4e0afd56ead299f1c5528ee789058be410e883c0 size: 585393 url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/0.yaml - sha256: c632012da648385b9fa3c29f4e0afd56ead299f1c5528ee789058be410e883c0 original: url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/0.yaml diff --git a/tests/ArbitraryGeneratedTestTypes.hs b/tests/ArbitraryGeneratedTestTypes.hs index 34db3b48..6292a2a8 100644 --- a/tests/ArbitraryGeneratedTestTypes.hs +++ b/tests/ArbitraryGeneratedTestTypes.hs @@ -4,7 +4,6 @@ module ArbitraryGeneratedTestTypes where import Data.String (fromString) -import qualified Data.Text.Short as TS import qualified Data.Vector as V import qualified Proto3.Suite.Types as DotProto import Test.QuickCheck (listOf) @@ -15,10 +14,6 @@ import qualified TestProtoImport import qualified TestProtoOneof import qualified TestProtoOneofImport -instance Arbitrary TS.ShortText where - arbitrary = fmap TS.fromText arbitrary - shrink = map TS.fromText . shrink . TS.toText - instance Arbitrary Trivial where arbitrary = Trivial <$> arbitrary diff --git a/tests/TestCodeGen.hs b/tests/TestCodeGen.hs index 1fa5eb7e..ec426e3f 100644 --- a/tests/TestCodeGen.hs +++ b/tests/TestCodeGen.hs @@ -66,16 +66,16 @@ swaggerWrapperFormat = testGroup "Swagger Wrapper Format" "{\"properties\":{\"wrapper\":{\"format\":\"float\",\"type\":\"number\"}},\"type\":\"object\"}" , expectSchema @TestProtoWrappers.TestInt64Value "{\"properties\":{\"wrapper\":{\"maximum\":9223372036854775807,\"format\":\"Int64Value\",\"minimum\":-9223372036854775808,\"type\":\"integer\"}},\"type\":\"object\"}" - "{\"properties\":{\"wrapper\":{\"maximum\":9223372036854775807,\"format\":\"int64\",\"minimum\":-9223372036854775808,\"type\":\"integer\"}},\"type\":\"object\"}" + "{\"properties\":{\"wrapper\":{\"format\":\"int64\",\"maximum\":9223372036854775807,\"minimum\":-9223372036854775808,\"type\":\"integer\"}},\"type\":\"object\"}" , expectSchema @TestProtoWrappers.TestUInt64Value "{\"properties\":{\"wrapper\":{\"maximum\":18446744073709551615,\"format\":\"UInt64Value\",\"minimum\":0,\"type\":\"integer\"}},\"type\":\"object\"}" - "{\"properties\":{\"wrapper\":{\"maximum\":18446744073709551615,\"minimum\":0,\"type\":\"integer\"}},\"type\":\"object\"}" + "{\"properties\":{\"wrapper\":{\"format\":\"int64\",\"maximum\":18446744073709551615,\"minimum\":0,\"type\":\"integer\"}},\"type\":\"object\"}" , expectSchema @TestProtoWrappers.TestInt32Value "{\"properties\":{\"wrapper\":{\"maximum\":2147483647,\"format\":\"Int32Value\",\"minimum\":-2147483648,\"type\":\"integer\"}},\"type\":\"object\"}" - "{\"properties\":{\"wrapper\":{\"maximum\":2147483647,\"format\":\"int32\",\"minimum\":-2147483648,\"type\":\"integer\"}},\"type\":\"object\"}" + "{\"properties\":{\"wrapper\":{\"format\":\"int32\",\"maximum\":2147483647,\"minimum\":-2147483648,\"type\":\"integer\"}},\"type\":\"object\"}" , expectSchema @TestProtoWrappers.TestUInt32Value "{\"properties\":{\"wrapper\":{\"maximum\":4294967295,\"format\":\"UInt32Value\",\"minimum\":0,\"type\":\"integer\"}},\"type\":\"object\"}" - "{\"properties\":{\"wrapper\":{\"maximum\":4294967295,\"minimum\":0,\"type\":\"integer\"}},\"type\":\"object\"}" + "{\"properties\":{\"wrapper\":{\"format\":\"int32\",\"maximum\":4294967295,\"minimum\":0,\"type\":\"integer\"}},\"type\":\"object\"}" , expectSchema @TestProtoWrappers.TestBoolValue "{\"properties\":{\"wrapper\":{\"format\":\"BoolValue\",\"type\":\"boolean\"}},\"type\":\"object\"}" "{\"properties\":{\"wrapper\":{\"type\":\"boolean\"}},\"type\":\"object\"}" From 25c0de73c5de09d2da18474b782d15beb25e1920 Mon Sep 17 00:00:00 2001 From: Jonathan Lorimer Date: Fri, 14 Apr 2023 14:11:57 -0400 Subject: [PATCH 2/3] remove ghcid --- shell.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/shell.nix b/shell.nix index a1ea1873..72f3815b 100644 --- a/shell.nix +++ b/shell.nix @@ -29,6 +29,5 @@ in proto3-suite.env.overrideAttrs (old: { buildInputs = (old.buildInputs or []) ++ [ pkgs.cabal-install pkgs.python36Packages.virtualenv - pkgs.ghcid ]; }) From bbf0e9683e5171356eb712a74626c685c47b40f9 Mon Sep 17 00:00:00 2001 From: Jonathan Lorimer Date: Fri, 14 Apr 2023 14:28:44 -0400 Subject: [PATCH 3/3] lte dhall --- proto3-suite.cabal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proto3-suite.cabal b/proto3-suite.cabal index 366dcf09..dd5ccdd0 100644 --- a/proto3-suite.cabal +++ b/proto3-suite.cabal @@ -52,13 +52,13 @@ library if flag(dhall) exposed-modules: Proto3.Suite.DhallPB - build-depends: dhall >=1.13 && < 1.41.2 + build-depends: dhall >=1.13 && <= 1.41.2 cpp-options: -DDHALL if flag(swagger) exposed-modules: Proto3.Suite.DotProto.Generate.Swagger Proto3.Suite.DotProto.Generate.Swagger.Wrappers - build-depends: swagger2 ==2.8.6 + build-depends: swagger2 >=2.1.6 && <=2.8.6 cpp-options: -DSWAGGER if flag(swagger-wrapper-format) hs-source-dirs: src/swagger-wrapper-format @@ -67,7 +67,7 @@ library if flag(large-records) -- large-records support uses newer Dhall APIs. So we need at least 1.34. - build-depends: dhall >=1.34 && < 1.41.2, + build-depends: dhall >=1.34 && <= 1.41.2, large-generics, large-records cpp-options: -DLARGE_RECORDS @@ -148,7 +148,7 @@ test-suite tests if flag(dhall) other-modules: TestDhall - build-depends: dhall >=1.13 && < 1.41.2 + build-depends: dhall >=1.13 && <= 1.41.2 cpp-options: -DDHALL if flag(swagger)