Files
Drew Newberry eeba0e7954 refactor(runtime): confine and reduce unsafe code (#4130)
* refactor(runtime): confine and reduce unsafe code

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(ci): make signal probe portable and gate Linux initialization

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(cli): handle platform-specific SSH cancellation lints

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

---------

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
2026-10-10 01:12:03 +00:00

133 lines
4.9 KiB
TOML

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
[package]
name = "openshell-driver-vm"
description = "MicroVM compute driver for OpenShell"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
[lib]
name = "openshell_driver_vm"
path = "src/lib.rs"
[[bin]]
name = "openshell-driver-vm"
path = "src/main.rs"
required-features = ["compute-driver"]
[[bin]]
name = "openshell-vm-init"
path = "src/bin/openshell-vm-init.rs"
[dependencies]
openshell-core = { path = "../openshell-core", default-features = false }
openshell-isolation-interface = { path = "../openshell-isolation-interface" }
openshell-sandbox-backend = { path = "../openshell-sandbox-backend" }
openshell-otel = { path = "../openshell-otel", optional = true }
openshell-policy = { path = "../openshell-policy", optional = true }
openshell-driver-podman = { path = "../openshell-driver-podman", optional = true }
openshell-vfio = { path = "../openshell-vfio", optional = true }
base64 = { workspace = true, optional = true }
bollard = { version = "0.20", features = ["ssh"], optional = true }
tokio = { workspace = true }
tonic = { workspace = true, features = ["transport"], optional = true }
tower-http = { workspace = true, optional = true }
http = { workspace = true, optional = true }
prost = { workspace = true, optional = true }
prost-types = { workspace = true, optional = true }
futures = { workspace = true, optional = true }
tokio-stream = { workspace = true, features = ["net"], optional = true }
nix = { workspace = true, optional = true, features = ["resource"] }
clap = { workspace = true, optional = true }
tracing = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }
opentelemetry = { workspace = true, optional = true }
opentelemetry_sdk = { workspace = true, optional = true }
tracing-opentelemetry = { workspace = true, optional = true }
miette = { workspace = true, optional = true }
rand = { workspace = true, optional = true }
url = { workspace = true, optional = true }
serde = { workspace = true }
serde_json = { workspace = true }
oci-client = { version = "0.16", optional = true }
libc = "0.2"
rustix = { workspace = true, features = ["fs"] }
libloading = { version = "0.8", optional = true }
tar = { version = "0.4", optional = true }
flate2 = { version = "1", optional = true }
sha2 = { version = "0.10", optional = true }
zstd = { version = "0.13", optional = true }
[features]
# Portable test instrumentation, independent of the compute runtime.
allocation-tracking = []
default = ["compute-driver", "telemetry"]
## Build the standalone compute driver and its host runtime implementation.
compute-driver = [
"dep:base64",
"dep:bollard",
"dep:clap",
"dep:flate2",
"dep:futures",
"dep:http",
"dep:libloading",
"dep:miette",
"dep:nix",
"dep:oci-client",
"dep:openshell-otel",
"dep:openshell-policy",
"dep:openshell-driver-podman",
"dep:openshell-vfio",
"dep:opentelemetry",
"dep:opentelemetry_sdk",
"dep:polling",
"dep:prost",
"dep:prost-types",
"dep:rand",
"dep:sha2",
"dep:tar",
"dep:tokio-stream",
"dep:tonic",
"dep:tower-http",
"dep:tracing",
"dep:tracing-opentelemetry",
"dep:tracing-subscriber",
"dep:url",
"dep:zstd",
]
## Compile in telemetry support (forwards to openshell-core/telemetry). On by
## default; build with `--no-default-features` for a telemetry-free VM driver
## that reports telemetry disabled to the sandboxes it launches.
telemetry = ["openshell-core/telemetry"]
## Convenience alias: every default feature except `telemetry`. Build a
## telemetry-free VM driver with
## `--no-default-features --features defaults-without-telemetry` and stay
## correct as new default features are added. Cargo cannot subtract a single
## default feature, so this alias must be paired with `--no-default-features`;
## enabling it alongside `telemetry` is a compile error rather than a silent
## telemetry-on build. Kept in sync with `default` by
## `rust:verify:defaults-without-telemetry`.
defaults-without-telemetry = ["compute-driver"]
[dev-dependencies]
openshell-otel-test-support = { path = "../openshell-otel-test-support" }
temp-env = "0.3"
tempfile = "3"
opentelemetry_sdk = { workspace = true, features = ["testing"] }
# smol-rs/polling drives the BSD/macOS parent-death detection in
# procguard via kqueue's EVFILT_PROC / NOTE_EXIT filter. We could use
# it on Linux too (via epoll + pidfd) but sticking with
# nix::sys::prctl::set_pdeathsig there keeps the Linux path a single
# syscall with no helper thread.
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd", target_os = "dragonfly"))'.dependencies]
polling = { version = "3.11", optional = true }
[lints]
workspace = true