matrix-org / matrix-rust-sdk

Matrix Client-Server SDK for Rust
Apache License 2.0
1.17k stars 229 forks source link

Undocumented feature flags #2994

Open twilight-flower opened 7 months ago

twilight-flower commented 7 months ago

I just tried to build matrix-sdk as a dependency in my program with the following invocation in cargo.toml:

matrix-sdk = { version = "0.7.0", features = ["e2e-encryption"], default-features = false }

This led to the following error showing up in my terminal, upon attempted cargo run:

error: failed to run custom build command for `matrix-sdk v0.7.0`

Caused by:
  process didn't exit successfully: `C:\Users\Alyssa\Miscellanea\Programming\Rust\matrix-chat-exporter\target\debug\build\matrix-sdk-48c5aca6c0ec4c49\build-script-build` (exit code: 1)
  --- stderr

  ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
  ┃ error: one of the features 'native-tls' or 'rustls-tls' must be enabled ┃
  ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

...which is strange, because neither native-tls nor rustls-tls are listed as settable feature flags on the matrix-sdk crates.io page. So it seems like the documentation there is out-of-date, missing some feature flags which in fact exist (and, moreover, are required for a successful build).

(Adding rustls-tls to the features list, after seeing this error message, let me subsequently compile without further issue; my report is purely of a documentation problem, not of anything wrong on a deeper technical level.)

jplatte commented 7 months ago

Right, since we document other crate features, we should also document those.

FWIW, on docs.rs pages you can get a full feature list for any crate:

Screenshot 2024-01-05 at 19-19-27 matrix_sdk - Rust