``` thread 'main' panicked at /Users/sj/.cargo/re...
# development
w
Copy code
thread 'main' panicked at /Users/sj/.cargo/registry/src/index.crates.io-6f17d22bba15001f/prost-build-0.12.3/src/lib.rs:1521:10:
  Could not find `protoc` installation and this build crate cannot proceed without
      this knowledge. If `protoc` is installed and this crate had trouble finding
      it, you can set the `PROTOC` environment variable with the specific path to your
      installed `protoc` binary.You could try running `brew install protobuf` or downloading it from <https://github.com/protocolbuffers/protobuf/releases>
Has protoc always been a dep? I just built from main, and I got this for the first time. I don’t know if I’ve just always had a protoc in the path otherwise
b
I think it changed to have to be provided externally in https://github.com/pantsbuild/pants/pull/19517 (see also https://github.com/pantsbuild/pants/pull/19582 for related change)
w
Ah oaky, thanks! I remember seeing that originally, but I couldn’t find it again while I was browsing
f
Has protoc always been a dep? I just built from main, and I got this for the first time. I don’t know if I’ve just always had a protoc in the path otherwise
Yes. It is just that the
prost
crate authors decided to stop supplying the
protoc
binary in the crate due to software supply chain concerns.
g
We built https://github.com/EmbarkStudios/proto-gen to work around this because we ban both cmake and try to avoid "host-provided tools" for reproducibility reasons.
I'm also investigating proto in my rust plugin, but that'd be a pants-builds-pants-bootstrap thing which is worrisome.
f
frankly it would be nice if
prost
just had its own
.proto
parser to generate proto descriptors instead of relying on
protoc
to generate those descriptors. otherwise the code generation part doesn't depend on
protoc
, just the parsing of the files to get the descriptors (with the descriptors used for codegen)
w
I guess I’m on the side of being cool with vendoring binaries without stressing about it too much. Ensure the hashes match and 🤷 My days are far better spent looking for typos in my python or rust deps and not accidentally grabbing malicious/squatted libs
b
yeah, https://github.com/pantsbuild/pants/pull/19853 improves that as part of the (progressive) move to being able to let Pants orchestrate building the Rust code.