amqp-rs / lapin

AMQP client library in Rust, with a clean, futures based API
MIT License
1.05k stars 92 forks source link

Windows build issue rustls #414

Closed maxmindlin closed 3 months ago

maxmindlin commented 3 months ago

Hello!

I was having issues building Lapin v2.5.0 on windows due to the following error:

error: failed to run custom build command for `aws-lc-sys v0.20.1`

  --- 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:rerun-if-env-changed=CMAKE

  --- stderr
  Consider setting `AWS_LC_SYS_NO_ASM` in the environment for development builds.See User Guide about the limitations: https://aws.github.io/aws-lc-rs/index.html
  Missing dependency: nasm
  Missing dependency: cmake

I believe I successfully narrowed it down to rustls and tried the suggestion in the README of setting the rustls--ring but got the error that the feature does not exist. I noticed that while this feature does exist in main it does not exist in the most recent release of 2.5.0. Will a new version be released soon to account for this or is there something I am missing? In the meantime I am using native-tls which has its own downsides.

Thanks!

Keruspe commented 3 months ago

Hello, This is because the change in features can result in a breaking change, so the new features will be part of 3.0 which is not ready yet.

In the meantime, you should be able to add a direct dependency on rustls to control this with rustls features directly

maxmindlin commented 3 months ago

Hello, This is because the change in features can result in a breaking change, so the new features will be part of 3.0 which is not ready yet.

In the meantime, you should be able to add a direct dependency on rustls to control this with rustls features directly

Makes sense, thanks for the details. I tried adding the following to my Cargo.toml but I am still getting the above error:

lapin = { version = "2.5.0" }
rustls = { version = "=0.23", default-features = false, features = ["ring"]}

Is this not the proper way add the rustls direct dependency?

Keruspe commented 3 months ago

Sorry for the delay, did not have access to a computer. Turns out we pulled rustls in with default features enabled anyways, so this had no effect... Until 3.0, I've just changed the default back to ring for now (which can still be overridden at application level anyways), but at least this particular problem won't happen anymore after your next cargo update