Closed osteffenrh closed 2 weeks ago
Interesting... let me take a look. What's curious is CI didn't catch this, so we probably need another update there to test building without this feature.
Aha it's because of how open_enum handles expansion... Let me see if i can submit a fix, i think it needs to propagate the corresponding cfgs to the debug impl...
// Recursive expansion of open_enum macro
// =======================================
#[allow(clippy::exhaustive_structs)]
#[doc = " Enum describing different isolation platforms for"]
#[doc = " [`IGVM_VHS_SUPPORTED_PLATFORM`] structures."]
#[doc = " cbindgen:prefix-with-name=true"]
#[doc = " cbindgen:rename-all=ScreamingSnakeCase"]
#[repr(transparent)]
#[derive(
::core::cmp::PartialEq, ::core::cmp::Eq, AsBytes, FromBytes, FromZeroes, Clone, Copy, Hash,
)]
pub struct IgvmPlatformType(pub u8);
#[allow(non_upper_case_globals)]
impl IgvmPlatformType {
#[doc = " Native platform type without isolation."]
pub const NATIVE: IgvmPlatformType = IgvmPlatformType(0);
#[doc = " Platform type of Hyper-V\'s which supports VSM isolation."]
pub const VSM_ISOLATION: IgvmPlatformType = IgvmPlatformType(1);
#[doc = " AMD SEV-SNP."]
pub const SEV_SNP: IgvmPlatformType = IgvmPlatformType(2);
#[doc = " Intel TDX."]
pub const TDX: IgvmPlatformType = IgvmPlatformType(3);
#[doc = " AMD SEV."]
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub const SEV: IgvmPlatformType = IgvmPlatformType(4);
#[doc = " AMD SEV-ES"]
#[cfg(feature = "unstable")]
#[cfg_attr(docsrs, doc(cfg(feature = "unstable")))]
pub const SEV_ES: IgvmPlatformType = IgvmPlatformType(5);
}
impl ::core::fmt::Debug for IgvmPlatformType {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
#![allow(unreachable_patterns)]
let s = match *self {
Self::NATIVE => "NATIVE",
Self::VSM_ISOLATION => "VSM_ISOLATION",
Self::SEV_SNP => "SEV_SNP",
Self::TDX => "TDX",
Self::SEV => "SEV",
Self::SEV_ES => "SEV_ES",
_ => {
return fmt.debug_tuple("IgvmPlatformType").field(&self.0).finish();
}
};
fmt.pad(s)
}
}
I have a PR out in that repo for a fix, so once we have that merged we should be able to take it. Let me see also about fixing CI to test this as well.
upstream PR is merged, will find some time tomorrow to close this out and publish a new release, sorry about that!
Thanks for fixing it! We would need a new release with the fix to finish the packaging of this crate for Fedora, do you have an estimation for a new release?
cargo build
of igvm_defs fails:If works, if the
unstable
feature is set:cargo build -F unstable