Skip to content

Commit 6976756

Browse files
committed
kata.runtime-rs: init
1 parent e09e584 commit 6976756

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
lib,
3+
rustPlatform,
4+
runtime,
5+
protobuf,
6+
pkg-config,
7+
openssl,
8+
9+
withDragonball ? false,
10+
}:
11+
12+
rustPlatform.buildRustPackage rec {
13+
pname = "kata-runtime-rs";
14+
inherit (runtime) version src;
15+
16+
sourceRoot = "${src.name}/src/runtime-rs";
17+
18+
cargoLock = {
19+
lockFile = "${src}/src/runtime-rs/Cargo.lock";
20+
outputHashes = {
21+
"api_client-0.1.0" = "sha256-aWtVgYlcbssL7lQfMFGJah8DrJN0s/w1ZFncCPHT1aE=";
22+
};
23+
};
24+
25+
postPatch = ''
26+
substitute crates/shim/src/config.rs.in crates/shim/src/config.rs \
27+
--replace-fail @PROJECT_NAME@ "Kata Containers" \
28+
--replace-fail @RUNTIME_VERSION@ ${version} \
29+
--replace-fail @COMMIT@ none \
30+
--replace-fail @RUNTIME_NAME@ containerd-shim-kata-v2 \
31+
--replace-fail @CONTAINERD_RUNTIME_NAME@ io.containerd.kata.v2
32+
'';
33+
34+
nativeBuildInputs = [
35+
pkg-config
36+
protobuf
37+
];
38+
39+
buildInputs = [
40+
openssl
41+
openssl.dev
42+
];
43+
44+
# Build.rs writes to src
45+
postConfigure = ''
46+
chmod -R +w ../..
47+
'';
48+
49+
buildFeatures = lib.optional withDragonball "dragonball";
50+
51+
env.OPENSSL_NO_VENDOR = 1;
52+
53+
# Tests currently fail with:
54+
# ---- crates/hypervisor/src/qemu/cmdline_generator.rs - qemu::cmdline_generator::QemuCmdLine<'a>::add_pcie_root_ports (line 2564) stdout ----
55+
# error: expected one of `!` or `::`, found `.`
56+
# --> crates/hypervisor/src/qemu/cmdline_generator.rs:2565:5
57+
# |
58+
# 1 | pcie.0 bus
59+
# checkFlags = [
60+
# "--skip=device::device_manager::tests::test_new_block_device"
61+
# "--skip=network::endpoint::endpoints_test::tests::test_ipvlan_construction"
62+
# "--skip=network::endpoint::endpoints_test::tests::test_macvlan_construction"
63+
# "--skip=network::endpoint::endpoints_test::tests::test_vlan_construction"
64+
# "--skip=test::test_new_hypervisor"
65+
# ];
66+
doCheck = false;
67+
68+
meta = {
69+
changelog = "https://github.com/kata-containers/kata-containers/releases/tag/${version}";
70+
homepage = "https://github.com/kata-containers/kata-containers";
71+
mainProgram = "genpolicy";
72+
license = lib.licenses.asl20;
73+
};
74+
}

0 commit comments

Comments
 (0)