https://pantsbuild.org/ logo
#general
Title
# general
b

big-xylophone-43403

06/30/2022, 8:33 PM
Protobuf/grpc integration with Pants 2.12.0 question 🧵
1
I’ve a need to use
protobuf==3.15.0
But Pants
2.12
defaults to
3.20.1
I instructed Pants to use the specific protoc version as documented here
But it looks like I need to provide the
--protoc-known-versions
as well. Which is a bit tedious.
Is there a better way to accomplish this?
Can Pants not use the same protoc version as the
protobuf
dependency specified in the requirements?
f

fast-nail-55400

06/30/2022, 8:49 PM
Which language (python/scala/java)?
b

big-xylophone-43403

06/30/2022, 8:50 PM
Sorry, forgot to mention
python
f

fast-nail-55400

06/30/2022, 8:55 PM
Passing the version from a resolve through to the tool config is non-trivial to do given how the code is currently written. (The config for the
protoc
binary is also used for other languages in Pants.) And the notion of “resolve” and tool config are separate in the code. A more tractable solution would be for Pants to contain the digests for most recent versions of
protoc
for the default value of
--protoc-known-versions
which would avoid the user having to fill it in. That was the solution used for
terraform
known versions in a recent PR.
b

big-xylophone-43403

06/30/2022, 8:59 PM
Thanks. That makes sense
Also, the recent versioning change will make it difficult to tie the protoc version with language specific protobuf lib version
2 Views