-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protobuf recent update broke protoc integration #21737
Comments
You have to add protobuf to your build requirements. |
it is already there |
So it should work, please share your conan version, compiler etc, conanfile, CMakeLists and commands invoked (properly fill the issue template in short). There might be an edge case when user relies on legacy cmake generator, since bin dir of protobuf package is appended to PATH instead of prepended. |
Hi I'm seeing the same thing with my build. import os
from conan import ConanFile
class MyApplication(ConanFile):
settings = "os", "compiler", "build_type", "arch"
name = "my_app"
version = "1.0.0.0"
# comma-separated list of requirements
generators = "CMakeDeps"
keep_imports = True
default_options = {"grpc/*:cpp_plugin": True,
"grpc/*:shared": False,
"protobuf/*:shared": False,
"boost/*:shared": False,
"fakeit/*:integration": "catch"}
def requirements(self):
self.requires("boost/1.83.0")
self.requires("grpc/1.54.3")
self.requires("openssl/3.1.3")
self.requires("protobuf/3.21.12")
self.requires("sqlite3/3.41.1")
self.requires("spdlog/1.12.0")
self.requires("nlohmann_json/3.11.2")
self.requires("eigen/3.4.0")
self.requires("fmt/10.1.1")
self.requires("cli11/2.3.2")
self.requires("zlib/1.3", override=True)
self.requires("asio/1.28.2")
# Install libusb on windows, get it from the toolchain otherwise (handled inside device manager)
if self.settings.arch == "x86_64":
self.requires("libusb/1.0.25")
if self.settings.os == "Windows":
self.requires("sdl/2.0.16")
# Testing libs
self.requires("fakeit/2.4.0")
self.requires("catch2/3.4.0")
self.requires("fake_clock/1.01")
def build_requirements(self):
self.tool_requires("protobuf/3.21.12")
self.tool_requires("grpc/1.54.3")
def build(self):
pass
# self.output.warn("CC=>{}".format(os.getenv("CC")))
def imports(self):
self.copy("license*", dst="licenses", folder=True, ignore_case=True)
def layout(self):
# We make the assumption that if the compiler is msvc the
# CMake generator is multi-config
multi = True if self.settings.get_safe("compiler") == "msvc" else False
if multi:
self.folders.generators = os.path.join("build", "generators")
else:
self.folders.generators = os.path.join("build", str(self.settings.build_type), "generators") I'm using Ninja and invoking protobuf_generate inside my cmakelists.txt |
Where is CMakeToolchain? |
Ah yes, I'll try with the toolchain, thanks |
this is the conan file
|
protobuf is not in build requirements |
sorry what about? "protobuf/3.21.12": {},
|
updating conanfile with build requirements did not solve the problem
|
I'm using conan through the https://github.com/conan-io/cmake-conan repo. It says the toolchain isn't supported with that method. Is there a workaround to use the above repo with the current protobuf changes? |
Im looking at revisions, so hopefully can use those... while package is fixed. will give more details in an hour or so |
ok I was able to get back to previous revision, just specify it as package reference, also may need to explicitly enable revisions
|
@SpaceIm any thoughts? |
I don't know what you are doing. You have not shared all elements I asked. |
Does it matter? The problem is that receipt is using incorrect version of protoc and not the one from the package, previously that was not the case, so this is the line which causing the problem
ps. I don't think it is a productive conversation to point that everybody should just switch over to cmake toolchains because it is working. |
I'm not that familiar with Conan, but in my case
This is a bit odd, since Trying to specify any other recipe revision leads to:
Conan version 2.0.14. CMake command is just |
For future readers using cmake-conan: There is no syntax in From the original CMake: conan_cmake_configure(
REQUIRES
grpc/1.50.1
GENERATORS
CMakeDeps
CMakeToolchain
) Make the from conan import ConanFile
class Package(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = 'CMakeDeps', 'CMakeToolchain'
def requirements(self):
self.requires("grpc/1.50.1")
# grab recipe version from `conan list -r conancenter 'protobuf/${protobuf_version}#*'`
self.requires("protobuf/3.21.12@#8210c0b1bb46b08ff2814614ec091a9c", override=True) Then, you can replace the call to configure_file(conanfile.py "${CMAKE_CURRENT_BINARY_DIR}/conanfile.py" COPYONLY)
file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conanfile.txt") The |
@pgeler Hello! Thank you for reporting! When opening the issue, please, fill the form with all asked information. Otherwise, it will be really hard to reproduce your scenario and confirm your error, plus, work in a hotfix. Could you please update your issue description with all information like: your real profile ( |
With updated protobuf recipe OpenVINO cannot be built on WIndows anymore #22244 even for old releases. |
see #22542 (comment) and #22244 (comment) |
…ntext * improve discovery of protoc executable in build context * addd more comments * fix test package
I had the same issue and confirmed that adding protobuf to the The following (based on @SpaceIm 's comment in #22244 (comment)) fixed this issue for me (for both Conan 1 and 2): @property
def _is_legacy_one_profile(self):
# Returns True if user is running a Conan 1 profile
return not hasattr(self, "settings_build")
def build_requirements(self):
# Include protobuf as a build requirement so that Conan-provided
# `protoc` is found instead of system-installed one).
if not self._is_legacy_one_profile:
self.tool_requires("protobuf/<host_version>") |
Description
new implementation as #20089 of searching protoc actually finds system protoc instead the one build by conan, as a result usage of the protoc leads to
error: incompatible with your Protocol Buffer headers. Please #error incompatible with your Protocol Buffer headers. ....
linux ubuntu 22.04 with default protoc installed from apt-getPackage and Environment Details
Conan profile
default
Steps to reproduce
cmake build with dependencies
Logs
Click to expand log
The text was updated successfully, but these errors were encountered: