How to Avoid Recompiling protobuf-src
with System-installed Protobuf in libp2p?
#5746
vinay10949
started this conversation in
General
Replies: 1 comment
-
I don't see |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm working on project that includes
libp2p
(version 0.54.1) in a workspace. I’ve noticed that during the build process,protobuf-src
is being compiled from source, which significantly increases the build time. This is happening despite having Protobuf installed system-wide and setting thePROTOC
environment variable to point to the system'sprotoc
binary.Setup Details:
sudo apt install protobuf-compiler libprotobuf-dev
protoc --version
outputslibprotoc 3.21.9
Configuration:
I have set the
PROTOC
environment variable:export PROTOC=/usr/bin/protoc
Problem:
Despite having Protobuf installed system-wide, the
protobuf-src
crate still compiles from source during thecargo build
process. This has been significantly increasing my build time. I’ve checked the libp2p documentation but couldn’t find any specific flags or features that disable Protobuf-related functionality.What I’ve Tried:
PROTOC
environment variable: This doesn't stopprotobuf-src
from being compiled.libp2p
features: There are no clear flags to disable Protobuf usage inlibp2p
that I could find..proto
files: I considered precompiling.proto
files and committing the generated Rust code, but I’m unsure how to integrate this cleanly withlibp2p
.Question:
Has anyone encountered this issue or have suggestions on how to force
libp2p
to use the system-installed Protobuf binaries, or avoid compilingprotobuf-src
entirely? Iflibp2p
or one of its dependencies (likeprost-build
) is causing this, is there a workaround?Impact:
This is especially problematic in CI environments, where build times are critical. Any tips to reduce build time would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions