Skip to content

Commit 59cc61b

Browse files
committed
fix generated files
1 parent bf607ac commit 59cc61b

File tree

13 files changed

+358
-18
lines changed

13 files changed

+358
-18
lines changed

src/flamenco/runtime/tests/fetch_and_generate.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
# Allow overriding proto version; default pinned
5-
PROTO_VERSION="${PROTO_VERSION:-v1.0.5}"
5+
PROTO_VERSION="${PROTO_VERSION:-v3.0.0}"
66
FLATCC="${FLATCC:-../../../../opt/bin/flatcc}"
77

88
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
@@ -42,3 +42,4 @@ fi
4242
# Generate flatbuffer headers
4343
rm -rf flatbuffers/generated/*
4444
$FLATCC --prefix=fd_ -a -I protosol/flatbuffers -r -o flatbuffers/generated/ protosol/flatbuffers/*.fbs
45+
python3 fixup_flatbuffers.py
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env python3
2+
3+
import pathlib
4+
5+
6+
def inject_pragmas(header_path: pathlib.Path) -> bool:
7+
"""Ensure the header is wrapped in GCC diagnostic pragmas."""
8+
text = header_path.read_text()
9+
updated = False
10+
11+
if "#pragma GCC diagnostic push" not in text:
12+
text = (
13+
"#pragma GCC diagnostic push\n"
14+
'#pragma GCC diagnostic ignored "-Wmisleading-indentation"\n\n'
15+
+ text
16+
)
17+
updated = True
18+
19+
if "#pragma GCC diagnostic pop" not in text:
20+
text = text.rstrip() + "\n\n#pragma GCC diagnostic pop\n"
21+
updated = True
22+
23+
if updated:
24+
header_path.write_text(text)
25+
26+
return updated
27+
28+
29+
def main() -> None:
30+
script_dir = pathlib.Path(__file__).resolve().parent
31+
headers_dir = script_dir / "flatbuffers" / "generated"
32+
33+
if not headers_dir.is_dir():
34+
raise SystemExit(f"Missing generated headers directory: {headers_dir}")
35+
36+
for header in sorted(headers_dir.glob("*.h")):
37+
changed = inject_pragmas(header)
38+
action = "updated" if changed else "skipped"
39+
print(f"{action}: {header}")
40+
41+
42+
if __name__ == "__main__":
43+
main()
44+

src/flamenco/runtime/tests/flatbuffers/generated/context_builder.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#pragma GCC diagnostic push
2+
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
3+
14
#ifndef CONTEXT_BUILDER_H
25
#define CONTEXT_BUILDER_H
36

4-
/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */
7+
/* Generated by flatcc 0.6.2 FlatBuffers schema compiler for C by dvide.com */
58

69
#ifndef CONTEXT_READER_H
710
#include "context_reader.h"
@@ -244,3 +247,5 @@ static fd_org_solana_sealevel_v2_VoteAccount_ref_t fd_org_solana_sealevel_v2_Vot
244247

245248
#include "flatcc/flatcc_epilogue.h"
246249
#endif /* CONTEXT_BUILDER_H */
250+
251+
#pragma GCC diagnostic pop

src/flamenco/runtime/tests/flatbuffers/generated/context_reader.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
#pragma GCC diagnostic push
2+
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
3+
14
#ifndef CONTEXT_READER_H
25
#define CONTEXT_READER_H
36

4-
/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */
7+
/* Generated by flatcc 0.6.2 FlatBuffers schema compiler for C by dvide.com */
58

69
#ifndef FLATBUFFERS_COMMON_READER_H
710
#include "flatbuffers_common_reader.h"
@@ -273,3 +276,5 @@ __flatbuffers_define_scalar_field(1, fd_org_solana_sealevel_v2_VoteAccount, stak
273276

274277
#include "flatcc/flatcc_epilogue.h"
275278
#endif /* CONTEXT_READER_H */
279+
280+
#pragma GCC diagnostic pop

0 commit comments

Comments
 (0)