Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,072 changes: 620 additions & 452 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resolver = "2"
color-eyre = "0.6"
const_format = "0.2"
cfg-if = "1.0.0"
rand = "0.9"
rand = "0.10"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
tracing-error = { version = "0.2.0" }
Expand Down
4 changes: 2 additions & 2 deletions crates/bcvk-qemu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ cap-std-ext = { workspace = true }
color-eyre = { workspace = true }
data-encoding = "2.9"
libc = "0.2"
nix = { version = "0.29", features = ["socket"] }
nix = { version = "0.31", features = ["socket"] }
rustix = { version = "1", features = ["pipe", "process"] }
tokio = { version = "1", features = ["fs", "process", "time", "macros"] }
tracing = { workspace = true }
vsock = "=0.5.1"
vsock = "=0.5.4"

[lints]
workspace = true
4 changes: 2 additions & 2 deletions crates/integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ itest = { path = "../itest" }
bcvk = { path = "../kit" }
anyhow = "1"
linkme = "0.3"
dirs = "5.0"
dirs = "6.0"
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
tracing-error = { workspace = true }
xshell = { workspace = true }
cfg-if = { workspace = true }
serde = { version = "1.0.199", features = ["derive"] }
serde_json = "1.0.116"
zlink = "0.4"
zlink = "0.5"
tokio = { version = "1", features = ["rt", "net", "macros"] }
tempfile = "3"
uuid = { version = "1.18.1", features = ["v4"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/integration-tests/src/tests/libvirt_ignition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{get_bck_command, shell, LIBVIRT_INTEGRATION_TEST_LABEL};

/// Generate a random alphanumeric suffix for VM names to avoid collisions
fn random_suffix() -> String {
use rand::{distr::Alphanumeric, Rng};
use rand::{distr::Alphanumeric, RngExt};
rand::rng()
.sample_iter(&Alphanumeric)
.take(8)
Expand Down
2 changes: 1 addition & 1 deletion crates/integration-tests/src/tests/libvirt_verb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use bcvk::xml_utils::parse_xml_dom;

/// Generate a random alphanumeric suffix for VM names to avoid collisions
fn random_suffix() -> String {
use rand::{distr::Alphanumeric, Rng};
use rand::{distr::Alphanumeric, RngExt};
rand::rng()
.sample_iter(&Alphanumeric)
.take(8)
Expand Down
2 changes: 1 addition & 1 deletion crates/itest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ itest-macros = { path = "../itest-macros" }
libtest-mimic = "0.8"
linkme = "0.3"
paste = "1"
quick-junit = "0.5"
quick-junit = "0.6"
rustix = { version = "1", default-features = false, features = ["fs", "pipe", "process"] }
tokio = { version = "1", features = ["rt"] }
xshell = { workspace = true }
Expand Down
38 changes: 19 additions & 19 deletions crates/kit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,56 @@ chrono = { version = "0.4", features = ["serde"] }
const_format = { workspace = true }
color-eyre = { workspace = true }
clap = { version = "4.4", features = ["derive", "env"] }
clap_mangen = { version = "0.2.20", optional = true }
clap_mangen = { version = "0.3.0", optional = true }
data-encoding = { version = "2.9" }
dirs = "5.0"
dirs = "6.0"
fn-error-context = { version = "0.2" }
indicatif = "0.17"
notify = "6.1"
thiserror = "1.0"
indicatif = "0.18"
notify = "8.0"
thiserror = "2.0"
serde = { version = "1.0.199", features = ["derive"] }
serde_json = "1.0.116"
serde_yaml = "0.9"
tokio = { version = "1", features = ["full"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
tracing-error = { workspace = true }
shlex = "1"
reqwest = { version = "0.12", features = ["blocking"] }
shlex = "2"
reqwest = { version = "0.13", features = ["blocking"] }
tempfile = "3"
uuid = { version = "1.10", features = ["v4"] }
xshell = { workspace = true }
yaml-rust2 = "0.9"
yaml-rust2 = "0.11"
rand = { workspace = true }
cfg-if = { workspace = true }
indoc = "2.0.6"
regex = "1.10"
itertools = "0.14.0"
itertools = "0.15.0"
camino = "1.1.12"
comfy-table = "7.1"
strum = { version = "0.26", features = ["derive"] }
quick-xml = "0.36"
oci-spec = "0.8.2"
sha2 = "0.10"
which = "7.0"
strum = { version = "0.28", features = ["derive"] }
quick-xml = "0.41"
oci-spec = "0.10.0"
sha2 = "0.11"
which = "8.0"
cpio = "0.4"

# Linux-only dependencies
[target.'cfg(target_os = "linux")'.dependencies]
bcvk-qemu = { path = "../bcvk-qemu" }
cap-std-ext = { workspace = true }
bootc-mount = { git = "https://github.com/bootc-dev/bootc", rev = "93b22f4dbc2d54f7cca7c1df3ee59fcdec0b2cf1" }
bootc-utils = { git = "https://github.com/bootc-dev/bootc", rev = "93b22f4dbc2d54f7cca7c1df3ee59fcdec0b2cf1" }
bootc-mount = { package = "bootc-internal-mount", git = "https://github.com/bootc-dev/bootc", rev = "54768712ee0308c51ccd27e8d7772d9c9f9aad39" }
bootc-utils = { package = "bootc-internal-utils", git = "https://github.com/bootc-dev/bootc", rev = "54768712ee0308c51ccd27e8d7772d9c9f9aad39" }
rustix = { version = "1", features = ["thread", "net", "fs", "pipe", "system", "process", "mount"] }
vsock = "0.5"
nix = { version = "0.29", features = ["socket"] }
nix = { version = "0.31", features = ["socket"] }
libc = "0.2"
zlink = "0.4"
zlink = "0.5"
futures-util = "0.3"
libsystemd = "0.7"

[dev-dependencies]
similar-asserts = "1.5"
similar-asserts = "2.0"

[features]
# Implementation detail of man page generation.
Expand Down
9 changes: 8 additions & 1 deletion crates/kit/src/cache_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@ impl DiskImageMetadata {
let json = serde_json::to_string(&inputs).expect("Failed to serialize cache inputs");
let mut hasher = Sha256::new();
hasher.update(json.as_bytes());
format!("sha256:{:x}", hasher.finalize())
format!(
"sha256:{}",
hasher
.finalize()
.iter()
.map(|b| format!("{b:02x}"))
.collect::<String>()
)
}

/// Write metadata to a file using extended attributes via rustix
Expand Down
2 changes: 1 addition & 1 deletion crates/kit/src/libvirt/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ pub fn list_storage_pool_volumes(connect_uri: Option<&str>) -> Result<Vec<Utf8Pa

/// Find an available SSH port for port forwarding using random allocation
fn find_available_ssh_port() -> u16 {
use rand::Rng;
use rand::RngExt;

// Try random ports in the range 2222-3000 to avoid conflicts in concurrent scenarios
let mut rng = rand::rng();
Expand Down
8 changes: 4 additions & 4 deletions crates/kit/src/run_ephemeral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ pub(crate) async fn run_impl(opts: RunEphemeralOpts) -> Result<()> {
&format!(".linux={}", kernel_mount),
kernel_info.kernel_path.as_str(),
])
.run()
.run_capture_stderr()
.map_err(|e| eyre!("Failed to extract kernel from UKI: {e}"))?;
debug!("Extracted kernel from UKI to {}", kernel_mount);

Expand All @@ -1379,7 +1379,7 @@ pub(crate) async fn run_impl(opts: RunEphemeralOpts) -> Result<()> {
&format!(".initrd={}", initramfs_mount),
kernel_info.kernel_path.as_str(),
])
.run()
.run_capture_stderr()
.map_err(|e| eyre!("Failed to extract initramfs from UKI: {e}"))?;
debug!("Extracted initramfs from UKI to {}", initramfs_mount);
} else {
Expand All @@ -1399,7 +1399,7 @@ pub(crate) async fn run_impl(opts: RunEphemeralOpts) -> Result<()> {
kernel_info.kernel_path.as_str(),
kernel_mount,
])
.run()
.run_capture_stderr()
.map_err(|e| eyre!("Failed to bind mount kernel: {e}"))?;

// Copy initramfs so we can append to it
Expand Down Expand Up @@ -1762,7 +1762,7 @@ StandardOutput=file:/dev/virtio-ports/executestatus

Command::new("mkswap")
.args(["-q", path.as_str()])
.run()
.run_capture_stderr()
.map_err(|e| eyre!("{e}"))?;

qemu_config.add_virtio_blk_device_with_format(
Expand Down
10 changes: 5 additions & 5 deletions crates/kit/src/varlink_ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use serde::{Deserialize, Serialize};
// ---------------------------------------------------------------------------

/// Reply for the images `List` method.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, zlink::introspect::Type)]
pub(crate) struct ListReply {
/// Image names/tags that have `containers.bootc=1`.
/// Each entry is a full image reference (e.g. `quay.io/centos-bootc/centos-bootc:stream9`).
Expand All @@ -35,7 +35,7 @@ pub(crate) struct ListReply {
}

/// Reply for the ephemeral `Ps` method.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, zlink::introspect::Type)]
pub(crate) struct PsReply {
/// Container IDs of running ephemeral VMs (label `bcvk.ephemeral=1`).
/// Use `podman inspect` for further details.
Expand Down Expand Up @@ -81,14 +81,14 @@ pub(crate) struct EphemeralRunOpts {
}

/// Reply for the ephemeral `Run` method.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, zlink::introspect::Type)]
pub(crate) struct RunReply {
/// Container ID of the launched ephemeral VM.
container_id: String,
}

/// Reply for the ephemeral `GetSshConnectionInfo` method.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, zlink::introspect::Type)]
pub(crate) struct GetSshConnectionInfoReply {
/// Container ID to use with `podman exec`.
container_id: String,
Expand All @@ -103,7 +103,7 @@ pub(crate) struct GetSshConnectionInfoReply {
}

/// Reply for the `io.bootc.vk.todisk` `ToDisk` method.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Serialize, Deserialize, zlink::introspect::Type)]
pub(crate) struct ToDiskReply {
/// Absolute path to the created (or reused) disk image.
path: String,
Expand Down
9 changes: 6 additions & 3 deletions crates/kit/src/xml_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#![cfg_attr(not(target_os = "linux"), allow(dead_code))]

use color_eyre::{eyre::eyre, Result};
use quick_xml::escape::unescape;
use quick_xml::events::{BytesEnd, BytesStart, BytesText, Event};
use quick_xml::reader::Reader;
use quick_xml::writer::Writer;
Expand Down Expand Up @@ -223,9 +224,11 @@ pub fn parse_xml_dom(xml: &str) -> Result<XmlNode> {
}
}
Ok(Event::Text(e)) => {
if let Ok(text) = e.unescape() {
if let Some(current) = stack.last_mut() {
current.text.push_str(&text);
if let Ok(decoded) = e.decode() {
if let Ok(text) = unescape(&decoded) {
if let Some(current) = stack.last_mut() {
current.text.push_str(&text);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ camino = "1.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tempfile = "3.0"
toml = "0.8"
toml = "1.0"

[lints]
workspace = true
Loading