You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
After some updates in the compiler, it might be useful to recompile the standard Google proto files. As the proto files
6
+
are distributed with `protoc`, their path might depend on your installation.
7
+
8
+
```bash
9
+
mkdir lib
10
+
protoc \
11
+
--python_betterproto2_opt=INCLUDE_GOOGLE \
12
+
--python_betterproto2_out=lib \
13
+
-I /usr/include/ \
14
+
/usr/include/google/protobuf/*.proto
15
+
```
16
+
17
+
The generated files should be distributed in the `betterproto2` package.
18
+
19
+
!!! warning
20
+
These proto files are written with the `proto2` syntax, which is not supported by betterproto. For the compiler to
21
+
work, you need to manually patch the generated file to mark the field `oneof_index` in `Field` and
22
+
`FieldDescriptorProto` optional.
23
+
24
+
In the compiler, you also need to compile the [plugin.proto](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/compiler/plugin.proto)
25
+
file in `src/betterproto2_compiler/lib/google.protobug/compiler/__init__.py`.
0 commit comments