rules_proto icon indicating copy to clipboard operation
rules_proto copied to clipboard

protoc: argument list too long

Open mohitkriplani1998 opened this issue 2 years ago • 4 comments

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?

mohitkriplani1998 avatar May 16 '22 18:05 mohitkriplani1998

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.

alexeagle avatar Sep 26 '23 15:09 alexeagle

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.

comius avatar Sep 26 '23 15:09 comius

This is the change: https://github.com/bazelbuild/bazel/commit/699f3e8b61c217583436b99795341461587a3180

comius avatar Sep 26 '23 15:09 comius

Also, we're already using params files for invoking protoc.

comius avatar Sep 26 '23 15:09 comius