rules_proto
rules_proto copied to clipboard
protoc: argument list too long
Building a rules_proto bazel rule results in below error:
Use --sandbox_debug to see verbose messages from the sandbox
2022/05/16 09:28:09 error running protoc: fork/exec bazel-out/k8-opt-exec-2B5CBBC6/bin/rules/proto/protoc: argument list too long
How to handle such errors?
We should "spill" the argv into a flagfile, but it requires protoc
to support that. Internally, Google handles this by modifying the kernel to allow a tremendous amount of data in argv.
This was most likely fixed by changes in proto_common not to add -I flag for each proto file transitively. Now the amount of flags passed to protoc is pretty small. And we even got about 5% wall time back.
This is the change: https://github.com/bazelbuild/bazel/commit/699f3e8b61c217583436b99795341461587a3180
Also, we're already using params files for invoking protoc.