# Is anyone using the protobufs compiler plug-in? (It doesn't do the right thing for "package" and "import")

**URL:** <https://swi-prolog.discourse.group/t/is-anyone-using-the-protobufs-compiler-plug-in-it-doesnt-do-the-right-thing-for-package-and-import/9877>\
**Category:** Discussion\
**Tags:** bug, discussion\
**Created:** [October 30, 2026, 7:22pm UTC](https://swi-prolog.discourse.group/t/is-anyone-using-the-protobufs-compiler-plug-in-it-doesnt-do-the-right-thing-for-package-and-import/9877 "2026-10-30T19:22:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.ludemann](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/peter.ludemann/32/48_2.png) [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Post date:** [October 30, 2026, 7:22pm UTC](https://swi-prolog.discourse.group/t/is-anyone-using-the-protobufs-compiler-plug-in-it-doesnt-do-the-right-thing-for-package-and-import/9877/1 "2026-10-30T19:22:22Z")

</div>

Is anyone using the protobufs compiler (`protoc`) to create `*_pb.pl` files for the [probufs module](https://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/protobufs.html%27))?

I have discovered that the plugin (`protoc-gen-swipl`) doesn’t do the right thing for “package” and “import” statements, and changes to fix this wouldn’t be backward-compatible (although they would require only minor changes to code that uses them).

One of the changes that I’m thinking of would require the use of a file\_search\_path/2 directive … I propose that it use the alias `protobufs` or `protobufs_library`; but maybe `library` would suffice? For example, if file `/path/to/include/google/protobuf/compiler.proto` has

```prolog
package google.protobuf.compiler;
import google/protobuf/descriptor.proto;

```

then the generated `/path/to/modules/google/protobuf/compiler_pb.pl` would have a `:-use_module(protobufs(google/protobuf/descriptor_pb))` and would require a `file_search_path(protobufs, '/path/to/modules')`. There would also need to be some small changes to any `make` or `cmake` rules.
