From 357943670f155e52714b1aaa6823be6e50d04ef3 Mon Sep 17 00:00:00 2001 From: Manuel Huber Date: Fri, 14 Feb 2025 20:30:09 +0000 Subject: [PATCH 1/4] genpolicy: Fix rust v1.84 linter issue - rust linter detects a potential future name collision - see rustc lint static 'UNSTABLE_NAME_COLLISIONS' - we can revisit this at a later point Signed-off-by: Manuel Huber --- src/tools/genpolicy/src/registry.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/genpolicy/src/registry.rs b/src/tools/genpolicy/src/registry.rs index 97e35ee601be..fe0b12d8c21b 100644 --- a/src/tools/genpolicy/src/registry.rs +++ b/src/tools/genpolicy/src/registry.rs @@ -374,6 +374,7 @@ pub fn add_verity_to_store(cache_file: &str, diff_id: &str, verity_hash: &str) - let mut writer = BufWriter::new(&file); writeln!(writer, "{}", serialized)?; writer.flush()?; + #[allow(unstable_name_collisions)] file.unlock()?; Ok(()) } From be02780ae27f9c5e59e6e658c496e3d5ed094609 Mon Sep 17 00:00:00 2001 From: Manuel Huber Date: Fri, 14 Feb 2025 20:35:28 +0000 Subject: [PATCH 2/4] powerpc64: Fix rust v1.84 build issue - subset of upstream commit 099b241702c336f075cdc8873252d00086a4e240 - should be straightforward to merge when sync-ing to upstream Signed-off-by: Manuel Huber --- src/libs/kata-sys-util/src/protection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/kata-sys-util/src/protection.rs b/src/libs/kata-sys-util/src/protection.rs index 51352a9d458d..a74e450ff4cf 100644 --- a/src/libs/kata-sys-util/src/protection.rs +++ b/src/libs/kata-sys-util/src/protection.rs @@ -237,7 +237,7 @@ pub fn available_guest_protection() -> Result Ok(GuestProtection::Se) } -#[cfg(target_arch = "powerpc64le")] +#[cfg(all(target_arch = "powerpc64", target_endian = "little"))] pub fn available_guest_protection() -> Result { if !Uid::effective().is_root() { return Err(check::ProtectionError::NoPerms); From 5163038ee22e5f7146237d1a68201a826cdaceb8 Mon Sep 17 00:00:00 2001 From: Manuel Huber Date: Fri, 14 Feb 2025 20:38:03 +0000 Subject: [PATCH 3/4] agent: config: Remove supports_seccomp - counterpart to upstream a131eec5c1517f7120725d287f481e47ce56fdc3 - unblocks build with rust v1.84 Signed-off-by: Manuel Huber --- src/agent/src/config.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/agent/src/config.rs b/src/agent/src/config.rs index 75c0a245c2ee..921ebe8b3cfc 100644 --- a/src/agent/src/config.rs +++ b/src/agent/src/config.rs @@ -2,7 +2,6 @@ // // SPDX-License-Identifier: Apache-2.0 // -use crate::rpc; use anyhow::{bail, ensure, Context, Result}; use serde::Deserialize; use std::env; @@ -63,7 +62,6 @@ pub struct AgentConfig { pub server_addr: String, pub unified_cgroup_hierarchy: bool, pub tracing: bool, - pub supports_seccomp: bool, } #[derive(Debug, Deserialize)] @@ -137,7 +135,6 @@ impl Default for AgentConfig { server_addr: format!("{}:{}", VSOCK_ADDR, DEFAULT_AGENT_VSOCK_PORT), unified_cgroup_hierarchy: false, tracing: false, - supports_seccomp: rpc::have_seccomp(), } } } From 37b10e4bed418a89b28e969ef466b9f84ddb0f76 Mon Sep 17 00:00:00 2001 From: Manuel Huber Date: Fri, 14 Feb 2025 20:39:03 +0000 Subject: [PATCH 4/4] protocols: Fix rust linter error with rust v1.84 - post-process to remove box_pointers annotation for generated files - while this unblocks the build, should look for better solution: - request/teach codegen to not add certain linter annotation - update ttrpc-codegen or other dependencies Signed-off-by: Manuel Huber --- src/libs/protocols/build.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/libs/protocols/build.rs b/src/libs/protocols/build.rs index bc34c07a07a0..770f1e9d2911 100644 --- a/src/libs/protocols/build.rs +++ b/src/libs/protocols/build.rs @@ -215,6 +215,34 @@ fn real_main() -> Result<(), std::io::Error> { "self: ::std::boxed::Box", )?; + let mut box_pointers_files = vec![ + "src/types.rs", + "src/agent.rs", + "src/agent_ttrpc.rs", + "src/csi.rs", + "src/empty.rs", + "src/gogo.rs", + "src/health.rs", + "src/health_ttrpc.rs", + "src/oci.rs", + ]; + + #[cfg(feature = "async")] + { + box_pointers_files.extend(vec![ + "src/agent_ttrpc_async.rs", + "src/health_ttrpc_async.rs" + ]); + } + + for f in box_pointers_files { + replace_text_in_file( + f, + "#![allow(box_pointers)]", + "", + )?; + } + Ok(()) }