Enum hakari::UnifyTargetHost [−][src]
#[non_exhaustive]
pub enum UnifyTargetHost {
None,
Auto,
UnifyIfBoth,
ReplicateTargetOnHost,
}
Expand description
Whether to unify feature sets for a given dependency across target and host platforms.
Consider a dependency that is built as both normally (on the target platform) and in a build
script or proc macro. The normal dependency is considered to be built on the target platform,
and is represented in the [dependencies]
section in the generated Cargo.toml
.
The build dependency is built on the host platform, represented in the [build-dependencies]
section.
Now consider that the target and host platforms need two different sets of features:
# feature set on target platform
[dependencies]
my-dep = { version = "1.0", features = ["a", "b"] }
# feature set on host platform
[build-dependencies]
my-dep = { version = "1.0", features = ["b", "c"] }
Should hakari unify the feature sets across the [dependencies]
and [build-dependencies]
feature sets?
Call HakariBuilder::set_unify_target_host
to configure this option.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
None
Perform no unification across the target and host feature sets.
This is the most conservative option, but it means that some dependencies may be built with two different sets of features. In this mode, Hakari will likely be significantly less efficient.
Auto
Automatically choose between the UnifyIfBoth
and the
ReplicateTargetOnHost
options:
- If the workspace contains proc macros, or crates that are build dependencies of other
crates, choose the
ReplicateTargetAsHost
strategy. - Otherwise, choose the
UnifyIfBoth
strategy.
This is the default behavior.
UnifyIfBoth
Perform unification across target and host feature sets, but only if a dependency is built on both the target and the host.
This is useful if cross-compilations are uncommon and one wishes to avoid the same package being built two different ways: once for the target and once for the host.
ReplicateTargetOnHost
Perform unification across target and host feature sets, and also replicate all target-only lines to the host.
This is most useful if some workspace packages are proc macros or build dependencies used by other packages.
Trait Implementations
type Parameters = ()
type Parameters = ()
The type of parameters that arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
. Read more
The default for UnifyTargetHost
: automatically choose unification strategy based on the
workspace.
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for UnifyTargetHost
impl Send for UnifyTargetHost
impl Sync for UnifyTargetHost
impl Unpin for UnifyTargetHost
impl UnwindSafe for UnifyTargetHost
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.