Hey, I’m trying to build pants locally (`pants te...
# general
m
Hey, I’m trying to build pants locally (
pants test src/python/pants/util/frozendict_test.py
) and the Cargo build fails on
Unrecognized syntax identifier \"proto3\".  This parser only recognizes \"proto2\"
. Has anyone encountered that before? I’m working on a Mac M1.
b
Sorry for the trouble. Can you provide more context for the error message?
e
I think this just means Pants has a build requirement of
protoc
, which you've met, but further, it needs a
protoc
compiler that is new enough to understand proto3. @melodic-lighter-17242 the protobuf compiler installed on your machine is so simply too old for hacking on Pants itself. You'll either need to upgrade your protobuf compiler or work in a vm / container dedicated to Pants hacking that has a newer protobuf compiler installed.
Similar to this issue, except there,
protoc
was not installed at all: https://github.com/pantsbuild/pants/issues/19781
Reading that issue's CI failure log link, you find: https://gist.github.com/jsirois/12d969056bcb315c5589409fd1dce013 That has useful information, namely you can steer which
protoc
to use by setting the
PROTOC
environment variable. That would allow you to keep your old
protoc
and install a newer one elsewhere side by side and point Pants's build process to it.
m
Thanks! that’s exactly that. I have both protoc and protoc3, so I had to override protoc to also point to protoc3. The environment variable is extremely helpful, I’ll give that a try too