I've created some automation to split up a monolithic set of protobuf files into a set of fine-grained proto_library and cpp_proto_library build rules in an attempt to get the most out of Bazel for our C++ builds. The automation produces build rules that work great when using clang. Unfortunately, this does not work on one of our target platforms. On ARM, gcc8 complains about argument lists being too long.
ERROR: /path/to/workspace/src/somelib/BUILD:14:11: Compiling src/somelib/somecode.cpp failed: (Exit 1): arm-linux-gnueabihf-gcc failed: error executing command (from target //src/somelib:lib) external/local_arm_cc_toolchains/wrappers/arm-linux-gnueabihf-gcc '--sysroot=external/arm_gcc_8_3_0/arm-linux-gnueabihf/libc' -Bexternal/arm_gcc_8_3_0/bin ... (remaining 3991 arguments skipped)This is because I now have hundreds of compiler flags for every cc_* rule that indirectly depends on the full set of generated protos and C++ headers:
-isystem external/my_defs_repo/my_defs/foo_message_cc_pbCan we abbreviate these subcommands? I can use output_mode = "NO_PREFIX" in cpp_proto_library to get all headers in one output directory, but Bazel still tries to include some rule-specific paths instead of the flattened-out directory.
This is what my output directory looks like under bazel-out/armeabi-v7a-opt/bin/external/my_defs_repo/my_defs:
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/efd51666-1767-4664-bd61-2f2d7fb1c125n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAKaOXigHSwVG1qVdwmoGMZZtrqrffxew%2B1V1a-0Vx8XUjnEdmg%40mail.gmail.com.