diff --git a/recipes/grpc/all/conanfile.py b/recipes/grpc/all/conanfile.py index 1d39ab202a3b0..ee416f1a4550c 100644 --- a/recipes/grpc/all/conanfile.py +++ b/recipes/grpc/all/conanfile.py @@ -1,7 +1,7 @@ import os from conan import ConanFile -from conan.errors import ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration, ConanException from conan.tools.apple import is_apple_os from conan.tools.build import cross_building, valid_min_cppstd, check_min_cppstd from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain, CMakeDeps @@ -174,6 +174,11 @@ def generate(self): tc.cache_variables["gRPC_BUILD_GRPC_PYTHON_PLUGIN"] = self.options.python_plugin tc.cache_variables["gRPC_BUILD_GRPC_RUBY_PLUGIN"] = self.options.ruby_plugin + # Never download unnecessary archives + # (supported in gRPC >= 1.62.0) + tc.cache_variables["gRPC_DOWNLOAD_ARCHIVES"] = False + + # Consumed targets (abseil) via interface target_compiler_feature can propagate newer standards if not valid_min_cppstd(self, self._cxxstd_required): tc.cache_variables["CMAKE_CXX_STANDARD"] = self._cxxstd_required @@ -207,7 +212,13 @@ def _patch_sources(self): def build(self): self._patch_sources() cmake = CMake(self) - cmake.configure() + + # The CMake configure step can fail spuriously, but succeed on a retry + try: + cmake.configure() + except ConanException: + cmake.configure() + cmake.build() def package(self):