Skip to content

Commit 243d7b6

Browse files
committed
added automatic patching of grpc compilation failures to script; did not refactor the code
1 parent a0fb50f commit 243d7b6

File tree

7 files changed

+74
-12
lines changed

7 files changed

+74
-12
lines changed

lib/Concept.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4645,7 +4645,7 @@ instance HsJSONPB.ToSchema Relation_GetPlayersByRoleType_Req where
46454645
newtype Relation_GetPlayersByRoleType_ResPart = Relation_GetPlayersByRoleType_ResPart{relation_GetPlayersByRoleType_ResPartRoleTypesWithPlayers
46464646
::
46474647
Hs.Vector
4648-
Concept.GetPlayersByRoleType_RoleTypeWithPlayer}
4648+
Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer}
46494649
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic,
46504650
Hs.NFData)
46514651

@@ -4665,14 +4665,14 @@ instance HsProtobuf.Message Relation_GetPlayersByRoleType_ResPart
46654665
= (Hs.mconcat
46664666
[(HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1)
46674667
(Hs.coerce
4668-
@(Hs.Vector Concept.GetPlayersByRoleType_RoleTypeWithPlayer)
4669-
@(HsProtobuf.NestedVec Concept.GetPlayersByRoleType_RoleTypeWithPlayer)
4668+
@(Hs.Vector Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer)
4669+
@(HsProtobuf.NestedVec Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer)
46704670
relation_GetPlayersByRoleType_ResPartRoleTypesWithPlayers))])
46714671
decodeMessage _
46724672
= (Hs.pure Relation_GetPlayersByRoleType_ResPart) <*>
46734673
(Hs.coerce
4674-
@(_ (HsProtobuf.NestedVec Concept.GetPlayersByRoleType_RoleTypeWithPlayer))
4675-
@(_ (Hs.Vector Concept.GetPlayersByRoleType_RoleTypeWithPlayer))
4674+
@(_ (HsProtobuf.NestedVec Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer))
4675+
@(_ (Hs.Vector Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer))
46764676
(HsProtobuf.at HsProtobuf.decodeMessageField
46774677
(HsProtobuf.FieldNumber 1)))
46784678
dotProto _
@@ -13012,4 +13012,4 @@ instance HsJSONPB.ToSchema AttributeType_GetInstances_ResPart where
1301213012
HsJSONPB._schemaProperties =
1301313013
HsJSONPB.insOrdFromList
1301413014
[("things",
13015-
attributeType_GetInstances_ResPartThings)]}})
13015+
attributeType_GetInstances_ResPartThings)]}})

lib/Transaction.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ instance HsJSONPB.ToSchema Transaction_Stream_Req where
16151615
newtype Transaction_Stream_ResPart = Transaction_Stream_ResPart{transaction_Stream_ResPartState
16161616
::
16171617
HsProtobuf.Enumerated
1618-
Transaction.Stream_State}
1618+
Transaction.Transaction_Stream_State}
16191619
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData)
16201620

16211621
instance HsProtobuf.Named Transaction_Stream_ResPart where
@@ -1921,4 +1921,4 @@ instance HsJSONPB.ToSchema Transaction_Rollback_Res where
19211921
Hs.mempty{HsJSONPB._paramSchemaType =
19221922
Hs.Just HsJSONPB.SwaggerObject},
19231923
HsJSONPB._schemaProperties =
1924-
HsJSONPB.insOrdFromList []}})
1924+
HsJSONPB.insOrdFromList []}})

lib/patches/Concept.patch

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--- Concept.hs 2021-05-08 10:48:32.812379707 +0200
2+
+++ Concept.patched.hs 2021-05-08 11:19:53.308953702 +0200
3+
@@ -4645,7 +4645,7 @@
4+
newtype Relation_GetPlayersByRoleType_ResPart = Relation_GetPlayersByRoleType_ResPart{relation_GetPlayersByRoleType_ResPartRoleTypesWithPlayers
5+
::
6+
Hs.Vector
7+
- Concept.GetPlayersByRoleType_RoleTypeWithPlayer}
8+
+ Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer}
9+
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic,
10+
Hs.NFData)
11+
12+
@@ -4665,14 +4665,14 @@
13+
= (Hs.mconcat
14+
[(HsProtobuf.encodeMessageField (HsProtobuf.FieldNumber 1)
15+
(Hs.coerce
16+
- @(Hs.Vector Concept.GetPlayersByRoleType_RoleTypeWithPlayer)
17+
- @(HsProtobuf.NestedVec Concept.GetPlayersByRoleType_RoleTypeWithPlayer)
18+
+ @(Hs.Vector Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer)
19+
+ @(HsProtobuf.NestedVec Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer)
20+
relation_GetPlayersByRoleType_ResPartRoleTypesWithPlayers))])
21+
decodeMessage _
22+
= (Hs.pure Relation_GetPlayersByRoleType_ResPart) <*>
23+
(Hs.coerce
24+
- @(_ (HsProtobuf.NestedVec Concept.GetPlayersByRoleType_RoleTypeWithPlayer))
25+
- @(_ (Hs.Vector Concept.GetPlayersByRoleType_RoleTypeWithPlayer))
26+
+ @(_ (HsProtobuf.NestedVec Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer))
27+
+ @(_ (Hs.Vector Concept.Relation_GetPlayersByRoleType_RoleTypeWithPlayer))
28+
(HsProtobuf.at HsProtobuf.decodeMessageField
29+
(HsProtobuf.FieldNumber 1)))
30+
dotProto _
31+
@@ -13012,4 +13012,4 @@
32+
HsJSONPB._schemaProperties =
33+
HsJSONPB.insOrdFromList
34+
[("things",
35+
- attributeType_GetInstances_ResPartThings)]}})
36+
\ No newline at end of file
37+
+ attributeType_GetInstances_ResPartThings)]}})

lib/patches/Transaction.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- Transaction.hs 2021-05-08 11:32:02.658198356 +0200
2+
+++ Transaction.patch.hs 2021-05-08 11:32:59.136637643 +0200
3+
@@ -1615,7 +1615,7 @@
4+
newtype Transaction_Stream_ResPart = Transaction_Stream_ResPart{transaction_Stream_ResPartState
5+
::
6+
HsProtobuf.Enumerated
7+
- Transaction.Stream_State}
8+
+ Transaction.Transaction_Stream_State}
9+
deriving (Hs.Show, Hs.Eq, Hs.Ord, Hs.Generic, Hs.NFData)
10+
11+
instance HsProtobuf.Named Transaction_Stream_ResPart where
12+
@@ -1921,4 +1921,4 @@
13+
Hs.mempty{HsJSONPB._paramSchemaType =
14+
Hs.Just HsJSONPB.SwaggerObject},
15+
HsJSONPB._schemaProperties =
16+
- HsJSONPB.insOrdFromList []}})
17+
\ No newline at end of file
18+
+ HsJSONPB.insOrdFromList []}})

lib/test.hs

Whitespace-only changes.

newFile.orig

Whitespace-only changes.

recompile-protocol.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,22 @@ for e in $protoFiles; do
2121

2222
done
2323

24-
# now compile all proto files
25-
protoFiles=$(find ./lib/fixedProtobuf/ -name "*.proto" \
26-
| grep -v "cluster")
27-
24+
# now compile and patch all proto files
2825
for e in ./lib/fixedProtobuf/*.proto; do
2926
echo "compiling $e"
3027
# compile proto file
3128
compile-proto-file \
3229
--includeDir $(dirname $e) \
3330
--proto $(basename $e) \
3431
--out ./lib/
32+
33+
34+
newFile=$(ls -t ./lib/*.hs | head -1)
35+
protoFileName=$(basename $newFile | cut -f 1 -d '.')
36+
if [ -f ./lib/patches/$protoFileName.patch ]; then
37+
echo "found $protoFileName.patch"
38+
patch $newFile < ./lib/patches/$protoFileName.patch
39+
fi
3540
done
41+
42+
echo "Finished recompilation and patching"

0 commit comments

Comments
 (0)