Skip to content

Comments

Install protoc to avoid having to recompile it#452

Merged
agourlay merged 4 commits intomasterfrom
use-protoc-release
Apr 11, 2022
Merged

Install protoc to avoid having to recompile it#452
agourlay merged 4 commits intomasterfrom
use-protoc-release

Conversation

@agourlay
Copy link
Member

@agourlay agourlay commented Apr 8, 2022

prost-build is the longest compiling dependency we have according to cargo --timings.

This is due to prost compiling protocolbuffers as well during the build tokio-rs/prost#610

Tokio recommends to install the protoc binaries to optimize the compilation process https://github.com/tokio-rs/prost#protoc=

This PR adds sudo apt install protobuf-compiler to our CI jobs.

I tested this locally and it does work nicely.

@agourlay agourlay linked an issue Apr 8, 2022 that may be closed by this pull request
@agourlay
Copy link
Member Author

agourlay commented Apr 8, 2022

Lots of errors I need to look into 😓

@agourlay agourlay force-pushed the use-protoc-release branch 5 times, most recently from 209011f to 1c1ad53 Compare April 8, 2022 14:17
@agourlay agourlay force-pushed the use-protoc-release branch from 594a4c0 to 8375038 Compare April 8, 2022 14:21
Comment on lines 28 to 29
run: |
.github/workflows/protoc.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run: |
.github/workflows/protoc.sh
run: .github/workflows/protoc.sh

Same below

@agourlay
Copy link
Member Author

agourlay commented Apr 8, 2022

Alright I finally got this to work 🥳

The original solution regarding installing protocolbuffers via apt did not work on github actions because ubuntu-latest means 20.04 which is using an old version of protoc.

The solution is to manually install the functioning version found in ubuntu 21.04 which is 3.12.4.

Regarding the docker container it is currently broken on master with:

  --- stderr
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

This is also a side effect of the tonic upgrade hyperium/tonic#965

As the docker container is not built very often I decided to simply install cmake in that case.

The bottom line is that every developer should install a recent protocolbuffers locally to avoid wasting time during cold compilation.

@agourlay agourlay requested a review from e-ivkov April 8, 2022 15:23
@agourlay
Copy link
Member Author

agourlay commented Apr 8, 2022

Before

before-protoc

After

after-protoc

@agourlay agourlay requested a review from generall April 8, 2022 19:52
@agourlay agourlay merged commit c09034f into master Apr 11, 2022
@agourlay agourlay deleted the use-protoc-release branch April 11, 2022 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install protoc in CI to improve build time

3 participants