Skip to content

Commit e41bdc7

Browse files
committed
allow mshv3 to override mshv2 feature
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent 2739615 commit e41bdc7

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/hyperlight_host/build.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,14 @@ fn main() -> Result<()> {
9494
// inprocess feature is aliased with debug_assertions to make it only available in debug-builds.
9595
// You should never use #[cfg(feature = "inprocess")] in the codebase. Use #[cfg(inprocess)] instead.
9696
inprocess: { all(feature = "inprocess", debug_assertions) },
97-
// the following is a bit of a hack to stop clippy failing wehn run with -all features as it enables both mshv2 and mshv3 at the same time causing errors
98-
mshv2: { all(feature = "mshv2", target_os = "linux", not(clippy)) },
97+
// the following features are mutually exclusive but rather than enforcing that here we are enabling mshv3 to override mshv2 when both are enabled
98+
// because mshv2 is in the default feature set we want to allow users to enable mshv3 without having to set --no-default-features and the re-enable
99+
// the other features they want.
100+
mshv2: { all(feature = "mshv2", not(feature="mshv3"), target_os = "linux") },
99101
mshv3: { all(feature = "mshv3", target_os = "linux") },
100102
}
101103

102104
write_built_file()?;
103105

104-
// mshv2 and mshv3 features are mutually exclusive
105-
#[cfg(all(feature = "mshv2", feature = "mshv3", not(clippy)))]
106-
Err(anyhow::anyhow!(
107-
"mshv2 and mshv3 features are mutually exclusive"
108-
))?;
109-
110106
Ok(())
111107
}

0 commit comments

Comments
 (0)