Azure / azure-sdk-for-rust

This repository is for active development of the *unofficial* Azure SDK for Rust. This repository is *not* supported by the Azure SDK team.
MIT License
685 stars 232 forks source link

azure_core 0.19.0 fails to build for wasm when using reqwest #1554

Closed johnbatty closed 6 months ago

johnbatty commented 6 months ago

A recent fix https://github.com/Azure/azure-sdk-for-rust/pull/1550 added a call to reqwest::ClientBuilder::pool_max_idle_per_host(). Unfortunately this method does not exist in the reqwest wasm implementation:

error[E0599]: no method named `pool_max_idle_per_host` found for struct `ClientBuilder` in the current scope
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/azure_core-0.19.0/src/http_client/reqwest.rs:18:10
   |
17 |       let client = ::reqwest::ClientBuilder::new()
   |  __________________-
18 | |         .pool_max_idle_per_host(0)
   | |         -^^^^^^^^^^^^^^^^^^^^^^ method not found in `ClientBuilder`
   | |_________|
   | 

I noticed this when migrating the azure-devops-rust-api to 0.19.0 (the CI build broke). Not sure why the azure-sdk-for-rust CI build didn't fail - I believe it also does a wasm build. I guess it may not enable the enable_reqwest feature?

The fix is obviously to only include the new code for non-wasm builds.