You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The iot_hub examples use hyper_rustls (though honestly I don't see exactly where).
The update from hyper-rustls 0.26 to 0.27 in #1628 includes rustls changes to switch the underlying crypto library from ring to aws-lc-rs. Unfortunately, the aws-lc-rs library requires several dependencies in order to build. As a result, running rust-analyzer in the repository fails. For example, see this screenshot from RustRover:
Or, building examples (cargo build --examples) at the repo root:
error: failed to run custom build command for `aws-lc-sys v0.18.0`
Caused by:
process didn't exit successfully: `W:\Azure\azure-sdk-for-rust\target\debug\build\aws-lc-sys-1e301be2af945e09\build-script-main` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX
cargo:rerun-if-env-changed=AWS_LC_SYS_INTERNAL_BINDGEN
cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN
cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM
cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER
cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC
cargo:warning=Generating bindings - internal bindgen. Platform: x86_64-pc-windows-msvc
cargo:rerun-if-env-changed=AWS_LC_SYS_INCLUDES
--- stderr
AWS_LC_SYS_NO_ASM=1
thread 'main' panicked at C:\Users\ashleyst\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bindgen-0.69.4\lib.rs:622:31:
Unable to find libclang: "couldn't find any valid shared libraries matching: ['clang.dll', 'libclang.dll'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Specifically, you need NASM (or to set AWS_LC_SYS_NO_ASM) and Clang installed.
This is a confusing experience for a new engineer, and it seems undesirable to require these prerequisites be configured if you're not even working on the IoT Hub library.
There are a few solutions to take here, and I'm happy to open a PR for one of them, but I don't really work in the iot_hub area (I'll be working primarily on Cosmos DB) so I wanted to consult:
Document how to install the pre-reqs in the repo README.md - I'd prefer not to expect all users of the repo to install NASM and a C Compiler, but it's fairly straightforward.
Remove hyper-rustls from the iot_hub examples altogether. I don't see it actually being used and was able to run at least part of one of the iot_hub examples without it (I ran the configuration example and it successfully created the connection, then failed with some other deserialization errors, indicating it was successfully making requests to Azure).
Switch hyper-rustls from the default aws-lc-rs feature to ring, which doesn't require build prerequisites.
Exclude the iot_hub package from the workspace, or encourage users to do so transiently, so that rust-analyzer can correctly start. Not a fan of this one, but it's what I'm doing locally for now ;).
I think option 2 is probably the easiest, if it works. I just don't have the context to know if there's a deeper reason hyper-rustls is installed as a dev dependency in that package.
The text was updated successfully, but these errors were encountered:
analogrelay
added a commit
to analogrelay/azure-sdk-for-rust
that referenced
this issue
Jun 12, 2024
The iot_hub examples use
hyper_rustls
(though honestly I don't see exactly where).The update from hyper-rustls 0.26 to 0.27 in #1628 includes rustls changes to switch the underlying crypto library from
ring
toaws-lc-rs
. Unfortunately, theaws-lc-rs
library requires several dependencies in order to build. As a result, running rust-analyzer in the repository fails. For example, see this screenshot from RustRover:Or, building examples (
cargo build --examples
) at the repo root:Specifically, you need NASM (or to set
AWS_LC_SYS_NO_ASM
) and Clang installed.This is a confusing experience for a new engineer, and it seems undesirable to require these prerequisites be configured if you're not even working on the IoT Hub library.
There are a few solutions to take here, and I'm happy to open a PR for one of them, but I don't really work in the iot_hub area (I'll be working primarily on Cosmos DB) so I wanted to consult:
hyper-rustls
from the iot_hub examples altogether. I don't see it actually being used and was able to run at least part of one of the iot_hub examples without it (I ran theconfiguration
example and it successfully created the connection, then failed with some other deserialization errors, indicating it was successfully making requests to Azure).hyper-rustls
from the defaultaws-lc-rs
feature toring
, which doesn't require build prerequisites.iot_hub
package from the workspace, or encourage users to do so transiently, so that rust-analyzer can correctly start. Not a fan of this one, but it's what I'm doing locally for now ;).I think option 2 is probably the easiest, if it works. I just don't have the context to know if there's a deeper reason
hyper-rustls
is installed as a dev dependency in that package.The text was updated successfully, but these errors were encountered: