mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-02-21 22:34:29 +00:00
genpolicy is a developer tool that should be usable on MacOS. Adding it to the darwin CI job ensures that it can still be built after changes. On an Apple M2, the output of `uname -m` is `arm64`, which is why a new case is needed in the arch_to_* functions. We're not going to cross-compile binaries on darwin, so don't install any additional Rust targets. Fixes: #11635 Signed-off-by: Markus Rudy <mr@edgeless.systems>
52 lines
1.1 KiB
Bash
Executable File
52 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Copyright (c) 2022 Apple Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -e
|
|
|
|
cidir=$(dirname "$0")
|
|
runtimedir=${cidir}/../src/runtime
|
|
genpolicydir=${cidir}/../src/tools/genpolicy
|
|
|
|
build_working_packages() {
|
|
# working packages:
|
|
device_api=${runtimedir}/pkg/device/api
|
|
device_config=${runtimedir}/pkg/device/config
|
|
device_drivers=${runtimedir}/pkg/device/drivers
|
|
device_manager=${runtimedir}/pkg/device/manager
|
|
rc_pkg_dir=${runtimedir}/pkg/resourcecontrol/
|
|
utils_pkg_dir=${runtimedir}/virtcontainers/utils
|
|
|
|
# broken packages :( :
|
|
#katautils=$runtimedir/pkg/katautils
|
|
#oci=$runtimedir/pkg/oci
|
|
#vc=$runtimedir/virtcontainers
|
|
|
|
pkgs=(
|
|
"${device_api}"
|
|
"${device_config}"
|
|
"${device_drivers}"
|
|
"${device_manager}"
|
|
"${utils_pkg_dir}"
|
|
"${rc_pkg_dir}")
|
|
for pkg in "${pkgs[@]}"; do
|
|
echo building "${pkg}"
|
|
pushd "${pkg}" &>/dev/null
|
|
go build
|
|
go test
|
|
popd &>/dev/null
|
|
done
|
|
}
|
|
|
|
build_working_packages
|
|
|
|
build_genpolicy() {
|
|
echo "building genpolicy"
|
|
pushd "${genpolicydir}" &>/dev/null
|
|
make TRIPLE=aarch64-apple-darwin build
|
|
}
|
|
|
|
build_genpolicy
|