Open js-nano opened 8 months ago
As an aside, I haven't narrowed down why the download fails for just that one URL. It might be a corporate VPN or transparent (semi-transparent?) proxy. But, in any case, it seems that the "retry on failure" behaviour is expected by the devs.
For interest, curl gives:
curl -O -vvv https://storage.googleapis.com/grpc-bazel-mirror/github.com/census-instrumentation/opencensus-proto/archive/v0.3.0.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 142.250.200.59:443...
* Connected to storage.googleapis.com (142.250.200.59) port 443
* schannel: disabled automatic use of client certificate
* ALPN: curl offers http/1.1
* schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
* Closing connection
* schannel: shutting down SSL/TLS connection with storage.googleapis.com port 443
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
Edit: I worked out why it's just that one file
The download doesn't fail for other third party libraries because they aren't downloaded. The download logic for those libraries just looks for the presence of third_party/envoy-api
(and friends), which exists as an empty directory in the unpacked source. opencensus-proto
, meanwhile, looks for third_party/opencensus-proto/src
(which doesn't exist inside the empty opencensus-proto
directory), and so it runs the download_archive()
CMake function for that library (which then fails for the first URL)
Newer versions of the gRPC source code (since 1.62.0 -- commit here) have a gRPC_DOWNLOAD_ARCHIVES
CMake flag which can be set to OFF
to skip downloading unnecessary third-party archives (which sidesteps the problem entirely)
@jcar87 @RubenRBS is this normal practice for cci recipes? I would have thought that it would be undesirable for the CMakeLists to take charge of downloading files without conan client involvement - should these urls be moved into conandata.yml
and downloaded/extracted appropriately in the source()
method?
I can see that the current approach will pose issues for build reproducibility and utility in offline environments etc. It also makes it impossible to cache all of the necessary files to complete a build.
I agree that this is weird behaviour from the third party CMakeLists.txt
-- perhaps patching it would be the better option?
Description
It appears that the configure step of gRPC is designed such that it can fail once but succeed on a retry. This should be accounted for in the recipe.
Looking at the section of gRPC's
CMakeFiles.txt
that downloads 3rd party dependencies, we see it tries to download from one URL and, if that fails, it then tries to download from another URL:The idea seems to be:
The actual downloading takes place in gRPC's
cmake/download_archive.grpc
. Just beforefile(DOWNLOAD ...)
, there is a message to the user.This confirms that the behaviour is intended by the gRPC devs
One fix is to adjust the
build()
step inrecipes/grpc/all/conanfile.py
to re-attempt configuration if it fails the first time.Previously:
New (with retry):
Package and Environment Details
Conan profile
[settings] arch=x86_64 build_type=Release compiler=Visual Studio compiler.cppstd=17 compiler.runtime=MD compiler.version=16 os=Windows [options] [build_requires] [env]
Steps to reproduce
conan install --remote=conancenter grpc/1.54.3@ --build=missing
Logs
The Conan build fails due to a failed download:
Click to expand log
``` conan install --remote=conancenter grpc/1.54.3@ --build=missing Conan 1 is on a deprecation path, please consider migrating to Conan 2 Configuration: [settings] arch=x86_64 build_type=Release compiler=Visual Studio compiler.cppstd=17 compiler.runtime=MD compiler.version=16 os=Windows [options] [build_requires] [env] WARN: protobuf/3.21.12: requirement zlib/[>=1.2.11 <2] overridden by grpc/1.54.3 to zlib/1.2.13 grpc/1.54.3: WARN: Package binary is corrupted, removing: 4a1e4026e67c0beaacab1e2ffc38d50393f6d500 Version ranges solved Version range '>=1.1 <4' required by 'grpc/1.54.3' resolved to 'openssl/3.0.9' in local cache Version range '>=1.2.11 <2' required by 'grpc/1.54.3' resolved to 'zlib/1.2.13' in local cache Version range '>=1.2.11 <2' required by 'protobuf/3.21.12' valid for downstream requirement 'zlib/1.2.13' Installing package: grpc/1.54.3 Requirements abseil/20230125.3 from 'conancenter' - Cache c-ares/1.19.1 from 'ont-dev-artifactory' - Cache grpc/1.54.3 from 'conancenter' - Cache openssl/3.0.9 from 'ont-dev-artifactory' - Cache protobuf/3.21.12 from 'ont-dev-artifactory' - Cache re2/20230301 from 'conancenter' - Cache zlib/1.2.13 from 'ont-dev-artifactory' - Cache Packages abseil/20230125.3:f26537b056c9ff213dcc2874372b233408a3e04e - Cache c-ares/1.19.1:95ac61b4b7e9e66bcc9af3260647ab977ee3250a - Cache grpc/1.54.3:4a1e4026e67c0beaacab1e2ffc38d50393f6d500 - Build openssl/3.0.9:1cf626f618fdd256dd79c53f4d6cebfc2eaa1df7 - Cache protobuf/3.21.12:c6a60154320737bb08f320938d013aa2d958fe01 - Cache re2/20230301:f26537b056c9ff213dcc2874372b233408a3e04e - Cache zlib/1.2.13:3fb49604f9c2f729b85ba3115852006824e72cab - Cache Installing (downloading, building) binaries... abseil/20230125.3: Already installed! c-ares/1.19.1: Already installed! re2/20230301: Already installed! zlib/1.2.13: Already installed! openssl/3.0.9: Already installed! protobuf/3.21.12: Already installed! grpc/1.54.3: WARN: Build folder is dirty, removing it: C:\.conan\1018dd\1 grpc/1.54.3: Copying sources to build folder grpc/1.54.3: Building your package in C:\.conan\1018dd\1 grpc/1.54.3: Generator txt created conanbuildinfo.txt grpc/1.54.3: Calling generate() grpc/1.54.3: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior grpc/1.54.3: Preset 'default' added to CMakePresets.json. Invoke it manually using 'cmake --preset default' grpc/1.54.3: If your CMake version is not compatible with CMakePresets (<3.19) call cmake like: 'cmakeManually re-running the cmake configure command that Conan ran works, for the reasons outlined above:
Click to expand log
``` C:\.conan\1018dd\1>cmake -G "Visual Studio 16 2019" -DCMAKE_TOOLCHAIN_FILE="C:/.conan/1018dd/1/build/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/.conan/24748a/1" -DCMAKE_PROJECT_grpc_INCLUDE="C:\.conan\1018dd\1\src\conan_cmake_project_include.cmake" -DgRPC_BUILD_CODEGEN="ON" -DgRPC_BUILD_CSHARP_EXT="OFF" -DgRPC_BUILD_TESTS="OFF" -DgRPC_INSTALL="ON" -DgRPC_INSTALL_SHAREDIR="res/grpc" -DgRPC_ZLIB_PROVIDER="package" -DgRPC_CARES_PROVIDER="package" -DgRPC_RE2_PROVIDER="package" -DgRPC_SSL_PROVIDER="package" -DgRPC_PROTOBUF_PROVIDER="package" -DgRPC_ABSL_PROVIDER="package" -DgRPC_BUILD_GRPC_CPP_PLUGIN="ON" -DgRPC_BUILD_GRPC_CSHARP_PLUGIN="ON" -DgRPC_BUILD_GRPC_NODE_PLUGIN="ON" -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN="ON" -DgRPC_BUILD_GRPC_PHP_PLUGIN="ON" -DgRPC_BUILD_GRPC_PYTHON_PLUGIN="ON" -DgRPC_BUILD_GRPC_RUBY_PLUGIN="ON" -DCMAKE_SYSTEM_VERSION="10.0.18362.0" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:\.conan\1018dd\1\src" -- Using Conan toolchain: C:/.conan/1018dd/1/build/generators/conan_toolchain.cmake -- Conan toolchain: C++ Standard 17 with extensions OFF -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.18362.0. -- The C compiler identification is MSVC 19.29.30154.0 -- The CXX compiler identification is MSVC 19.29.30154.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Conan: Component target declared 'absl::config' -- Conan: Component target declared 'absl::dynamic_annotations' -- Conan: Component target declared 'absl::core_headers' -- Conan: Component target declared 'absl::pretty_function' -- Conan: Component target declared 'absl::fast_type_id' -- Conan: Component target declared 'absl::prefetch' -- Conan: Component target declared 'absl::algorithm' -- Conan: Component target declared 'absl::counting_allocator' -- Conan: Component target declared 'absl::hashtable_debug_hooks' -- Conan: Component target declared 'absl::node_slot_policy' -- Conan: Component target declared 'absl::non_temporal_arm_intrinsics' -- Conan: Component target declared 'absl::non_temporal_memcpy' -- Conan: Component target declared 'absl::leak_check' -- Conan: Component target declared 'absl::flags_commandlineflag_internal' -- Conan: Component target declared 'absl::log_internal_config' -- Conan: Component target declared 'absl::log_internal_nullguard' -- Conan: Component target declared 'absl::log_internal_voidify' -- Conan: Component target declared 'absl::type_traits' -- Conan: Component target declared 'absl::meta' -- Conan: Component target declared 'absl::bits' -- Conan: Component target declared 'absl::int128' -- Conan: Component target declared 'absl::numeric' -- Conan: Component target declared 'absl::numeric_representation' -- Conan: Component target declared 'absl::exponential_biased' -- Conan: Component target declared 'absl::periodic_sampler' -- Conan: Component target declared 'absl::random_seed_gen_exception' -- Conan: Component target declared 'absl::random_internal_traits' -- Conan: Component target declared 'absl::random_internal_fast_uniform_bits' -- Conan: Component target declared 'absl::random_internal_iostream_state_saver' -- Conan: Component target declared 'absl::random_internal_wide_multiply' -- Conan: Component target declared 'absl::random_internal_fastmath' -- Conan: Component target declared 'absl::random_internal_pcg_engine' -- Conan: Component target declared 'absl::random_internal_platform' -- Conan: Component target declared 'absl::random_internal_randen_slow' -- Conan: Component target declared 'absl::random_internal_randen_hwaes_impl' -- Conan: Component target declared 'absl::random_internal_uniform_helper' -- Conan: Component target declared 'absl::cordz_update_tracker' -- Conan: Component target declared 'absl::civil_time' -- Conan: Component target declared 'absl::time_zone' -- Conan: Component target declared 'absl::compare' -- Conan: Component target declared 'absl::atomic_hook' -- Conan: Component target declared 'absl::errno_saver' -- Conan: Component target declared 'absl::log_severity' -- Conan: Component target declared 'absl::raw_logging_internal' -- Conan: Component target declared 'absl::base_internal' -- Conan: Component target declared 'absl::throw_delegate' -- Conan: Component target declared 'absl::scoped_set_env' -- Conan: Component target declared 'absl::strerror' -- Conan: Component target declared 'absl::algorithm_container' -- Conan: Component target declared 'absl::common_policy_traits' -- Conan: Component target declared 'absl::hashtable_debug' -- Conan: Component target declared 'absl::container_common' -- Conan: Component target declared 'absl::debugging_internal' -- Conan: Component target declared 'absl::function_ref' -- Conan: Component target declared 'absl::memory' -- Conan: Component target declared 'absl::random_internal_generate_real' -- Conan: Component target declared 'absl::random_internal_randen_hwaes' -- Conan: Component target declared 'absl::cordz_functions' -- Conan: Component target declared 'absl::bad_any_cast_impl' -- Conan: Component target declared 'absl::span' -- Conan: Component target declared 'absl::bad_optional_access' -- Conan: Component target declared 'absl::bad_variant_access' -- Conan: Component target declared 'absl::utility' -- Conan: Component target declared 'absl::spinlock_wait' -- Conan: Component target declared 'absl::base' -- Conan: Component target declared 'absl::endian' -- Conan: Component target declared 'absl::cleanup_internal' -- Conan: Component target declared 'absl::cleanup' -- Conan: Component target declared 'absl::compressed_tuple' -- Conan: Component target declared 'absl::fixed_array' -- Conan: Component target declared 'absl::inlined_vector_internal' -- Conan: Component target declared 'absl::inlined_vector' -- Conan: Component target declared 'absl::container_memory' -- Conan: Component target declared 'absl::hash_policy_traits' -- Conan: Component target declared 'absl::crc_cpu_detect' -- Conan: Component target declared 'absl::crc_internal' -- Conan: Component target declared 'absl::stacktrace' -- Conan: Component target declared 'absl::demangle_internal' -- Conan: Component target declared 'absl::debugging' -- Conan: Component target declared 'absl::any_invocable' -- Conan: Component target declared 'absl::bind_front' -- Conan: Component target declared 'absl::city' -- Conan: Component target declared 'absl::low_level_hash' -- Conan: Component target declared 'absl::log_internal_conditions' -- Conan: Component target declared 'absl::random_internal_distribution_caller' -- Conan: Component target declared 'absl::random_internal_randen' -- Conan: Component target declared 'absl::strings_internal' -- Conan: Component target declared 'absl::bad_any_cast' -- Conan: Component target declared 'absl::optional' -- Conan: Component target declared 'absl::variant' -- Conan: Component target declared 'absl::malloc_internal' -- Conan: Component target declared 'absl::random_bit_gen_ref' -- Conan: Component target declared 'absl::random_internal_mock_helpers' -- Conan: Component target declared 'absl::random_internal_randen_engine' -- Conan: Component target declared 'absl::strings' -- Conan: Component target declared 'absl::str_format_internal' -- Conan: Component target declared 'absl::graphcycles_internal' -- Conan: Component target declared 'absl::time' -- Conan: Component target declared 'absl::any' -- Conan: Component target declared 'absl::layout' -- Conan: Component target declared 'absl::crc32c' -- Conan: Component target declared 'absl::crc_cord_state' -- Conan: Component target declared 'absl::symbolize' -- Conan: Component target declared 'absl::examine_stack' -- Conan: Component target declared 'absl::failure_signal_handler' -- Conan: Component target declared 'absl::flags_path_util' -- Conan: Component target declared 'absl::flags_commandlineflag' -- Conan: Component target declared 'absl::flags_private_handle_accessor' -- Conan: Component target declared 'absl::hash' -- Conan: Component target declared 'absl::log_internal_globals' -- Conan: Component target declared 'absl::log_internal_proto' -- Conan: Component target declared 'absl::log_internal_nullstream' -- Conan: Component target declared 'absl::log_internal_append_truncated' -- Conan: Component target declared 'absl::log_globals' -- Conan: Component target declared 'absl::log_initialize' -- Conan: Component target declared 'absl::log_entry' -- Conan: Component target declared 'absl::log_sink' -- Conan: Component target declared 'absl::random_distributions' -- Conan: Component target declared 'absl::random_internal_seed_material' -- Conan: Component target declared 'absl::random_internal_pool_urbg' -- Conan: Component target declared 'absl::random_internal_salted_seed_seq' -- Conan: Component target declared 'absl::random_internal_nonsecure_base' -- Conan: Component target declared 'absl::str_format' -- Conan: Component target declared 'absl::cord_internal' -- Conan: Component target declared 'absl::kernel_timeout_internal' -- Conan: Component target declared 'absl::synchronization' -- Conan: Component target declared 'absl::flags_program_name' -- Conan: Component target declared 'absl::flags_config' -- Conan: Component target declared 'absl::flags_marshalling' -- Conan: Component target declared 'absl::flags_internal' -- Conan: Component target declared 'absl::log_internal_format' -- Conan: Component target declared 'absl::log_internal_log_sink_set' -- Conan: Component target declared 'absl::log_sink_registry' -- Conan: Component target declared 'absl::sample_recorder' -- Conan: Component target declared 'absl::random_seed_sequences' -- Conan: Component target declared 'absl::random_internal_distribution_test_util' -- Conan: Component target declared 'absl::cordz_statistics' -- Conan: Component target declared 'absl::cordz_handle' -- Conan: Component target declared 'absl::cordz_info' -- Conan: Component target declared 'absl::cordz_sample_token' -- Conan: Component target declared 'absl::cordz_update_scope' -- Conan: Component target declared 'absl::cord' -- Conan: Component target declared 'absl::btree' -- Conan: Component target declared 'absl::hash_function_defaults' -- Conan: Component target declared 'absl::hashtablez_sampler' -- Conan: Component target declared 'absl::raw_hash_set' -- Conan: Component target declared 'absl::log_internal_message' -- Conan: Component target declared 'absl::log_internal_strip' -- Conan: Component target declared 'absl::log_internal_structured' -- Conan: Component target declared 'absl::log_structured' -- Conan: Component target declared 'absl::random_random' -- Conan: Component target declared 'absl::status' -- Conan: Component target declared 'absl::statusor' -- Conan: Component target declared 'absl::flat_hash_set' -- Conan: Component target declared 'absl::node_hash_set' -- Conan: Component target declared 'absl::raw_hash_map' -- Conan: Component target declared 'absl::log_internal_check_op' -- Conan: Component target declared 'absl::log_internal_log_impl' -- Conan: Component target declared 'absl::absl_log' -- Conan: Component target declared 'absl::log' -- Conan: Component target declared 'absl::log_streamer' -- Conan: Component target declared 'absl::flat_hash_map' -- Conan: Component target declared 'absl::node_hash_map' -- Conan: Component target declared 'absl::flags_reflection' -- Conan: Component target declared 'absl::flags' -- Conan: Component target declared 'absl::flags_usage_internal' -- Conan: Component target declared 'absl::flags_usage' -- Conan: Component target declared 'absl::flags_parse' -- Conan: Component target declared 'absl::log_internal_check_impl' -- Conan: Component target declared 'absl::log_internal_flags' -- Conan: Component target declared 'absl::absl_check' -- Conan: Component target declared 'absl::check' -- Conan: Component target declared 'absl::die_if_null' -- Conan: Component target declared 'absl::log_flags' -- Conan: Target declared 'abseil::abseil' -- Conan: Including build module from 'C:/.conan/4a413c/1/lib/cmake/conan_trick/cxx_std.cmake' -- Conan: Component target declared 'c-ares::cares' -- Conan: Component target declared 'protobuf::libprotobuf' -- Conan: Component target declared 'protobuf::libprotoc' -- Conan: Target declared 'protobuf::protobuf' -- Conan: Target declared 'ZLIB::ZLIB' -- Conan: Including build module from 'C:/.conan/53d67e77/1/lib/cmake/protobuf/protobuf-generate.cmake' -- Conan: Including build module from 'C:/.conan/53d67e77/1/lib/cmake/protobuf/protobuf-module.cmake' -- Conan: Including build module from 'C:/.conan/53d67e77/1/lib/cmake/protobuf/protobuf-options.cmake' -- Conan: Target declared 're2::re2' -- Conan: Component target declared 'OpenSSL::Crypto' -- Conan: Component target declared 'OpenSSL::SSL' -- Conan: Target declared 'openssl::openssl' -- Conan: Including build module from 'C:/Users/user/.conan/data/openssl/3.0.9/_/_/package/1cf626f618fdd256dd79c53f4d6cebfc2eaa1df7/lib/cmake/conan-official-openssl-variables.cmake' -- Configuring done (6.0s) -- Generating done (0.8s) -- Build files have been written to: C:/.conan/1018dd/1 ```