Paralegal allows you to specify additional build options for dependencies. Those build options are specified in a file called Paralegal.toml
. It uses the standard TOML syntax and should be placed in the root directory of the project you are analyzing, e.g. the same directory where the projects Cargo.toml
is located.
You can set build options for specific dependencies via a [dep.{dependency name}]
section. An example below shows enabling a rust feature in the time
library.
# in Paralegal.toml that is placed in the same directory
# as the Cargo.toml for the project you are trying to analyze.
[dep.time]
rust_features = ["explicit_generic_args_with_impl_trait"]
Explanation of keys:
rust_features
: Enables specific rust compiler or library features for the dependency, as if #[feature(feature_name, ...)]
had been used in its lib.rs
or main.rs
.
This is designed in particular account for situations where paralegal-flow
is used on a project that uses a newer rust stable which expects certain features to be enabled by default. For an example of where this occurs see Dependencies don’t Compile Because a rustc Feature is Missing.