identifiers: Allow to set ruma_identifiers_storage cfg setting with env variable
This commit is contained in:
parent
739334ac94
commit
fb273553b5
@ -1,5 +1,14 @@
|
|||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
Improvements:
|
||||||
|
|
||||||
|
- The `ruma_identifiers_storage` compile-time `cfg` setting can also be
|
||||||
|
configured by setting the `RUMA_IDENTIFIERS_STORAGE` environment variable at
|
||||||
|
compile time. It has the benefit of not requiring to re-compile all the crates
|
||||||
|
of the dependency chain when the value is changed.
|
||||||
|
|
||||||
|
# 0.14.1
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
- The `KeyId::key_name` method now returns the key name. In 0.14.0, `key_name`
|
- The `KeyId::key_name` method now returns the key name. In 0.14.0, `key_name`
|
||||||
|
10
crates/ruma-common/build.rs
Normal file
10
crates/ruma-common/build.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
use std::env;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// Set the `ruma_identifiers_storage` configuration from an environment variable.
|
||||||
|
if let Ok(value) = env::var("RUMA_IDENTIFIERS_STORAGE") {
|
||||||
|
println!("cargo:rustc-cfg=ruma_identifiers_storage={value}");
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("cargo:rerun-if-env-changed=RUMA_IDENTIFIERS_STORAGE");
|
||||||
|
}
|
@ -3,6 +3,10 @@
|
|||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
- Add unstable support for MSC4171 for the m.member_hints state event.
|
- Add unstable support for MSC4171 for the m.member_hints state event.
|
||||||
|
- The `ruma_identifiers_storage` compile-time `cfg` setting can also be
|
||||||
|
configured by setting the `RUMA_IDENTIFIERS_STORAGE` environment variable at
|
||||||
|
compile time. It has the benefit of not requiring to re-compile all the crates
|
||||||
|
of the dependency chain when the value is changed.
|
||||||
|
|
||||||
Breaking changes:
|
Breaking changes:
|
||||||
|
|
||||||
|
10
crates/ruma-events/build.rs
Normal file
10
crates/ruma-events/build.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
use std::env;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// Set the `ruma_identifiers_storage` configuration from an environment variable.
|
||||||
|
if let Ok(value) = env::var("RUMA_IDENTIFIERS_STORAGE") {
|
||||||
|
println!("cargo:rustc-cfg=ruma_identifiers_storage={value}");
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("cargo:rerun-if-env-changed=RUMA_IDENTIFIERS_STORAGE");
|
||||||
|
}
|
@ -73,6 +73,19 @@
|
|||||||
//!
|
//!
|
||||||
//! If you are viewing this on `docs.rs`, you can have a look at the feature dependencies by
|
//! If you are viewing this on `docs.rs`, you can have a look at the feature dependencies by
|
||||||
//! clicking **Feature flags** in the toolbar at the top.
|
//! clicking **Feature flags** in the toolbar at the top.
|
||||||
|
//!
|
||||||
|
//! # Compile-time `cfg` settings
|
||||||
|
//!
|
||||||
|
//! These settings are accepted at compile time to configure the generated code. They can be set as
|
||||||
|
//! `--cfg={key}={value}` using `RUSTFLAGS` or `.cargo/config.toml` (under `[build]` -> `rustflags =
|
||||||
|
//! ["..."]`). They can also be configured using an environment variable at compile time, which has
|
||||||
|
//! the benefit of not requiring to re-compile the whole dependency chain when their value is
|
||||||
|
//! changed.
|
||||||
|
//!
|
||||||
|
//! * `ruma_identifiers_storage` -- Choose the inner representation of `Owned*` wrapper types for
|
||||||
|
//! identifiers. By default they use [`Box`], setting the value to `Arc` makes them use
|
||||||
|
//! [`Arc`](std::sync::Arc). This can also be configured by setting the `RUMA_IDENTIFIERS_STORAGE`
|
||||||
|
//! environment variable.
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user