Skip to content

Commit

Permalink
Add static checks for ppc64le
Browse files Browse the repository at this point in the history
  • Loading branch information
Amulyam24 committed Jan 5, 2024
1 parent 3833bda commit 4ca3dda
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
- "ubuntu-20.04"
- "arm-no-k8s"
- "s390x"
- "ppc64le"
runs-on: ${{ matrix.instance }}
steps:
- name: Adjust a permission for repo
Expand Down
4 changes: 2 additions & 2 deletions src/agent/src/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use std::os::unix::io::{AsRawFd, FromRawFd};
use tracing::instrument;

pub const RNGDEV: &str = "/dev/random";
pub const RNDADDTOENTCNT: libc::c_int = 0x40045201;
pub const RNDRESEEDCRNG: libc::c_int = 0x5207;
pub const RNDADDTOENTCNT: libc::c_uint = 0x40045201;
pub const RNDRESEEDCRNG: libc::c_uint = 0x20005207;

// Handle the differing ioctl(2) request types for different targets
#[cfg(target_env = "musl")]
Expand Down
7 changes: 7 additions & 0 deletions src/agent/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use async_trait::async_trait;
use rustjail::{pipestream::PipeStream, process::StreamType};
use tokio::io::{AsyncReadExt, AsyncWriteExt, ReadHalf};
use tokio::sync::Mutex;
use cfg_if::cfg_if;

use std::ffi::{CString, OsStr};
use std::fmt::Debug;
Expand Down Expand Up @@ -2695,6 +2696,12 @@ OtherField:other
#[tokio::test]
async fn test_volume_capacity_stats() {
skip_if_not_root!();
let block_size = 4 * 1024;
cfg_if! {
if #[cfg(target_arch = "powerpc64le")] {
block_size = 64 * 1024;
}
}

// Verify error if path does not exist
assert!(get_volume_capacity_stats("/does-not-exist").is_err());
Expand Down
4 changes: 2 additions & 2 deletions src/dragonball/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ include ../../utils.mk

PROJECT_DIRS := $(shell find . -name Cargo.toml -printf '%h\n' | sort -u)

ifeq ($(ARCH), s390x)
ifeq ($(ARCH), $(filter $(ARCH), s390x ppc64le))
default build check test clippy vendor:
@echo "s390x not support currently"
@echo "$(ARCH) is not support currently"
exit 0
else

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/cmd/kata-runtime/kata-env_ppc64le_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "testing"

func getExpectedHostDetails(tmpdir string) (HostInfo, error) {
expectedVendor := ""
expectedModel := "POWER8"
expectedModel := "POWER9"
expectedVMContainerCapable := true
return genericGetExpectedHostDetails(tmpdir, expectedVendor, expectedModel, expectedVMContainerCapable)
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/agent-ctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include ../../../utils.mk

ifeq ($(ARCH), ppc64le)
override ARCH = powerpc64le
endif
endif

.DEFAULT_GOAL := default
default: build
Expand Down
6 changes: 5 additions & 1 deletion src/tools/kata-ctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

include ../../../utils.mk

ifeq ($(ARCH), ppc64le)
override ARCH = powerpc64le
endif

PROJECT_NAME = Kata Containers
PROJECT_URL = https://github.com/kata-containers
PROJECT_COMPONENT = kata-ctl
Expand Down Expand Up @@ -36,7 +40,7 @@ default: $(TARGET) build

$(TARGET): $(GENERATED_CODE)

build:
build: update
@RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) $(if $(findstring release,$(BUILD_TYPE)),--release) $(EXTRA_RUSTFEATURES)

static-checks-build: $(GENERATED_CODE)
Expand Down
2 changes: 1 addition & 1 deletion src/tools/runk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include ../../../utils.mk

ifeq ($(ARCH), ppc64le)
override ARCH = powerpc64le
endif
endif

TARGET = runk
TARGET_PATH = target/$(TRIPLE)/$(BUILD_TYPE)/$(TARGET)
Expand Down
2 changes: 1 addition & 1 deletion src/tools/trace-forwarder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include ../../../utils.mk

ifeq ($(ARCH), ppc64le)
override ARCH = powerpc64le
endif
endif

.DEFAULT_GOAL := default
default: build
Expand Down

0 comments on commit 4ca3dda

Please sign in to comment.