git.delta.rocks / jrsonnet / refs/commits / 94ece5cae749

difftreelog

build update to nixos release-25.05

luvuxwnmYaroslav Bolyukin2025-06-28parent: #1470de8.patch.diff
in: trunk

34 files changed

modifiedCargo.lockdiffbeforeafterboth
1# This file is automatically @generated by Cargo.1# This file is automatically @generated by Cargo.
2# It is not intended for manual editing.2# It is not intended for manual editing.
3version = 33version = 4
44
5[[package]]5[[package]]
6name = "abort-on-drop"6name = "abort-on-drop"
376 "tracing-indicatif",376 "tracing-indicatif",
377]377]
378
379[[package]]
380name = "bindgen"
381version = "0.69.5"
382source = "registry+https://github.com/rust-lang/crates.io-index"
383checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
384dependencies = [
385 "bitflags",
386 "cexpr",
387 "clang-sys",
388 "itertools 0.12.1",
389 "lazy_static",
390 "lazycell",
391 "log",
392 "prettyplease",
393 "proc-macro2",
394 "quote",
395 "regex",
396 "rustc-hash",
397 "shlex",
398 "syn",
399 "which",
400]
401378
402[[package]]379[[package]]
403name = "bitflags"380name = "bitflags"
487 "shlex",464 "shlex",
488]465]
489
490[[package]]
491name = "cexpr"
492version = "0.6.0"
493source = "registry+https://github.com/rust-lang/crates.io-index"
494checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
495dependencies = [
496 "nom 7.1.3",
497]
498466
499[[package]]467[[package]]
500name = "cfg-if"468name = "cfg-if"
558 "zeroize",526 "zeroize",
559]527]
560
561[[package]]
562name = "clang-sys"
563version = "1.8.1"
564source = "registry+https://github.com/rust-lang/crates.io-index"
565checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
566dependencies = [
567 "glob",
568 "libc",
569 "libloading",
570]
571528
572[[package]]529[[package]]
573name = "clap"530name = "clap"
1243source = "registry+https://github.com/rust-lang/crates.io-index"1200source = "registry+https://github.com/rust-lang/crates.io-index"
1244checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"1201checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
1245
1246[[package]]
1247name = "glob"
1248version = "0.3.1"
1249source = "registry+https://github.com/rust-lang/crates.io-index"
1250checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
12511202
1252[[package]]1203[[package]]
1253name = "h2"1204name = "h2"
1334 "digest",1285 "digest",
1335]1286]
1336
1337[[package]]
1338name = "home"
1339version = "0.5.9"
1340source = "registry+https://github.com/rust-lang/crates.io-index"
1341checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5"
1342dependencies = [
1343 "windows-sys 0.52.0",
1344]
13451287
1346[[package]]1288[[package]]
1347name = "hostname"1289name = "hostname"
1649source = "registry+https://github.com/rust-lang/crates.io-index"1591source = "registry+https://github.com/rust-lang/crates.io-index"
1650checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"1592checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
1651
1652[[package]]
1653name = "itertools"
1654version = "0.12.1"
1655source = "registry+https://github.com/rust-lang/crates.io-index"
1656checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
1657dependencies = [
1658 "either",
1659]
16601593
1661[[package]]1594[[package]]
1662name = "itertools"1595name = "itertools"
1700 "spin",1633 "spin",
1701]1634]
1702
1703[[package]]
1704name = "lazycell"
1705version = "1.3.0"
1706source = "registry+https://github.com/rust-lang/crates.io-index"
1707checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
17081635
1709[[package]]1636[[package]]
1710name = "libc"1637name = "libc"
1711version = "0.2.174"1638version = "0.2.174"
1712source = "registry+https://github.com/rust-lang/crates.io-index"1639source = "registry+https://github.com/rust-lang/crates.io-index"
1713checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"1640checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
1714
1715[[package]]
1716name = "libloading"
1717version = "0.8.5"
1718source = "registry+https://github.com/rust-lang/crates.io-index"
1719checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
1720dependencies = [
1721 "cfg-if",
1722 "windows-targets",
1723]
17241641
1725[[package]]1642[[package]]
1726name = "libm"1643name = "libm"
1889 "unindent",1806 "unindent",
1890]1807]
1891
1892[[package]]
1893name = "nix-native-eval"
1894version = "0.1.0"
1895dependencies = [
1896 "anyhow",
1897 "nixrs",
1898]
18991808
1900[[package]]1809[[package]]
1901name = "nixlike"1810name = "nixlike"
1911 "thiserror 2.0.12",1820 "thiserror 2.0.12",
1912]1821]
1913
1914[[package]]
1915name = "nixrs"
1916version = "0.1.0"
1917source = "git+https://github.com/Anillc/nixrs#740fcf4048cc5b6de8c54d18254f12d53909a867"
1918dependencies = [
1919 "libc",
1920 "nixrs-sys",
1921 "thiserror 1.0.69",
1922]
1923
1924[[package]]
1925name = "nixrs-sys"
1926version = "0.1.0"
1927source = "git+https://github.com/Anillc/nixrs#740fcf4048cc5b6de8c54d18254f12d53909a867"
1928dependencies = [
1929 "bindgen",
1930 "pkg-config",
1931]
19321822
1933[[package]]1823[[package]]
1934name = "nom"1824name = "nom"
2225 "spki",2115 "spki",
2226]2116]
2227
2228[[package]]
2229name = "pkg-config"
2230version = "0.3.31"
2231source = "registry+https://github.com/rust-lang/crates.io-index"
2232checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
22332117
2234[[package]]2118[[package]]
2235name = "poly1305"2119name = "poly1305"
3754 "wasm-bindgen",3638 "wasm-bindgen",
3755]3639]
3756
3757[[package]]
3758name = "which"
3759version = "4.4.2"
3760source = "registry+https://github.com/rust-lang/crates.io-index"
3761checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7"
3762dependencies = [
3763 "either",
3764 "home",
3765 "once_cell",
3766 "rustix 0.38.40",
3767]
37683640
3769[[package]]3641[[package]]
3770name = "winapi"3642name = "winapi"
modifiedCargo.tomldiffbeforeafterboth
2members = ["crates/*", "cmds/*"]2members = ["crates/*", "cmds/*"]
3resolver = "2"3resolver = "2"
4package.version = "0.1.0"4package.version = "0.1.0"
5package.edition = "2021"5package.edition = "2024"
6package.rust-version = "1.82.0"6package.rust-version = "1.86.0"
77
8[workspace.dependencies]8[workspace.dependencies]
9better-command = { path = "./crates/better-command" }9better-command = { path = "./crates/better-command" }
modifiedcmds/fleet/src/cmds/build_systems.rsdiffbeforeafterboth
1use std::{env::current_dir, os::unix::fs::symlink, path::PathBuf};1use std::{env::current_dir, os::unix::fs::symlink, path::PathBuf};
22
3use anyhow::{anyhow, Result};3use anyhow::{Result, anyhow};
4use clap::Parser;4use clap::Parser;
5use fleet_base::{5use fleet_base::{
6 deploy::{deploy_task, upload_task, DeployAction},6 deploy::{DeployAction, deploy_task, upload_task},
7 host::{Config, DeployKind, GenerationStorage},7 host::{Config, DeployKind, GenerationStorage},
8 opts::FleetOpts,8 opts::FleetOpts,
9};9};
10use nix_eval::{nix_go, NixBuildBatch};10use nix_eval::{NixBuildBatch, nix_go};
11use tokio::task::LocalSet;11use tokio::task::LocalSet;
12use tracing::{error, field, info, info_span, warn, Instrument};12use tracing::{Instrument, error, field, info, info_span, warn};
1313
14#[derive(Parser)]14#[derive(Parser)]
15pub struct Deploy {15pub struct Deploy {
167 self.action,167 self.action,
168 &host,168 &host,
169 remote_path,169 remote_path,
170 if let Ok(v) = opts.action_attr(&host, "specialisation").await {170 match opts.action_attr(&host, "specialisation").await {
171 v171 Ok(v) => v,
172 } else {172 _ => {
173 error!("unreachable? failed to get specialization");173 error!("unreachable? failed to get specialization");
174 return;174 return;
175 },175 }
176 },
176 disable_rollback,177 disable_rollback,
177 )178 )
178 .await179 .await
modifiedcmds/fleet/src/cmds/info.rsdiffbeforeafterboth
1use std::collections::BTreeSet;1use std::collections::BTreeSet;
22
3use anyhow::{ensure, Result};3use anyhow::{Result, ensure};
4use clap::Parser;4use clap::Parser;
5use fleet_base::host::Config;5use fleet_base::host::Config;
6use nix_eval::nix_go_json;6use nix_eval::nix_go_json;
modifiedcmds/fleet/src/cmds/mod.rsdiffbeforeafterboth
1pub mod build_systems;1pub mod build_systems;
2pub mod complete;2pub mod complete;
3pub mod info;3pub mod info;
4pub mod secrets;4pub mod rollback;
5pub mod tf;5pub mod secrets;
6pub mod rollback;6pub mod tf;
7
modifiedcmds/fleet/src/cmds/rollback.rsdiffbeforeafterboth
1use std::collections::HashSet;1use std::collections::HashSet;
22
3use anyhow::{bail, Result};3use anyhow::{Result, bail};
4use clap::Parser;4use clap::Parser;
5use fleet_base::{5use fleet_base::{
6 deploy::{deploy_task, upload_task, DeployAction},6 deploy::{DeployAction, deploy_task, upload_task},
7 host::{Config, ConfigHost, Generation, GenerationStorage},7 host::{Config, ConfigHost, Generation, GenerationStorage},
8 opts::FleetOpts,8 opts::FleetOpts,
9};9};
modifiedcmds/fleet/src/cmds/secrets/mod.rsdiffbeforeafterboth
1use std::{1use std::{
2 collections::{BTreeMap, BTreeSet, HashSet},2 collections::{BTreeMap, BTreeSet, HashSet},
3 io::{self, stdin, stdout, Read, Write},3 io::{self, Read, Write, stdin, stdout},
4 path::PathBuf,4 path::PathBuf,
5};5};
66
7use age::Recipient;7use age::Recipient;
8use anyhow::{anyhow, bail, ensure, Context, Result};8use anyhow::{Context, Result, anyhow, bail, ensure};
9use chrono::{DateTime, Utc};9use chrono::{DateTime, Utc};
10use clap::Parser;10use clap::Parser;
11use fleet_base::{11use fleet_base::{
12 fleetdata::{encrypt_secret_data, FleetSecret, FleetSecretPart, FleetSharedSecret},12 fleetdata::{FleetSecret, FleetSecretPart, FleetSharedSecret, encrypt_secret_data},
13 host::Config,13 host::Config,
14 opts::FleetOpts,14 opts::FleetOpts,
15};15};
16use fleet_shared::SecretData;16use fleet_shared::SecretData;
17use nix_eval::{nix_go, nix_go_json, NixBuildBatch, Value};17use nix_eval::{NixBuildBatch, Value, nix_go, nix_go_json};
18use owo_colors::OwoColorize;18use owo_colors::OwoColorize;
19use serde::Deserialize;19use serde::Deserialize;
20use tabled::{Table, Tabled};20use tabled::{Table, Tabled};
21use tokio::fs::read;21use tokio::fs::read;
22use tracing::{error, info, info_span, warn, Instrument};22use tracing::{Instrument, error, info, info_span, warn};
2323
24#[derive(Parser)]24#[derive(Parser)]
25pub enum Secret {25pub enum Secret {
296 let out_parent = host.mktemp_dir().await?;298 let out_parent = host.mktemp_dir().await?;
297 let out = format!("{out_parent}/out");299 let out = format!("{out_parent}/out");
298300
299 let mut gen = host.cmd(generator).await?;301 let mut r#gen = host.cmd(generator).await?;
300 gen.env("out", &out);302 r#gen.env("out", &out);
301 if on.is_none() {303 if on.is_none() {
302 // This path is local, thus we can feed `OsString` directly to env var... But I don't think that's necessary to handle.304 // This path is local, thus we can feed `OsString` directly to env var... But I don't think that's necessary to handle.
303 let project_path: String = config305 let project_path: String = config
306 .into_os_string()308 .into_os_string()
307 .into_string()309 .into_string()
308 .map_err(|s| anyhow!("fleet project path is not utf-8: {s:?}"))?;310 .map_err(|s| anyhow!("fleet project path is not utf-8: {s:?}"))?;
309 gen.env("FLEET_PROJECT", project_path);311 r#gen.env("FLEET_PROJECT", project_path);
310 }312 }
311 gen.run().await.context("impure generator")?;313 r#gen.run().await.context("impure generator")?;
312314
313 {315 {
314 let marker = host.read_file_text(format!("{out}/marker")).await?;316 let marker = host.read_file_text(format!("{out}/marker")).await?;
modifiedcmds/fleet/src/extra_args.rsdiffbeforeafterboth
1use std::ffi::{OsStr, OsString};1use std::ffi::{OsStr, OsString};
22
3use anyhow::{anyhow, Result};3use anyhow::{Result, anyhow};
44
5pub fn parse_os(os: &OsStr) -> Result<Vec<OsString>> {5pub fn parse_os(os: &OsStr) -> Result<Vec<OsString>> {
6 Ok(shlex::bytes::split(os.as_encoded_bytes())6 Ok(shlex::bytes::split(os.as_encoded_bytes())
modifiedcmds/fleet/src/main.rsdiffbeforeafterboth
66
7use std::{ffi::OsString, process::ExitCode};7use std::{ffi::OsString, process::ExitCode};
88
9use anyhow::{bail, Result};9use anyhow::{Result, bail};
10use clap::{CommandFactory, Parser};10use clap::{CommandFactory, Parser};
11use cmds::{11use cmds::{
12 build_systems::{BuildSystems, Deploy},12 build_systems::{BuildSystems, Deploy},
13 rollback::RollbackSingle,
14 complete::Complete,13 complete::Complete,
15 info::Info,14 info::Info,
15 rollback::RollbackSingle,
16 secrets::Secret,16 secrets::Secret,
17 tf::Tf,17 tf::Tf,
18};18};
19use fleet_base::{host::Config, opts::FleetOpts};19use fleet_base::{host::Config, opts::FleetOpts};
20use futures::{future::LocalBoxFuture, stream::FuturesUnordered, TryStreamExt};20use futures::{TryStreamExt, future::LocalBoxFuture, stream::FuturesUnordered};
21// use host::Config;21// use host::Config;
22#[cfg(feature = "indicatif")]22#[cfg(feature = "indicatif")]
23use human_repr::HumanCount;23use human_repr::HumanCount;
24#[cfg(feature = "indicatif")]24#[cfg(feature = "indicatif")]
25use indicatif::{ProgressState, ProgressStyle};25use indicatif::{ProgressState, ProgressStyle};
26use tracing::{error, info, info_span, Instrument};26use tracing::{Instrument, error, info, info_span};
27#[cfg(feature = "indicatif")]27#[cfg(feature = "indicatif")]
28use tracing_indicatif::IndicatifLayer;28use tracing_indicatif::IndicatifLayer;
29use tracing_subscriber::{prelude::*, EnvFilter};29use tracing_subscriber::{EnvFilter, prelude::*};
3030
31#[derive(Parser)]31#[derive(Parser)]
32struct Prefetch {}32struct Prefetch {}
modifiedcmds/generator-helper/src/main.rsdiffbeforeafterboth
1use std::{1use std::{
2 env,2 env,
3 fs::{File, OpenOptions},3 fs::{File, OpenOptions},
4 io::{self, copy, stdin, stdout, Read, Write},4 io::{self, Read, Write, copy, stdin, stdout},
5 str::FromStr,5 str::FromStr,
6};6};
77
8use age::{8use age::{
9 Encryptor, Recipient,
9 ssh::{ParseRecipientKeyError, Recipient as SshRecipient},10 ssh::{ParseRecipientKeyError, Recipient as SshRecipient},
10 Encryptor, Recipient,
11};11};
12use anyhow::{anyhow, bail, ensure, Context, Result};12use anyhow::{Context, Result, anyhow, bail, ensure};
13use clap::{Parser, ValueEnum};13use clap::{Parser, ValueEnum};
14use ed25519_dalek::SecretKey;14use ed25519_dalek::SecretKey;
15use fleet_shared::SecretData;15use fleet_shared::SecretData;
16use rand::{16use rand::{
17 RngCore,
17 distr::{Alphanumeric, Distribution, SampleString, Uniform},18 distr::{Alphanumeric, Distribution, SampleString, Uniform},
18 rng, RngCore,19 rng,
19};20};
2021
21fn write_output_file(out: &str) -> Result<File> {22fn write_output_file(out: &str) -> Result<File> {
modifiedcmds/install-secrets/src/main.rsdiffbeforeafterboth
5 iter,5 iter,
6 os::unix::prelude::PermissionsExt,6 os::unix::prelude::PermissionsExt,
7 path::{Path, PathBuf},7 path::{Path, PathBuf},
8 str::{from_utf8, FromStr},8 str::{FromStr, from_utf8},
9};9};
1010
11use age::{11use age::{
12 Decryptor, Encryptor, Identity, Recipient,
12 ssh::{Identity as SshIdentity, Recipient as SshRecipient},13 ssh::{Identity as SshIdentity, Recipient as SshRecipient},
13 Decryptor, Encryptor, Identity, Recipient,
14};14};
15use anyhow::{anyhow, bail, ensure, Context, Result};15use anyhow::{Context, Result, anyhow, bail, ensure};
16use clap::Parser;16use clap::Parser;
17use fleet_shared::SecretData;17use fleet_shared::SecretData;
18use nix::unistd::{chown, Group, User};18use nix::unistd::{Group, User, chown};
19use serde::Deserialize;19use serde::Deserialize;
20use tracing::{error, info, info_span};20use tracing::{error, info, info_span};
21use tracing_subscriber::{filter::LevelFilter, EnvFilter};21use tracing_subscriber::{EnvFilter, filter::LevelFilter};
2222
23#[derive(Parser)]23#[derive(Parser)]
24#[clap(author)]24#[clap(author)]
modifiedcmds/terraform-provider-fleet/src/main.rsdiffbeforeafterboth

no syntactic changes

modifiedcrates/better-command/src/handler.rsdiffbeforeafterboth
77
8use regex::Regex;8use regex::Regex;
9use serde::Deserialize;9use serde::Deserialize;
10use tracing::{info, info_span, warn, Span};10use tracing::{Span, info, info_span, warn};
11#[cfg(feature = "indicatif")]11#[cfg(feature = "indicatif")]
12use tracing_indicatif::span_ext::IndicatifSpanExt as _;12use tracing_indicatif::span_ext::IndicatifSpanExt as _;
1313
164 LogField::String(drv),
165 LogField::String(from),
166 LogField::String(to),
167 ..,
160 &fields[..]168 ] = &fields[..]
161 {169 {
162 let mut drv = drv.as_str();170 let mut drv = drv.as_str();
301 LogField::Num(done),
302 LogField::Num(expected),
303 LogField::Num(_running),
304 LogField::Num(_failed),
293 &fields[..4]305 ] = &fields[..4]
294 {306 {
295 #[cfg(feature = "indicatif")]307 #[cfg(feature = "indicatif")]
modifiedcrates/fleet-base/src/command.rsdiffbeforeafterboth
1use std::{ffi::OsStr, pin, process::Stdio, sync::Arc, task::Poll};1use std::{ffi::OsStr, pin, process::Stdio, sync::Arc, task::Poll};
22
3use anyhow::{anyhow, Result};3use anyhow::{Result, anyhow};
4use better_command::{Handler, NixHandler, PlainHandler};4use better_command::{Handler, NixHandler, PlainHandler};
5use futures::StreamExt;5use futures::StreamExt;
6use itertools::Either;6use itertools::Either;
68 }68 }
69 }69 }
70 fn new_here(&self, cmd: impl AsRef<OsStr>) -> Self {70 fn new_here(&self, cmd: impl AsRef<OsStr>) -> Self {
71 if let Some(ssh_session) = self.ssh_session.clone() {71 match self.ssh_session.clone() {
72 Self::new_on(self.escalation, cmd, ssh_session)72 Some(ssh_session) => Self::new_on(self.escalation, cmd, ssh_session),
73 } else {
74 Self::new(self.escalation, cmd)73 _ => Self::new(self.escalation, cmd),
75 }74 }
76 }75 }
7776
78 fn into_args(self) -> Vec<String> {77 fn into_args(self) -> Vec<String> {
139 out138 out
140 }139 }
141 fn into_command(self) -> Result<Either<Command, openssh::OwningCommand<Arc<Session>>>> {140 fn into_command(self) -> Result<Either<Command, openssh::OwningCommand<Arc<Session>>>> {
142 Ok(if let Some(session) = self.ssh_session.clone() {141 Ok(match self.ssh_session.clone() {
142 Some(session) => {
143 let cmd = self.translate_env_into_env().into_command_unchecked_local();143 let cmd = self.translate_env_into_env().into_command_unchecked_local();
144 Either::Right(144 Either::Right(
145 cmd.over_ssh(session)145 cmd.over_ssh(session)
146 .map_err(|e| anyhow!("ssh error: {e}"))?,146 .map_err(|e| anyhow!("ssh error: {e}"))?,
147 )147 )
148 } else {148 }
149 _ => {
149 let cmd = self.into_command_unchecked_local();150 let cmd = self.into_command_unchecked_local();
150 Either::Left(cmd)151 Either::Left(cmd)
151 })152 }
153 })
152 }154 }
153 pub fn arg(&mut self, arg: impl AsRef<OsStr>) -> &mut Self {155 pub fn arg(&mut self, arg: impl AsRef<OsStr>) -> &mut Self {
154 let arg = arg.as_ref();156 let arg = arg.as_ref();
modifiedcrates/fleet-base/src/deploy.rsdiffbeforeafterboth
1use std::{path::PathBuf, time::Duration};1use std::{path::PathBuf, time::Duration};
22
3use anyhow::{anyhow, bail, Context as _, Result};3use anyhow::{Context as _, Result, anyhow, bail};
4use clap::ValueEnum;4use clap::ValueEnum;
5use itertools::Itertools;5use itertools::Itertools;
6use tokio::time::sleep;6use tokio::time::sleep;
7use tracing::{error, info, info_span, warn, Instrument as _};7use tracing::{Instrument as _, error, info, info_span, warn};
88
9use crate::host::{Config, ConfigHost, DeployKind, Generation, GenerationStorage};9use crate::host::{Config, ConfigHost, DeployKind, Generation, GenerationStorage};
1010
233 error!("failed to disarm rollback run: {e}");235 error!("failed to disarm rollback run: {e}");
234 }236 }
235 }237 }
236 } else if let Err(_e) = host238 } else {
239 match host
237 .rm_file("/etc/fleet_rollback_marker", true)240 .rm_file("/etc/fleet_rollback_marker", true)
238 .in_current_span()241 .in_current_span()
239 .await242 .await
243 {
240 {244 Err(_e) => {
241 // Marker might not exist, yet better try to remove it.245 // Marker might not exist, yet better try to remove it.
242 }246 }
247 _ => {}
248 }
249 }
243 }250 }
244 Ok(())251 Ok(())
245}252}
modifiedcrates/fleet-base/src/fleetdata.rsdiffbeforeafterboth
10 distr::{Alphanumeric, SampleString as _},10 distr::{Alphanumeric, SampleString as _},
11 rng,11 rng,
12};12};
13use serde::{de::Error, Deserialize, Serialize};13use serde::{Deserialize, Serialize, de::Error};
14use serde_json::Value;14use serde_json::Value;
1515
16#[derive(Serialize, Deserialize, Default)]16#[derive(Serialize, Deserialize, Default)]
modifiedcrates/fleet-base/src/host.rsdiffbeforeafterboth
10 sync::{Arc, Mutex, MutexGuard, OnceLock},10 sync::{Arc, Mutex, MutexGuard, OnceLock},
11};11};
1212
13use anyhow::{anyhow, bail, ensure, Context, Result};13use anyhow::{Context, Result, anyhow, bail, ensure};
14use fleet_shared::SecretData;14use fleet_shared::SecretData;
15use nix_eval::{nix_go, nix_go_json, util::assert_warn, NixSession, Value};15use nix_eval::{NixSession, Value, nix_go, nix_go_json, util::assert_warn};
16use openssh::SessionBuilder;16use openssh::SessionBuilder;
17use serde::de::DeserializeOwned;17use serde::de::DeserializeOwned;
18use tabled::Tabled;18use tabled::Tabled;
19use tempfile::NamedTempFile;19use tempfile::NamedTempFile;
20use time::{format_description, UtcDateTime};20use time::{UtcDateTime, format_description};
21use tracing::warn;21use tracing::warn;
2222
23use crate::{23use crate::{
189 .map(|e| e.trim())191 .map(|e| e.trim())
190 .filter(|&l| !l.is_empty())192 .filter(|&l| !l.is_empty())
191 .filter_map(|g| {193 .filter_map(|g| {
192 let gen = parse_generation_line(g);194 let generation = parse_generation_line(g);
193 if gen.is_none() {195 if generation.is_none() {
194 warn!("bad generation: {g}");196 warn!("bad generation: {g}");
195 };197 };
196 gen198 generation
197 })199 })
198 .collect::<Vec<_>>();200 .collect::<Vec<_>>();
199 for ele in generations.iter_mut() {201 for ele in generations.iter_mut() {
modifiedcrates/fleet-base/src/keys.rsdiffbeforeafterboth
1use std::str::FromStr as _;1use std::str::FromStr as _;
22
3use age::Recipient;3use age::Recipient;
4use anyhow::{anyhow, Result};4use anyhow::{Result, anyhow};
5use futures::{StreamExt as _, TryStreamExt as _};5use futures::{StreamExt as _, TryStreamExt as _};
6use itertools::Itertools as _;6use itertools::Itertools as _;
7use tracing::warn;7use tracing::warn;
39 }39 }
40 }40 }
41 /// Insecure, requires root41 /// Insecure, requires root
42 pub async fn recipient(&self, host: &str) -> anyhow::Result<impl Recipient> {42 pub async fn recipient(&self, host: &str) -> anyhow::Result<impl Recipient + use<>> {
43 let key = self.key(host).await?;43 let key = self.key(host).await?;
44 age::ssh::Recipient::from_str(&key).map_err(|e| anyhow!("parse recipient error: {:?}", e))44 age::ssh::Recipient::from_str(&key).map_err(|e| anyhow!("parse recipient error: {:?}", e))
45 }45 }
4646
47 pub async fn recipients(&self, hosts: Vec<String>) -> Result<Vec<impl Recipient>> {47 pub async fn recipients(&self, hosts: Vec<String>) -> Result<Vec<impl Recipient + use<>>> {
48 let hosts = self.expand_owner_set(hosts).await?;48 let hosts = self.expand_owner_set(hosts).await?;
49 futures::stream::iter(hosts.iter())49 futures::stream::iter(hosts.iter())
50 .then(|m| self.recipient(m.as_ref()))50 .then(|m| self.recipient(m.as_ref()))
modifiedcrates/fleet-base/src/lib.rsdiffbeforeafterboth
1pub mod command;1pub mod command;
2pub mod deploy;
2pub mod fleetdata;3pub mod fleetdata;
3pub mod host;4pub mod host;
4mod keys;5mod keys;
5pub mod opts;6pub mod opts;
6pub mod deploy;7
modifiedcrates/fleet-base/src/opts.rsdiffbeforeafterboth
6 sync::{Arc, Mutex},6 sync::{Arc, Mutex},
7};7};
88
9use anyhow::{bail, Context, Result};9use anyhow::{Context, Result, bail};
10use nix_eval::{nix_go, util::assert_warn, NixSessionPool, Value};10use nix_eval::{NixSessionPool, Value, nix_go, util::assert_warn};
11use nom::{11use nom::{
12 Parser,
12 bytes::complete::take_while1,13 bytes::complete::take_while1,
13 character::complete::char,14 character::complete::char,
14 combinator::{map, opt},15 combinator::{map, opt},
15 multi::separated_list1,16 multi::separated_list1,
16 sequence::{preceded, separated_pair},17 sequence::{preceded, separated_pair},
17 Parser,
18};18};
1919
20use crate::{20use crate::{
modifiedcrates/fleet-shared/src/encoding.rsdiffbeforeafterboth
3 str::FromStr,3 str::FromStr,
4};4};
55
6use base64::engine::{general_purpose::STANDARD_NO_PAD, Engine};6use base64::engine::{Engine, general_purpose::STANDARD_NO_PAD};
7use serde::{de::Error, Deserialize, Deserializer, Serialize};7use serde::{Deserialize, Deserializer, Serialize, de::Error};
8use unicode_categories::UnicodeCategories;8use unicode_categories::UnicodeCategories;
99
10#[derive(Debug, PartialEq, Clone)]10#[derive(Debug, PartialEq, Clone)]
modifiedcrates/nix-eval/src/pool.rsdiffbeforeafterboth
55
6use r2d2::Pool;6use r2d2::Pool;
77
8use crate::{session::NixSessionInner, Error, NixSession, Result};8use crate::{Error, NixSession, Result, session::NixSessionInner};
99
10pub struct NixSessionPool(Pool<NixSessionPoolInner>);10pub struct NixSessionPool(Pool<NixSessionPoolInner>);
11impl NixSessionPool {11impl NixSessionPool {
modifiedcrates/nix-eval/src/session.rsdiffbeforeafterboth
3use better_command::{ClonableHandler, Handler, NixHandler, NoopHandler};3use better_command::{ClonableHandler, Handler, NixHandler, NoopHandler};
4use futures::StreamExt;4use futures::StreamExt;
5use itertools::Itertools as _;5use itertools::Itertools as _;
6use serde::{de::DeserializeOwned, Deserialize};6use serde::{Deserialize, de::DeserializeOwned};
7use thiserror::Error;7use thiserror::Error;
8use tokio::{8use tokio::{
9 io::AsyncWriteExt,9 io::AsyncWriteExt,
10 process::{ChildStderr, ChildStdin, ChildStdout, Command},10 process::{ChildStderr, ChildStdin, ChildStdout, Command},
11 select,11 select,
12 sync::{mpsc, oneshot, Mutex},12 sync::{Mutex, mpsc, oneshot},
13};13};
14use tokio_util::codec::{FramedRead, LinesCodec};14use tokio_util::codec::{FramedRead, LinesCodec};
15use tracing::{debug, error, warn, Level};15use tracing::{Level, debug, error, warn};
1616
17#[derive(Error, Debug, Clone)]17#[derive(Error, Debug, Clone)]
18pub enum Error {18pub enum Error {
modifiedcrates/nix-eval/src/util.rsdiffbeforeafterboth
3use anyhow::bail;3use anyhow::bail;
4use tracing::{debug, warn};4use tracing::{debug, warn};
55
6use crate::{nix_go_json, Value};6use crate::{Value, nix_go_json};
77
8#[tracing::instrument(level = "info", skip(val))]8#[tracing::instrument(level = "info", skip(val))]
9pub async fn assert_warn(action: &str, val: &Value) -> anyhow::Result<()> {9pub async fn assert_warn(action: &str, val: &Value) -> anyhow::Result<()> {
modifiedcrates/nix-eval/src/value.rsdiffbeforeafterboth
1use std::{collections::HashMap, fmt, path::PathBuf, sync::Arc};1use std::{collections::HashMap, fmt, path::PathBuf, sync::Arc};
22
3use better_command::NixHandler;3use better_command::NixHandler;
4use serde::{de::DeserializeOwned, Serialize};4use serde::{Serialize, de::DeserializeOwned};
55
6use crate::{macros::NixExprBuilder, nix_go, Error, NixBuildBatch, NixSession, Result};6use crate::{Error, NixBuildBatch, NixSession, Result, macros::NixExprBuilder, nix_go};
77
8#[derive(Clone)]8#[derive(Clone)]
9pub enum Index {9pub enum Index {
deletedcrates/nix-native-eval/Cargo.tomldiffbeforeafterboth

no changes

deletedcrates/nix-native-eval/src/lib.rsdiffbeforeafterboth

no changes

modifiedcrates/nixlike/fuzz/Cargo.tomldiffbeforeafterboth
4version = "0.0.0"4version = "0.0.0"
5authors = ["Automatically generated"]5authors = ["Automatically generated"]
6publish = false6publish = false
7edition = "2021"7edition = "2024"
88
9[package.metadata]9[package.metadata]
10cargo-fuzz = true10cargo-fuzz = true
modifiedcrates/nixlike/src/de_impl.rsdiffbeforeafterboth
22
3use linked_hash_map::LinkedHashMap;3use linked_hash_map::LinkedHashMap;
4use serde::{4use serde::{
5 Deserializer,
5 de::{self, MapAccess, SeqAccess},6 de::{self, MapAccess, SeqAccess},
6 Deserializer,
7};7};
88
9use crate::{Error, Value};9use crate::{Error, Value};
28 where28 where
29 K: de::DeserializeSeed<'de>,29 K: de::DeserializeSeed<'de>,
30 {30 {
31 if let Some((k, v)) = self.iter.next() {31 match self.iter.next() {
32 Some((k, v)) => {
32 let _ = self.value.insert(v);33 let _ = self.value.insert(v);
33 Ok(Some(seed.deserialize(Value::String(k))?))34 Ok(Some(seed.deserialize(Value::String(k))?))
34 } else {35 }
35 Ok(None)36 _ => Ok(None),
36 }37 }
37 }38 }
3839
39 fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>40 fn next_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Self::Error>
62 where63 where
63 T: de::DeserializeSeed<'de>,64 T: de::DeserializeSeed<'de>,
64 {65 {
65 if let Some(v) = self.iter.next() {66 match self.iter.next() {
66 Ok(Some(seed.deserialize(v)?))67 Some(v) => Ok(Some(seed.deserialize(v)?)),
67 } else {
68 Ok(None)68 _ => Ok(None),
69 }69 }
70 }70 }
71}71}
7272
modifiedcrates/nixlike/src/se_impl.rsdiffbeforeafterboth
22
3use linked_hash_map::LinkedHashMap;3use linked_hash_map::LinkedHashMap;
4use serde::{4use serde::{
5 Serializer,
5 ser::{6 ser::{
6 self, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,7 self, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, SerializeTuple,
7 SerializeTupleStruct, SerializeTupleVariant,8 SerializeTupleStruct, SerializeTupleVariant,
8 },9 },
9 Serializer,
10};10};
1111
12use crate::{Error, Value};12use crate::{Error, Value};
9090
91 fn end(self) -> Result<Self::Ok, Self::Error> {91 fn end(self) -> Result<Self::Ok, Self::Error> {
92 Ok(Value::Object(92 Ok(Value::Object(
93 vec![(self.0, Value::Array(self.1 .0))]93 vec![(self.0, Value::Array(self.1.0))].into_iter().collect(),
94 .into_iter()
95 .collect(),
96 ))94 ))
modifiedflake.lockdiffbeforeafterboth
2 "nodes": {2 "nodes": {
3 "crane": {3 "crane": {
4 "locked": {4 "locked": {
5 "lastModified": 1739936662,5 "lastModified": 1750266157,
6 "narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=",6 "narHash": "sha256-tL42YoNg9y30u7zAqtoGDNdTyXTi8EALDeCB13FtbQA=",
7 "owner": "ipetkov",7 "owner": "ipetkov",
8 "repo": "crane",8 "repo": "crane",
9 "rev": "19de14aaeb869287647d9461cbd389187d8ecdb7",9 "rev": "e37c943371b73ed87faf33f7583860f81f1d5a48",
10 "type": "github"10 "type": "github"
11 },11 },
12 "original": {12 "original": {
22 ]22 ]
23 },23 },
24 "locked": {24 "locked": {
25 "lastModified": 1738453229,25 "lastModified": 1749398372,
26 "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",26 "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=",
27 "owner": "hercules-ci",27 "owner": "hercules-ci",
28 "repo": "flake-parts",28 "repo": "flake-parts",
29 "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",29 "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569",
30 "type": "github"30 "type": "github"
31 },31 },
32 "original": {32 "original": {
37 },37 },
38 "nixpkgs": {38 "nixpkgs": {
39 "locked": {39 "locked": {
40 "lastModified": 1740339700,40 "lastModified": 1750895632,
41 "narHash": "sha256-cbrw7EgQhcdFnu6iS3vane53bEagZQy/xyIkDWpCgVE=",41 "narHash": "sha256-EPZWiRmaSTxoBArK5dQyRlSNVLXiBt2hmsYIPgMf3zk=",
42 "owner": "nixos",42 "owner": "nixos",
43 "repo": "nixpkgs",43 "repo": "nixpkgs",
44 "rev": "04ef94c4c1582fd485bbfdb8c4a8ba250e359195",44 "rev": "6ac57ce7fee0d80226095a57ccb7519855ad7c5e",
45 "type": "github"45 "type": "github"
46 },46 },
47 "original": {47 "original": {
48 "owner": "nixos",48 "owner": "nixos",
49 "ref": "release-24.11",49 "ref": "release-25.05",
50 "repo": "nixpkgs",50 "repo": "nixpkgs",
51 "type": "github"51 "type": "github"
52 }52 }
68 ]68 ]
69 },69 },
70 "locked": {70 "locked": {
71 "lastModified": 1740277845,71 "lastModified": 1750819193,
72 "narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=",72 "narHash": "sha256-XvkupGPZqD54HuKhN/2WhbKjAHeTl1UEnWspzUzRFfA=",
73 "owner": "oxalica",73 "owner": "oxalica",
74 "repo": "rust-overlay",74 "repo": "rust-overlay",
75 "rev": "f933070c29f9c1c5457447a51903f27f76ebb519",75 "rev": "1ba3b9c59b68a4b00156827ad46393127b51b808",
76 "type": "github"76 "type": "github"
77 },77 },
78 "original": {78 "original": {
103 ]103 ]
104 },104 },
105 "locked": {105 "locked": {
106 "lastModified": 1744961264,106 "lastModified": 1749194973,
107 "narHash": "sha256-aRmUh0AMwcbdjJHnytg1e5h5ECcaWtIFQa6d9gI85AI=",107 "narHash": "sha256-eEy8cuS0mZ2j/r/FE0/LYBSBcIs/MKOIVakwHVuqTfk=",
108 "owner": "numtide",108 "owner": "numtide",
109 "repo": "treefmt-nix",109 "repo": "treefmt-nix",
110 "rev": "8d404a69efe76146368885110f29a2ca3700bee6",110 "rev": "a05be418a1af1198ca0f63facb13c985db4cb3c5",
111 "type": "github"111 "type": "github"
112 },112 },
113 "original": {113 "original": {
modifiedflake.nixdiffbeforeafterboth
2 description = "NixOS cluster configuration management";2 description = "NixOS cluster configuration management";
33
4 inputs = {4 inputs = {
5 nixpkgs.url = "github:nixos/nixpkgs/release-24.11";5 nixpkgs.url = "github:nixos/nixpkgs/release-25.05";
6 rust-overlay = {6 rust-overlay = {
7 url = "github:oxalica/rust-overlay";7 url = "github:oxalica/rust-overlay";
8 inputs.nixpkgs.follows = "nixpkgs";8 inputs.nixpkgs.follows = "nixpkgs";
156 bacon156 bacon
157 nil157 nil
158 rustPlatform.bindgenHook158 rustPlatform.bindgenHook
159 nixVersions.nix_2_22159 # nixVersions.nix_2_22
160 ];160 ];
161 environment.PROTOC = "${pkgs.protobuf}/bin/protoc";161 environment.PROTOC = "${pkgs.protobuf}/bin/protoc";
162 };162 };
modifiedrust-toolchain.tomldiffbeforeafterboth
1[toolchain]1[toolchain]
2channel = "1.85.0"2channel = "1.86.0"
3components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]3components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]
44
modifiedrustfmt.tomldiffbeforeafterboth
1hard_tabs = true1hard_tabs = true
2imports_granularity = "Crate"2# imports_granularity = "Crate"
3group_imports = "StdExternalCrate"3# group_imports = "StdExternalCrate"
44