refactor: split ecr into library and cli crates

The root package becomes a virtual workspace: `crates/ecr` holds the
library (package name `ecr`) and `crates/ecr-cli` the command line
front-end, which keeps installing the `ecr` binary. No behavior change.

The library must not depend on CLI types, so mount::setup_mounts now
takes the `no_bind` flag instead of a `&Args`.
This commit is contained in:
2026-09-20 23:29:03 +02:00
parent 7137aa15c5
commit b6e5b4f006
19 changed files with 129 additions and 73 deletions
+5 -41
View File
@@ -1,50 +1,14 @@
[package]
name = "ecr"
[workspace]
resolver = "2"
members = ["crates/ecr", "crates/ecr-cli"]
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.77"
description = "Enter chroot environments with Linux namespaces"
license = "MIT"
authors = ["Valentin Haudiquet"]
[dependencies]
# CLI parsing
clap = { version = "4", features = ["derive", "env"] }
# Config parsing
serde = { version = "1", features = ["derive"] }
serde_yaml = "0.9"
# HTTP downloads
reqwest = { version = "0.13", features = ["blocking", "stream"] }
# Tarball extraction
tar = "0.4"
flate2 = "1"
xz2 = "0.1"
zstd = "0.13"
# Unix syscall bindings
nix = { version = "0.31", features = ["fs", "mount", "sched", "signal", "user", "process", "hostname"] }
# Temp directories
tempfile = "3"
# Error handling
anyhow = "1"
# Utilities
dirs = "6"
which = "7"
cpio = "0.4"
base64 = "0.22"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "io-util"] }
futures-util = "0.3"
indicatif = "0.18"
serde_json = "1"
libc = "0.2"
users = "0.11"
[profile.release]
strip = true
opt-level = "z"