build_safely (previously ninja-build_rs)
Designed to help create good build scripts, with a focus on ease of use for you, valuable output in cargo build -vv & no annoying surprises for anyone downstream.
ninja-build_rs is now a transparent shim around the renamed build_safely,
the full git history is preserved, the original author remains and both crates
will be updated with every new version.
Usage
use *;
// Result uses BuildError to give meaningful messages
Prelude
use *;
provides:
- A
Resultalias &BuildErrortype that gives meaningful output frommain() -> Result<()>. get_var()&split_var()which automatically registercargo::rerun-if-env-changedand include the variable name in any errors.emit_unstable_feature(),cargo_allowed_features& enumUnstableFeatureto provide a safe way to identify the availability of nightly features & handle the future stabilisation process without additional effort on your part. All while respecting anyallow-featureswhitelists.
Note to downstream crates
If you (transiently) depend on a crate which uses build_safely and have implemented a
whitelist of allowed-features.
Due to limitations in the information provided by cargo:
- This will obtain config.toml files based upon
OUT_DIR. If this is not under the project root, you can override by providing an alternative path via the environment variableBUILD_SAFELY_CARGO_CONFIG_DIR. See cargo's documentation on config file hierarchical structure for more details. - This will not respect additional entries passed at the command line via
cargo --config unstable.allow-features=[...]