From 8898b26d9ca30b043e2f8fdb9bf46a970363d4f7 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:09:35 +0100 Subject: [PATCH] packages/cloud-hypervisor: fix build This supresses the `missing_docs` lint which breaks compilation on Rust 1.83.0+. --- ...x-panic-when-rejecting-extended-guest-report.patch | 3 +-- ...or-mshv-implement-extended-guest-requests-wi.patch | 3 +-- .../by-name/microsoft/cloud-hypervisor/package.nix | 11 +++++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/by-name/microsoft/cloud-hypervisor/0001-snp-fix-panic-when-rejecting-extended-guest-report.patch b/packages/by-name/microsoft/cloud-hypervisor/0001-snp-fix-panic-when-rejecting-extended-guest-report.patch index 4452767262..5e0f87620e 100644 --- a/packages/by-name/microsoft/cloud-hypervisor/0001-snp-fix-panic-when-rejecting-extended-guest-report.patch +++ b/packages/by-name/microsoft/cloud-hypervisor/0001-snp-fix-panic-when-rejecting-extended-guest-report.patch @@ -23,6 +23,5 @@ index f60d8ceb..b8fccf31 100644 self.fd .gpa_write(&mut swei2_rw_gpa_arg) .map_err(|e| cpu::HypervisorCpuError::GpaWrite(e.into()))?; --- +-- 2.45.2 - diff --git a/packages/by-name/microsoft/cloud-hypervisor/0002-hypervisor-mshv-implement-extended-guest-requests-wi.patch b/packages/by-name/microsoft/cloud-hypervisor/0002-hypervisor-mshv-implement-extended-guest-requests-wi.patch index d6129dd16e..732082d962 100644 --- a/packages/by-name/microsoft/cloud-hypervisor/0002-hypervisor-mshv-implement-extended-guest-requests-wi.patch +++ b/packages/by-name/microsoft/cloud-hypervisor/0002-hypervisor-mshv-implement-extended-guest-requests-wi.patch @@ -120,6 +120,5 @@ index 307326dd..69b12364 100644 +pub const GHCB_RBX_OFFSET: u64 = 0x0318; pub const GHCB_SW_EXITINFO1_OFFSET: u64 = 0x398; pub const GHCB_SW_EXITINFO2_OFFSET: u64 = 0x3A0; --- +-- 2.45.2 - diff --git a/packages/by-name/microsoft/cloud-hypervisor/package.nix b/packages/by-name/microsoft/cloud-hypervisor/package.nix index 6a836e6169..a5a7450a3c 100644 --- a/packages/by-name/microsoft/cloud-hypervisor/package.nix +++ b/packages/by-name/microsoft/cloud-hypervisor/package.nix @@ -39,6 +39,17 @@ rustPlatform.buildRustPackage rec { }; }; + # Allow compilation with Rust 1.83.0, which requires public methods in + # test modules to have documentation when the `missing_docs` lint is enabled. + # The [Microsoft fork](https://github.com/microsoft/cloud-hypervisor) will + # eventually support this, as [upstream](https://github.com/cloud-hypervisor/cloud-hypervisor) + # already does. + # See: https://github.com/cloud-hypervisor/cloud-hypervisor/issues/6903 + postPatch = '' + substituteInPlace rate_limiter/src/lib.rs \ + --replace-fail '#![deny(missing_docs)]' "" + ''; + patches = [ ./0001-snp-fix-panic-when-rejecting-extended-guest-report.patch ./0002-hypervisor-mshv-implement-extended-guest-requests-wi.patch