I think the entire problem is hard to answer without further investigation. So first I simply want to know how to introspect the problem.
Problem Overview
I use the protoc-gen-bq-schema plugin to assist with converting some large and complex protocol buffer messages into BigQuery schemas.
Until recently, I had an Ubuntu machine. I now have an M3 Mac, the Apple ARM64 chip. I can no longer get the plugin to work, but I can’t manage to introspect the problem: no errors, no messages, nothing. I’m not too savvy with how to use plugins with protoc
I carried over my command history from the previous machine, so I know I used to do exactly the same command that I’ve been trying now. It was fairly simple:
protoc --bq-schema_out . -I <the/path/to/the/proto/package> <the/path/to/the/proto/file/to/generate/the/schema>
After installing protoc
, Go, and the protoc-gen-bq-schema
plugin on my new computer, I tried that same command, and it returns with absolutely nothing, no input, no errors… nothing.
I tried something available by default with protoc
and it works perfectly:
protoc --python_out . -I <the/path/to/the/proto/package> <the/path/to/the/proto/file/to/generate/the/schema>
This generates the protobuf as a Python module, fully functional. So it seems clear that the problem is with the plugin (or with how protoc
interacts with the plugin).
I then tried to introspect, to see if I could understand what is going wrong, but I don’t really understand what I can do or how to do it. I tried the following:
> protoc-gen-bq-schema --help
Usage of protoc-gen-bq-schema:
-alsologtostderr
log to standard error as well as files
-log_backtrace_at value
when logging hits line file:N, emit a stack trace
-log_dir string
If non-empty, write log files in this directory
-logtostderr
log to standard error instead of files
-stderrthreshold value
logs at or above this threshold go to stderr
-v value
log level for V logs
-vmodule value
comma-separated list of pattern=N settings for file-filtered logging
So I tried to pass some type of logging:
protoc --bq-schema_out . --bq-schema_opt=-logtostderr <path/to/proto/file/to/generate/schema> -I <path/to/proto/package>
I wasn’t sure if I write --bq-schema_opt=-logtostderr
or --bq-schema_opt=logtostderr
or --bq-schema_opt=--logtostderr
. I tried them all, none worked. I also tried passing the v
(verbose) flag, nothing.
It seems as if, even though the protoc-gen-bq-schema
file is installed properly and can be called on its own, it isn’t being seen at all by protoc
. Or, it could be that the protoc-gen-bq-schema
plugin is not working correctly, but it can at least generate its help message.
Request
I don’t think it is possible to understand what is wrong with the plugin itself, but if you could help me understand how I can introspect protoc
, that would be great. I cannot get any output regarding what it is doing, so I cannot even begin to guess what I need to do to fix the problem.