Skip to content

Commit

Permalink
Merge pull request #313 from microsoft/kata/rust184
Browse files Browse the repository at this point in the history
Prepare for build with rust v1.84
  • Loading branch information
ms-mahuber authored Feb 15, 2025
2 parents 8d1ba49 + 37b10e4 commit 4779365
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/agent/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)]
Expand Down Expand Up @@ -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(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/kata-sys-util/src/protection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pub fn available_guest_protection() -> Result<GuestProtection, ProtectionError>
Ok(GuestProtection::Se)
}

#[cfg(target_arch = "powerpc64le")]
#[cfg(all(target_arch = "powerpc64", target_endian = "little"))]
pub fn available_guest_protection() -> Result<check::GuestProtection, check::ProtectionError> {
if !Uid::effective().is_root() {
return Err(check::ProtectionError::NoPerms);
Expand Down
28 changes: 28 additions & 0 deletions src/libs/protocols/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,34 @@ fn real_main() -> Result<(), std::io::Error> {
"self: ::std::boxed::Box<Self>",
)?;

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(())
}

Expand Down
1 change: 1 addition & 0 deletions src/tools/genpolicy/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down

0 comments on commit 4779365

Please sign in to comment.