How to avoid compiling protobuf compiler and use precompiled protoc?

6,284 views
Skip to first unread message

Box Taken

unread,
Aug 27, 2021, 4:12:58 AM8/27/21
to bazel-discuss
Hi,

I have some projects using Bazel and protobuf. I also use gitlab CI/CD to build, test, check coverage, etc.

The problem is that when the project compiles first time it also compiles a protobuf compiler, which adds about 15 minutes to each step (the step itself takes 1-5 minutes).

I would really like not to compile protobuf when the binary is already available and save 15 minutes on each step.

I am using a setup example from this doc:

Created a simple C++ hello world example:

When using "com_google_protobuf" dependency, then it compiles protobuf and it takes 15 minues (build log). Even though protoc is available on the system (screenshot).

When I overridden protoc as described here, it stopped building, failed on building ":person_cc_proto" step with the following error:

```bash
$ bazel build :person_cc_proto
WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE.
ERROR: /home/path/issue-bazel-protobuf-compile/BUILD:2:14: in :aspect_cc_proto_toolchain attribute of BazelCcProtoAspect aspect on proto_library rule //:person_proto: '@local_config_cc//:toolchain' does not have mandatory providers: ProtoLangToolchainProvider
ERROR: Analysis of target '//:person_cc_proto' failed; build aborted: Analysis of target '//:person_proto' failed
INFO: Elapsed time: 0.124s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 25 targets configured)
```


But additionally thought asking here might also help.

Could you please help me avoid protobuf compilation and use precompiled binary which is already availabe and save 15 min on every step?

Thank you!
BT

Derek Perez

unread,
Aug 27, 2021, 2:33:04 PM8/27/21
to Box Taken, bazel-discuss
Something doesn't seem right, you should only have to compile protoc once per graph run, and each subsequent step should be using a compiled binary. In your case, I assume you're not reusing the build cache across CI runs (although you probably could safely), so it would still be a cost to build per run, but it shouldn't be per-step.

Are you attempting to change the compiler with --proto-compiler? What did you set it to?

--
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/b34ad96a-710e-406f-9ea4-d7081395b491n%40googlegroups.com.

Box Taken

unread,
Aug 27, 2021, 2:39:31 PM8/27/21
to bazel-discuss
> In your case, I assume you're not reusing the build cache across CI runs (although you probably could safely)

That is correct. 
I did not set up anything like that. 
Mostly because I do baby steps in learning both bazel and gitlab CI/CD.

Any pointers on how to do that are very much appreciated. 
Even though it does not solve the problem completely, but will reduce total time by the amount of steps.

> ...it would still be a cost to build per run...

Right, that's the thing I would really like to get rid of.

Box Taken

unread,
Aug 27, 2021, 2:48:19 PM8/27/21
to bazel-discuss
> Are you attempting to change the compiler with --proto-compiler? What did you set it to?

Yes.
Here is example project. For reference I looked at google/startub-os project.

1) I overwrite proto_compiler and proto_toolchain_for_cc in .bazelrc file

2) protoc and proto_lang_toolchain are defined in tools/ folder

3) in the WORKSPACE I do binding for proto_compiler and cc_toolchain.
It also has to download the executable file.
But I would like to avoid that as well, since I built all the necessary tools in a docker file, I use it as an image for running my CI/CD jobs, and this image has protoc installed on the system (checked it with `protoc --version`).

After all those steps I am able to build `:person_proto` target, but building `:person_cc_proto` target still fails.
```
$ bazel build :person_cc_proto WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE. ERROR: /home/.../issue-bazel-protobuf-compile/BUILD:2:14: in :aspect_cc_proto_toolchain attribute of BazelCcProtoAspect aspect on proto_library rule //:person_proto: '@local_config_cc//:toolchain' does not have mandatory providers: ProtoLangToolchainProvider ERROR: Analysis of target '//:person_cc_proto' failed; build aborted: Analysis of target '//:person_proto' failed INFO: Elapsed time: 0.124s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded, 25 targets configured)
```

I did not find much information when searching by keywords from this error.
I have no knowledge on how to debug bazel, because I know very little about it and just trying to setup a simple hello world example.


On Friday, 27 August 2021 at 20:33:04 UTC+2 de...@perez.earth wrote:

Derek Perez

unread,
Aug 27, 2021, 2:51:36 PM8/27/21
to Box Taken, bazel-discuss
But when I say "per run" I mean whole graph execution, originally, you mentioned this is build protoc at each step, which it should not be. OR, are you saying the way you have CI setup you're doing multiple isolated build graphs per step in the CI system?
I think I got confused by what step/run might be referring to RE: system stack level.

Are all of these CI steps running on the same VM in sequence? If so, the cache reuse should be happening for free unless you're actively disabling it somehow.


Derek Perez

unread,
Aug 27, 2021, 2:59:14 PM8/27/21
to Box Taken, bazel-discuss
OK, so @local_config_cc//:toolchain is a cc_toolchain, not a proto_lang_toolchain, and I think that might be causing the problem.

so try this @com_google_protobuf//:cc_toolchain instead.



Box Taken

unread,
Aug 27, 2021, 3:04:12 PM8/27/21
to bazel-discuss
Here is how simplified setup for CI/CD yaml file looks like:
```

stages:
  - build
  - test
  - coverage

build:
  stage: build
  script:
    - ./run_build_all.sh

tests:
  stage: test
  script:
    - ./run_tests.sh

coverage:
  stage: test
  script:
    - ./run_coverage.sh
```

Meaning there are 3 stages: build, test, coverage. 
Each is executed after the previous one is done.
Most probably they are isolated, because each of those stages takes 23 minutes (15 for compiling protobuf and 7-8 for the project itself).

When I modified this script into having only one stage and running all 3 *.sh scripts one after another the step took about 24 minutes.

Seems like isolated environment is a default behavior for stages. I did not actively disable anything.


Box Taken

unread,
Aug 27, 2021, 3:09:41 PM8/27/21
to bazel-discuss
I was using this link as a reference to setting up dependencies.
It specifically mention to overwrite both proto_compiler and <lang>_proto_library.

===
Implicit Dependencies and Proto Toolchains

The proto_library rule implicitly depends on @com_google_protobuf//:protoc, which is the protocol buffer compiler. It must be a binary rule (in protobuf, it's a cc_binary). The rule can be overridden using the --proto_compiler command-line flag.

Most <lang>_proto_library rules implicitly depend on @com_google_protobuf//:<lang>_toolchain, which is a proto_lang_toolchain rule. These rules can be overridden using the --proto_toolchain_for_<lang> command-line flags.

A proto_lang_toolchain rule describes how to call the protocol compiler, and what is the library (if any) that the resulting generated code needs to compile against. See an example in the protobuf repository.
===

Here is a similar example, but for Java: https://github.com/google/startup-os/blob/master/.bazelrc

Box Taken

unread,
Aug 27, 2021, 3:13:41 PM8/27/21
to bazel-discuss
I am not sure I understand this. You provided 2 links which are the same, is it intentional?

> so try this @com_google_protobuf//:cc_toolchain instead.

I tried 2 things:
1) removed overwriting --proto_toolchain_for_cc  from .bazelrc
and
2) changed line #2 to the following: --proto_toolchain_for_cc @com_google_protobuf//:cc_toolchain

In both cases I got the following error:

```
$ bazel build :person_cc_proto
WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE.
ERROR: /home/.../issue-bazel-protobuf-compile/BUILD:2:14: every rule of type proto_library implicitly depends upon the target '@com_google_protobuf//:cc_toolchain', but this target could not be found because of: no such package '@com_google_protobuf//': The repository '@com_google_protobuf' could not be resolved
ERROR: Analysis of target '//:person_cc_proto' failed; build aborted: Evaluation of aspect BazelCcProtoAspect on //:person_proto failed: com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package '@com_google_protobuf//': The repository '@com_google_protobuf' could not be resolved
INFO: Elapsed time: 0.101s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)

```

On Friday, 27 August 2021 at 20:59:14 UTC+2 de...@perez.earth wrote:

Austin Schuh

unread,
Aug 27, 2021, 3:14:30 PM8/27/21
to Box Taken, bazel-discuss
Bazel is happy to build and test at the same time, and will start executing tests in parallel with continued builds.  Combining those two should be a win.

Coverage will typically require different flags and makes sense as another target.

Derek Perez

unread,
Aug 27, 2021, 3:19:23 PM8/27/21
to Box Taken, bazel-discuss
This must be an implementation detail of how Gitlab CI works, so you're not guaranteed to run these stages on the same VM which is probably generally a good thing.

On Fri, Aug 27, 2021 at 12:04 PM Box Taken <boxt...@gmail.com> wrote:

Box Taken

unread,
Sep 4, 2021, 3:18:59 PM9/4/21
to bazel-discuss
A friendly ping.

After overwriting proto_compiler and proto_toolchain_for_cc in .bazelrc I am still blocked on the following error:

```
$ bazel build :person_cc_proto
ERROR: /home/.../issue-bazel-protobuf-compile/BUILD:2:14: in :aspect_cc_proto_toolchain attribute of BazelCcProtoAspect aspect on proto_library rule //:person_proto: '@local_config_cc//:toolchain' does not have mandatory providers: ProtoLangToolchainProvider
ERROR: Analysis of target '//:person_cc_proto' failed; build aborted: Analysis of target '//:person_proto' failed
INFO: Elapsed time: 0.321s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 13 targets configured)
```

Can anyone give me a hand please?

Derek Perez

unread,
Sep 4, 2021, 3:51:23 PM9/4/21
to Box Taken, bazel-discuss
Try referencing the proto lang tool chain rule you made in tools/BUILD in bazelrc, the current one you have set to external isn't a proto lang tool chain, I think. 

Box Taken

unread,
Sep 6, 2021, 3:51:17 AM9/6/21
to bazel-discuss
I have rearranged my project a little bit to separate different implementations:

- v1
  - Builds protobuf from sources
  - No failures, but spends time on building protoc compiler (from 8 to 15 minutes, depending on CI/CD runner)
- v2
  - Uses pre-installed protoc, builds in 2 steps: (1) builds proto files and puts them into a separate library in proto-bin folder (2) builds all with bazel
  - Unfortunately it fails to link google protobuf sources that are used in generated person.pb.cc, person.pb.h files
- v3
  - Uses pre-installed protoc, but builds all with bazel (with steps suggested in this thread overwriting proto_compiler in .bazelrc, etc)
  - Unfortunately it fails with the same error as v2
Error for v2:
```
ERROR: /builds/mvfwd/issue-bazel-protobuf-compile/v2/proto-bin/BUILD:4:11: Compiling proto-bin/person.pb.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 16 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
In file included from proto-bin/person.pb.cc:4:
proto-bin/person.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
   10 | #include <google/protobuf/port_def.inc>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
```

Error for v3:
```
ERROR: /builds/mvfwd/issue-bazel-protobuf-compile/v3/BUILD:14:10: Compiling main.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF bazel-out/k8-fastbuild/bin/_objs/main/main.pic.d ... (remaining 19 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
In file included from main.cc:2:
bazel-out/k8-fastbuild/bin/person.pb.h:10:10: fatal error: google/protobuf/port_def.inc: No such file or directory
10 | #include <google/protobuf/port_def.inc>
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
```

Seems like I am missing some dependencies. What am I doing wrong?

Derek Perez

unread,
Sep 6, 2021, 12:47:24 PM9/6/21
to Box Taken, bazel-discuss
Pretty sure you need to uncomment this and provide an actual runtime:

The generated code depends on the library that is provided here, ultimately to resolve as the generated source code gets compiled itself. 

Box Taken

unread,
Sep 7, 2021, 4:09:45 PM9/7/21
to bazel-discuss
Done: https://gitlab.com/mvfwd/issue-bazel-protobuf-compile/-/blob/main/v3/tools/BUILD#L15

But unfortunately it fails with a lot of `error: undefined reference to 'google::protobuf::internal::...`

Derek Perez

unread,
Sep 7, 2021, 4:20:18 PM9/7/21
to Box Taken, bazel-discuss
you're linking in protoc as a runtime, the compiler does not belong there, a _runtime_ belongs there. The errors you are getting are undefined references to the classes provided by a runtime. You need to precompile the runtime and provide it there in this case, the compiler isn't a runtime.
It's worth noting that we do not publish precompiled C++ runtime libraries, this is left to end users to provide for themselves because there are many environment-specific concerns to take into account.

If you wanted to pre-compile it using Bazel for your needs, this is the target:

asdf zxcv

unread,
Sep 8, 2021, 11:15:11 AM9/8/21
to bazel-discuss
A friendly ping.
After overwriting proto_compiler and proto_toolchain_for_cc in .bazelrc I am still blocked on that error:

```
$ bazel build :person_cc_proto
ERROR: /home/.../issue-bazel-protobuf-compile/BUILD:2:14: in :aspect_cc_proto_toolchain attribute of BazelCcProtoAspect aspect on proto_library rule //:person_proto: '@local_config_cc//:toolchain' does not have mandatory providers: ProtoLangToolchainProvider
ERROR: Analysis of target '//:person_cc_proto' failed; build aborted: Analysis of target '//:person_proto' failed
INFO: Elapsed time: 0.321s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 13 targets configured)
```

Can anyone give me a hand please?

Derek Perez

unread,
Sep 8, 2021, 11:24:38 AM9/8/21
to asdf zxcv, bazel-discuss
Hi the solutions are being provided to you over in the protobuf mailing list. 

Box Taken

unread,
Sep 8, 2021, 2:21:39 PM9/8/21
to Derek Perez, bazel-discuss
Thank you, for your help.

As for a person with no bazel experience, trying to take baby steps all that seems a bit complicated.
At first it seemed excessive to spend time on compiling protoc when it was available on the system.
And it looked like a low hanging fruit, with possibly one line change to switch into more optimal mode.
Unfortunately after about 2 weeks and 20 emails I still don't understand what to do and suggestions look complicated to me.

Improving build time for my hello world project is "nice to have" rather than blocking issue.
Given all that I'll probably step aside and take a break from this task.

Thanks to everyone who tried to help. Sorry the solution was not found.


Tomo Suzuki

unread,
Jun 9, 2023, 10:54:45 AM6/9/23
to bazel-discuss
(I came across this thread when I was googling for a solution. Posting my case for later reference (public) )

For me, it worked as below:

Declare a repository for prebuilt protoc compiler in WORKSPACE (I use linux_x86_64):

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "com_google_protobuf_protoc_linux_x86_64", build_file_content = 'exports_files(["bin/protoc"])', sha256 = "179a759581bf4b32cc5edae4ffce6b8ee16ba4f4ab99ad3a309c31113f98d472", urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-linux-x86_64.zip"], )


Then you can run normal build command with --proto_compiler=@com_google_protobuf_protoc_linux_x86_64//:bin/protoc:

suztomo@suztomo:~/work_proto_lib$ bazelisk clean
...
suztomo@suztomo:~/work_proto_lib$ bazelisk build --proto_compiler=@com_google_protobuf_protoc_linux_x86_64//:bin/protoc //google/type:postal_address_proto INFO: Analyzed target //google/type:postal_address_proto (5 packages loaded, 8 targets configured). INFO: Found 1 target... Target //google/type:postal_address_proto up-to-date: bazel-bin/google/type/postal_address_proto-descriptor-set.proto.bin INFO: Elapsed time: 0.379s, Critical Path: 0.02s

https://gist.github.com/suztomo/1207d16d7678faa14ecc4a9194786edd

Olivier Notteghem

unread,
Jun 9, 2023, 12:41:21 PM6/9/23
to Tomo Suzuki, bazel-discuss
Thanks for sharing. Do you snippet for x-platform version of this (which works on both darwin arm64 and linux)?

jayaprabhakar k

unread,
Feb 29, 2024, 2:06:04 PMFeb 29
to bazel-discuss
I tried what suztomo suggested.
For example: ```
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_google_protobuf_protoc_osx_aarch_64",

build_file_content = 'exports_files(["bin/protoc"])',
sha256 = "d0fcd6d3b3ef6f22f1c47cc30a80c06727e1eccdddcaf0f4a3be47c070ffd3fe",
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-osx-aarch_64.zip"],
)
```
(mac is less relevant for me, but easier to test locally than remotely on a different machine)

And ran it with 
```

bazel build --proto_compiler=@com_google_protobuf_protoc_osx_aarch_64//:bin/protoc //proto/...

INFO: Analyzed 18 targets (190 packages loaded, 13225 targets configured).
INFO: From Compiling src/google/protobuf/message_lite.cc [for tool]:
external/com_google_protobuf/src/google/protobuf/message_lite.cc:69:62: warning: 'ByteSize' is deprecated: Please use ByteSizeLong() instead [-Wdeprecated-declarations]
  if (PROTOBUF_PREDICT_FALSE(cached_size == nullptr)) return ByteSize();
                                                             ^
bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/message_lite.h:454:5: note: 'ByteSize' has been explicitly marked deprecated here
  [[deprecated("Please use ByteSizeLong() instead")]] int ByteSize() const {
    ^
1 warning generated.
INFO: From Linking external/com_google_protobuf/src/google/protobuf/io/libio_win32.a [for tool]:
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/external/com_google_protobuf/src/google/protobuf/io/libio_win32.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Linking external/com_google_protobuf/protoc [for tool]:
ld: warning: ignoring duplicate libraries: '-lm', '-lpthread'
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/timestamp_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/any_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/source_context_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/field_mask_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/type_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/struct_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/empty_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/api_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/duration_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/wrappers_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/compiler/plugin_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/descriptor_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: Found 18 targets...
INFO: Elapsed time: 49.644s, Critical Path: 19.43s
INFO: 815 processes: 307 internal, 508 darwin-sandbox.
INFO: Build completed successfully, 815 total actions

```

Without, the prebuilt library.

```
bazel build  //proto/...                                          
INFO: Analyzed 18 targets (193 packages loaded, 13687 targets configured).
INFO: From Compiling src/google/protobuf/stubs/strutil.cc [for tool]:
external/protobuf~3.19.6/src/google/protobuf/stubs/strutil.cc:506:11: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
          sprintf(dest + used, (use_hex ? "\\x%02x" : "\\%03o"),
          ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:180:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.
INFO: From Linking external/protobuf~3.19.6/protoc [for tool]:
ld: warning: ignoring duplicate libraries: '-lm', '-lpthread'
INFO: From Linking external/com_google_protobuf/src/google/protobuf/io/libio_win32.a [for tool]:
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/external/com_google_protobuf/src/google/protobuf/io/libio_win32.a the table of contents is empty (no object file members in the library define global symbols)
INFO: From Compiling src/google/protobuf/message_lite.cc [for tool]:
external/com_google_protobuf/src/google/protobuf/message_lite.cc:69:62: warning: 'ByteSize' is deprecated: Please use ByteSizeLong() instead [-Wdeprecated-declarations]
  if (PROTOBUF_PREDICT_FALSE(cached_size == nullptr)) return ByteSize();
                                                             ^
bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/message_lite.h:454:5: note: 'ByteSize' has been explicitly marked deprecated here
  [[deprecated("Please use ByteSizeLong() instead")]] int ByteSize() const {
    ^
1 warning generated.
INFO: From Linking external/com_google_protobuf/protoc [for tool]:
ld: warning: ignoring duplicate libraries: '-lm', '-lpthread'
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/any_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/timestamp_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/struct_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/duration_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/empty_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/api_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/field_mask_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/wrappers_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/type_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/compiler/plugin_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/source_context_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: From ProtoCompile external/com_google_protobuf/python/google/protobuf/descriptor_pb2.py:
external/com_google_protobuf/.: warning: directory does not exist.
INFO: Found 18 targets...
INFO: Elapsed time: 58.117s, Critical Path: 30.52s
INFO: 1013 processes: 315 internal, 698 darwin-sandbox.
INFO: Build completed successfully, 1013 total actions


```
I could reproduce the same timing multiple times after bazel clean. I only have 4 tiny proto files, with no imports. There is a consistent 10s savings from the critical path though. I assume, there are multiple places with protoc dependencies.

Can someone help with this?
Reply all
Reply to author
Forward
0 new messages