Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package protobuf standard library within the generator #192

Open
Lupus opened this issue Feb 17, 2023 · 1 comment
Open

Package protobuf standard library within the generator #192

Lupus opened this issue Feb 17, 2023 · 1 comment

Comments

@Lupus
Copy link
Contributor

Lupus commented Feb 17, 2023

It seems protobuf tooling assumes that certain files are available to the compiler without being explicitly present in include paths, like google/protobuf/descriptor.proto.

ocaml-protoc is quite relaxed in terms of Proto options, but protoc plugin for Golang requires all options to be properly defined, and all required .proto files to be included in order to extend the options, but if I put the actual file in the include path - protobuf linters get confused about duplicate definitions.

Probably it makes sense to bundle this protobuf stdlib along with ocaml-protoc so that one could include google/protobuf/descriptor.proto without it being present explicitly on the file system. [ppx_blob] can be useful for this to lift the file contents during compilation to strings, and them some building some map out of those - at least that's what I'm going to do with my forked ocaml-protoc binary for now.

@c-cube
Copy link
Collaborator

c-cube commented Feb 9, 2024

There's no need for ppx_blob, a tiny bit of dune magic can suffice. But overall I think it's fine to do this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants