From ff2e90cd070371c183e91ca5257dfee8f0efdcf6 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 28 Oct 2025 09:52:18 -0400 Subject: [PATCH 1/2] tracing: Log to stderr, and drop timestamps This matches bootc's setup (without the journal integration for now as we don't strictly need it). But specifically this fixes setting `RUST_LOG` and having that break the monitor-status JSON stream: https://github.com/bootc-dev/bcvk/pull/86#issuecomment-3449122162 Signed-off-by: Colin Walters --- crates/kit/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/kit/src/main.rs b/crates/kit/src/main.rs index c97f005..815f092 100644 --- a/crates/kit/src/main.rs +++ b/crates/kit/src/main.rs @@ -154,7 +154,11 @@ fn install_tracing() { use tracing_subscriber::prelude::*; use tracing_subscriber::EnvFilter; - let fmt_layer = fmt::layer().with_target(false).with_writer(std::io::stderr); + let format = fmt::format().without_time().with_target(false).compact(); + + let fmt_layer = fmt::layer() + .event_format(format) + .with_writer(std::io::stderr); let filter_layer = EnvFilter::try_from_default_env() .or_else(|_| EnvFilter::try_new("info")) .unwrap(); From 9cfc18ec2bd4224e466c404eb339865732df2095 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 28 Oct 2025 11:06:52 -0400 Subject: [PATCH 2/2] ephemeral: Stop propagating RUST_LOG by default, add --env For reasons I haven't debugged yet this breaks our systemd/vsock integration. Signed-off-by: Colin Walters --- crates/kit/src/run_ephemeral.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/kit/src/run_ephemeral.rs b/crates/kit/src/run_ephemeral.rs index fb103f6..07b6694 100644 --- a/crates/kit/src/run_ephemeral.rs +++ b/crates/kit/src/run_ephemeral.rs @@ -154,6 +154,13 @@ pub struct CommonPodmanOptions { help = "Add metadata to the container in key=value form" )] pub label: Vec, + + #[clap( + long = "env", + short = 'e', + help = "Set environment variables in the container (key=value)" + )] + pub env: Vec, } /// Common VM configuration options for hardware, networking, and features. @@ -400,6 +407,9 @@ fn prepare_run_command_with_temp( if opts.podman.detach { cmd.arg("-d"); } + for env in opts.podman.env.iter() { + cmd.arg(format!("--env={env}")); + } let vhost_dev = Utf8Path::new(qemu::VHOST_VSOCK) .try_exists()? @@ -463,11 +473,6 @@ fn prepare_run_command_with_temp( cmd.args(["-v", &format!("{}:/run/systemd-units:ro", units_dir)]); } - // Propagate this by default - if let Some(log) = std::env::var("RUST_LOG").ok() { - cmd.arg(format!("--env=RUST_LOG={log}")); - } - // Pass configuration as JSON via BCK_CONFIG environment variable let config = serde_json::to_string(&opts).unwrap(); cmd.args(["-e", &format!("BCK_CONFIG={config}")]);