Files
OpenShell/crates/openshell-sandbox/Cargo.toml
Colin Walters e7f965a988 refactor(sandbox,driver-vm): Start moving to rustix (esp over libc unsafe) (#1505)
In the Rust ecosystem there's largely three ways to do system calls:

- raw libc
- nix
- rustix

Of the three, libc is almost all `unsafe` and really 95% of use
cases should be either nix or rustix. nix is the original one,
but after having looked at the code of both, I think rustix
is just better designed and organized. It's also reached 1.0,
whereas nix is still making semver-breaking changes (in fact
we're behind here in this project).

Now in practice, we have both *transitively* in the depchain
already, and that's true for quite a lot of projects.

But I think rustix is better, so let's add rustix as
a workspace dependency (process feature) and migrate
a few use cases to it - it's especially better than the raw
libc which is suprisingly widespread.

If we agree to do this, then many other calls can be ported.

Signed-off-by: Colin Walters <walters@verbum.org>
2026-05-21 15:20:21 -05:00

100 lines
2.3 KiB
TOML

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
[package]
name = "openshell-sandbox"
description = "OpenShell process sandbox and monitor"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
[[bin]]
name = "openshell-sandbox"
path = "src/main.rs"
[dependencies]
openshell-core = { path = "../openshell-core" }
openshell-ocsf = { path = "../openshell-ocsf" }
openshell-policy = { path = "../openshell-policy" }
openshell-router = { path = "../openshell-router" }
# Async runtime
tokio = { workspace = true }
# gRPC
tonic = { workspace = true, features = ["channel", "tls"] }
tokio-stream = { workspace = true }
# CLI
clap = { workspace = true }
# Error handling
miette = { workspace = true }
thiserror = { workspace = true }
anyhow = { workspace = true }
hmac = "0.12"
sha2 = { workspace = true }
hex = "0.4"
russh = "0.57"
rand_core = "0.6"
# OPA policy evaluation (no default features — full-opa pulls in opa-runtime which requires git in build)
regorus = { version = "0.9", default-features = false, features = ["std", "arc", "glob", "yaml"] }
# TLS
tokio-rustls = { workspace = true }
rustls = { workspace = true }
rustls-pemfile = { workspace = true }
rcgen = { workspace = true }
webpki-roots = { workspace = true }
# HTTP
bytes = { workspace = true }
# UUID
uuid = { workspace = true }
# Encoding
base64 = { workspace = true }
flate2 = "1"
sha1 = "0.10"
# IP network / CIDR parsing
ipnet = "2"
# Serialization
serde = { workspace = true }
serde_json = { workspace = true }
serde_yml = { workspace = true }
apollo-parser = { workspace = true }
glob = { workspace = true }
# Logging
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
tracing-appender = { workspace = true }
# Unix/Process
nix = { workspace = true }
[target.'cfg(unix)'.dependencies]
libc = "0.2"
rustix = { workspace = true }
[target.'cfg(target_os = "linux")'.dependencies]
landlock = "0.4"
seccompiler = "0.5"
tempfile = "3"
uuid = { version = "1", features = ["v4"] }
[dev-dependencies]
tempfile = "3"
temp-env = "0.3"
tokio-tungstenite = { workspace = true }
futures = { workspace = true }
[lints]
workspace = true