Skip to content

Commit 13545dc

Browse files
committed
attempt to use buf and create a buildable plan
1 parent 7388805 commit 13545dc

File tree

12 files changed

+9299
-39
lines changed

12 files changed

+9299
-39
lines changed

cabal.project

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ packages:
2020
cardano-api
2121
cardano-api-gen
2222
cardano-wasm
23-
-- TODO fix potential issues with build-type: Custom and protoc and reenable
24-
-- cardano-rpc
23+
cardano-rpc
2524

2625
extra-packages: Cabal, process
2726

@@ -56,6 +55,19 @@ write-ghc-environment-files: always
5655
jobs: $ncpus
5756
semaphore: True
5857

58+
constraints:
59+
, hedgehog == 1.5
60+
, lifted-async == 0.10.2.7
61+
, random == 1.2.1.3
62+
, tls == 2.1.6
63+
, optparse-applicative==0.18.1.0
64+
, kes-agent == 0.1.0.1
65+
66+
allow-newer:
67+
-- https://github.com/kapralVV/Unique/issues/11
68+
, Unique:hashable
69+
, kes-agent:filepath
70+
5971
if impl (ghc >= 9.12)
6072
allow-newer:
6173
-- https://github.com/kapralVV/Unique/issues/11

cardano-rpc/Setup.hs

Lines changed: 0 additions & 10 deletions
This file was deleted.

cardano-rpc/buf.gen.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: v1
2+
3+
managed:
4+
enabled: true
5+
6+
plugins:
7+
# node
8+
# - plugin: es
9+
# out: gen/node/src
10+
# opt:
11+
# - target=ts
12+
#
13+
# - plugin: connect-es
14+
# out: gen/node/src
15+
# opt:
16+
# - target=ts
17+
#
18+
# - plugin: buf.build/bufbuild/protoschema-jsonschema
19+
# out: gen/jsonschema/schema
20+
21+
# haskell
22+
23+
- plugin: haskell-protolens
24+
path: proto-lens-protoc
25+
out: gen
26+

cardano-rpc/cardano-rpc.cabal

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,11 @@ license-files:
1717
LICENSE
1818
NOTICE
1919

20-
build-type: Custom
20+
build-type: Simple
2121
extra-doc-files:
2222
CHANGELOG.md
2323
README.md
2424

25-
extra-source-files: proto/**/*.proto
26-
27-
custom-setup
28-
setup-depends:
29-
Cabal >=3.0 && <3.13,
30-
base >=4.14 && <5,
31-
proto-lens-setup >=0.4 && <0.5,
32-
3325
common project-config
3426
default-language: Haskell2010
3527
default-extensions:
@@ -50,7 +42,6 @@ common project-config
5042
library
5143
import: project-config
5244
hs-source-dirs: src
53-
build-tool-depends: proto-lens-protoc:proto-lens-protoc
5445
exposed-modules:
5546
Cardano.Rpc.Client
5647
Cardano.Rpc.Proto.Api.Node
@@ -65,35 +56,20 @@ library
6556
Cardano.Rpc.Server.Internal.UtxoRpc.Query
6657
Cardano.Rpc.Server.Internal.UtxoRpc.Submit
6758
Cardano.Rpc.Server.Internal.UtxoRpc.Type
68-
Proto.Cardano.Rpc.Node
69-
Proto.Cardano.Rpc.Node_Fields
70-
Proto.Utxorpc.V1alpha.Cardano.Cardano
71-
Proto.Utxorpc.V1alpha.Cardano.Cardano_Fields
72-
Proto.Utxorpc.V1alpha.Query.Query
73-
Proto.Utxorpc.V1alpha.Query.Query_Fields
74-
Proto.Utxorpc.V1alpha.Submit.Submit
75-
Proto.Utxorpc.V1alpha.Submit.Submit_Fields
7659

7760
other-modules:
7861
Cardano.Rpc.Server.Internal.Orphans
7962
Paths_cardano_rpc
8063

8164
autogen-modules:
8265
Paths_cardano_rpc
83-
Proto.Cardano.Rpc.Node
84-
Proto.Cardano.Rpc.Node_Fields
85-
Proto.Utxorpc.V1alpha.Cardano.Cardano
86-
Proto.Utxorpc.V1alpha.Cardano.Cardano_Fields
87-
Proto.Utxorpc.V1alpha.Query.Query
88-
Proto.Utxorpc.V1alpha.Query.Query_Fields
89-
Proto.Utxorpc.V1alpha.Submit.Submit
90-
Proto.Utxorpc.V1alpha.Submit.Submit_Fields
9166

9267
build-depends:
9368
aeson,
9469
base,
9570
bytestring,
9671
cardano-api >=10.17,
72+
cardano-rpc:gen,
9773
cardano-ledger-api,
9874
cardano-ledger-binary,
9975
cardano-ledger-conway,
@@ -111,6 +87,26 @@ library
11187
rio,
11288
text,
11389

90+
-- this should be replaced by utxorpc pacakge from hackage
91+
-- ideally we should upstream whatever is implemented in Proto.Cardano.Rpc.Node
92+
-- into utxorpc
93+
library gen
94+
import: project-config
95+
hs-source-dirs: gen
96+
exposed-modules:
97+
Proto.Cardano.Rpc.Node
98+
Proto.Cardano.Rpc.Node_Fields
99+
Proto.Utxorpc.V1alpha.Cardano.Cardano
100+
Proto.Utxorpc.V1alpha.Cardano.Cardano_Fields
101+
Proto.Utxorpc.V1alpha.Query.Query
102+
Proto.Utxorpc.V1alpha.Query.Query_Fields
103+
Proto.Utxorpc.V1alpha.Submit.Submit
104+
Proto.Utxorpc.V1alpha.Submit.Submit_Fields
105+
build-depends:
106+
proto-lens,
107+
proto-lens-protobuf-types,
108+
proto-lens-runtime,
109+
114110
test-suite cardano-rpc-test
115111
import: project-config
116112
hs-source-dirs: test/cardano-rpc-test
@@ -123,8 +119,9 @@ test-suite cardano-rpc-test
123119
cardano-ledger-conway,
124120
cardano-ledger-core,
125121
cardano-rpc,
122+
cardano-rpc:gen,
126123
containers,
127-
hedgehog >=1.1,
124+
hedgehog ^>=1.5,
128125
rio,
129126
tasty,
130127
tasty-hedgehog,

0 commit comments

Comments
 (0)