Skip to content

Commit af456b3

Browse files
authored
cmake: fix conanfile to use prebuilt grpc (#2807)
* fix conanfile to use prebuilt grpc: protobuf binary package is built with a newer version of abseil, but grpc binary package still uses an older version. an override=True is added to abseil in order to make sure we stick to the grpc abseil version. This forces a protobuf rebuild, but reuses grpc binary. Before the change both grpc and protobuf got rebuilt. * fix most linker warnings on macOS about protobuf built for macOS 15+, but incompatible with 14+ main binary (see also a related fix in conan.cmake). 2 remaining warnings are happening from a [protobuf/third_party/utf8_range](https://github.com/protocolbuffers/protobuf/blob/main/third_party/utf8_range/CMakeLists.txt) library that protobuf depends on. It is unclear why tools.build:cxxflags are not propagated there. * remove grpc/protobuf old recipe revisions on windows: it became unnecessary after the fix (see also a related fix in conan.cmake)
1 parent c9f214a commit af456b3

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

cmake/conan.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
107107
endif()
108108

109109
if(OS_VERSION_MIN_CXXFLAG AND NOT SILKWORM_SANITIZE_COMPILER_OPTIONS)
110-
list(APPEND CONAN_CONF "libtorrent/*:tools.build:cxxflags=[\"${OS_VERSION_MIN_CXXFLAG}\"]")
110+
list(APPEND CONAN_CONF "tools.build:cxxflags=[\"${OS_VERSION_MIN_CXXFLAG}\"]")
111111
endif()
112112

113113
if(SILKWORM_SANITIZE_COMPILER_OPTIONS)
@@ -140,6 +140,7 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
140140
set(CONAN_VERBOSITY "verbose")
141141
# make sure to not rebuild anything from source unless required
142142
set(CONAN_BUILD "missing:libtorrent/*")
143+
list(APPEND CONAN_BUILD "missing:protobuf/*")
143144
# HACK: MSVC is "multi config" and conan_provider.cmake runs 2 conan install commands for both Release and Debug
144145
# despite CMAKE_BUILD_TYPE. This adds an extra build_type setting to both commands to override and force the desired
145146
# build type. It still runs 2 commands, but the 2nd one has no effect.

conanfile.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class SilkwormRecipe(ConanFile):
1919
settings = 'os', 'compiler', 'build_type', 'arch'
2020
generators = 'CMakeDeps'
2121

22-
# Hard-coded recipe revisions prevent issues in Windows build after publication of a new revision
2322
def requirements(self):
2423
self.requires('catch2/3.6.0')
2524
self.requires('magic_enum/0.8.2')
@@ -30,22 +29,19 @@ def requirements(self):
3029
if self.settings.arch == 'wasm':
3130
return
3231

33-
self.requires('abseil/20240116.2')
32+
self.requires('abseil/20240116.2', override=True)
3433
self.requires('asio-grpc/2.9.2')
3534
self.requires('benchmark/1.6.1')
3635
self.requires('boost/1.83.0', override=True)
3736
self.requires('cli11/2.2.0')
3837
self.requires('gmp/6.2.1')
39-
self.requires('grpc/1.67.1#eae57ed8067bb53c6b0441a563b56d59', override=True)
38+
self.requires('grpc/1.67.1', override=True)
4039
self.requires('gtest/1.12.1')
4140
self.requires('jwt-cpp/0.6.0')
4241
self.requires('libtorrent/2.0.10')
4342
self.requires('mimalloc/2.1.2')
44-
self.requires('openssl/3.3.2')
45-
if self.settings.os == 'Windows':
46-
self.requires('protobuf/5.27.0#fe72d115daa683469cd940f0407ce55e', override=True)
47-
else:
48-
self.requires('protobuf/5.27.0')
43+
self.requires('openssl/3.4.1', override=True)
44+
self.requires('protobuf/5.27.0', override=True)
4945
self.requires('roaring/1.1.2')
5046
self.requires('snappy/1.1.7')
5147
self.requires('spdlog/1.12.0')

0 commit comments

Comments
 (0)