git.delta.rocks / jrsonnet / refs/commits / a1a72ceb9060

difftreelog

feat reenable indicatif, since the eaten line was fixed

Lach2025-03-29parent: #4e5d91e.patch.diff
in: trunk

3 files changed

modifiedcmds/fleet/Cargo.tomldiffbeforeafterboth
before · cmds/fleet/Cargo.toml
1[package]2name = "fleet"3description = "NixOS configuration management"4version = "0.2.0"5authors = ["Yaroslav Bolyukin <iam@lach.pw>"]6edition.workspace = true7rust-version.workspace = true89[dependencies]10nixlike.workspace = true11better-command.workspace = true12tokio.workspace = true13clap.workspace = true14clap_complete.workspace = true15age = { workspace = true, features = ["armor"] }16anyhow.workspace = true17tracing.workspace = true18tracing-subscriber.workspace = true19serde.workspace = true20serde_json.workspace = true21tempfile.workspace = true22time = { version = "0.3", features = ["serde"] }23hostname = "0.4.0"24age-core = "0.11"25peg = "0.8"26base64 = "0.22.1"27chrono = { version = "0.4", features = ["serde"] }28tokio-util = { version = "0.7", features = ["codec"] }29async-trait = "0.1"30futures = "0.3"31itertools = "0.13"32shlex = "1.3"33tabled = { version = "0.16" }34owo-colors = { version = "4.0", features = [35	"supports-color",36	"supports-colors",37] }38abort-on-drop = "0.2"39regex = "1.10"40openssh = "0.11"41crossterm = { version = "0.28.0", features = ["use-dev-tty"] }42fleet-shared.workspace = true4344tracing-indicatif = { version = "0.3", optional = true }45human-repr = { version = "1.1", optional = true }46indicatif = { version = "0.17", optional = true }47nix-eval.workspace = true48nom = "7.1.3"49fleet-base = { version = "0.1.0", path = "../../crates/fleet-base" }5051[features]52# Not quite stable53indicatif = [54	"dep:tracing-indicatif",55	"dep:indicatif",56	"dep:human-repr",57	"better-command/indicatif",58]
after · cmds/fleet/Cargo.toml
1[package]2name = "fleet"3description = "NixOS configuration management"4version = "0.2.0"5authors = ["Yaroslav Bolyukin <iam@lach.pw>"]6edition.workspace = true7rust-version.workspace = true89[dependencies]10nixlike.workspace = true11better-command.workspace = true12tokio.workspace = true13clap.workspace = true14clap_complete.workspace = true15age = { workspace = true, features = ["armor"] }16anyhow.workspace = true17tracing.workspace = true18tracing-subscriber.workspace = true19serde.workspace = true20serde_json.workspace = true21tempfile.workspace = true22time = { version = "0.3", features = ["serde"] }23hostname = "0.4.0"24age-core = "0.11"25peg = "0.8"26base64 = "0.22.1"27chrono = { version = "0.4", features = ["serde"] }28tokio-util = { version = "0.7", features = ["codec"] }29async-trait = "0.1"30futures = "0.3"31itertools = "0.13"32shlex = "1.3"33tabled = { version = "0.16" }34owo-colors = { version = "4.0", features = [35	"supports-color",36	"supports-colors",37] }38abort-on-drop = "0.2"39regex = "1.10"40openssh = "0.11"41crossterm = { version = "0.28.0", features = ["use-dev-tty"] }42fleet-shared.workspace = true4344tracing-indicatif = { version = "0.3", optional = true }45human-repr = { version = "1.1", optional = true }46indicatif = { version = "0.17", optional = true }47nix-eval.workspace = true48nom = "7.1.3"49fleet-base = { version = "0.1.0", path = "../../crates/fleet-base" }5051[features]52default = ["indicatif"]53# Not quite stable54indicatif = [55	"dep:tracing-indicatif",56	"dep:indicatif",57	"dep:human-repr",58	"better-command/indicatif",59]
modifiedcmds/fleet/src/main.rsdiffbeforeafterboth
--- a/cmds/fleet/src/main.rs
+++ b/cmds/fleet/src/main.rs
@@ -185,10 +185,6 @@
 #[tokio::main]
 async fn async_main(opts: RootOpts) -> ExitCode {
 	if let Err(e) = main_real(opts).await {
-		// If I remove this line, the next error!() line gets eaten.
-		// This is a bug in indicatif, it needs to be fixed
-		#[cfg(feature = "indicatif")]
-		info!("fixme: this line gets eaten by tracing-indicatif on levels info+");
 		error!("{e:#}");
 		return ExitCode::FAILURE;
 	}
modifiedcrates/fleet-base/src/opts.rsdiffbeforeafterboth
--- a/crates/fleet-base/src/opts.rs
+++ b/crates/fleet-base/src/opts.rs
@@ -6,7 +6,7 @@
 	sync::{Arc, Mutex},
 };
 
-use anyhow::Result;
+use anyhow::{Context, Result};
 use clap::Parser;
 use nix_eval::{nix_go, util::assert_warn, NixSessionPool, Value};
 use nom::{
@@ -196,7 +196,8 @@
 
 		let mut fleet_data_path = directory.clone();
 		fleet_data_path.push("fleet.nix");
-		let bytes = std::fs::read_to_string(fleet_data_path)?;
+		let bytes =
+			std::fs::read_to_string(fleet_data_path).context("reading fleet state (fleet.nix)")?;
 		let data: Mutex<FleetData> = nixlike::parse_str(&bytes)?;
 
 		let fleet_root = Value::binding(nix_session.clone(), "fleetConfigurations").await?;