Skip to content

Commit 5c02002

Browse files
authored
chore: Switch to stable rust (#427)
required for NixOS/nixpkgs#385761 We won’t have to revert async closure if we wait for NixOS/nixpkgs#383902 to land in `nixos-unstable` (see https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html#async-closures)
1 parent e768c5e commit 5c02002

File tree

8 files changed

+34
-25
lines changed

8 files changed

+34
-25
lines changed

crates/omnix-ci/src/command/run.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ pub async fn ci_run(
259259
for (subflake_name, subflake) in &config.0 {
260260
let name = subflake_name.italic();
261261

262-
if let Some(s) = only_subflake
263-
&& s != subflake_name
264-
{
265-
tracing::info!("\n🍊 {} {}", name, "skipped (deselected out)".dimmed());
266-
continue;
262+
if let Some(s) = only_subflake {
263+
if s != subflake_name {
264+
tracing::info!("\n🍊 {} {}", name, "skipped (deselected out)".dimmed());
265+
continue;
266+
}
267267
}
268268

269269
let compatible_system = subflake.can_run_on(&systems);

crates/omnix-ci/src/command/run_remote.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ async fn run_ssh(host: &str, args: &[String]) -> anyhow::Result<()> {
213213

214214
nix_rs::command::trace_cmd_with("🐌", &cmd);
215215

216-
cmd.status()
217-
.await?
218-
.exit_ok()
219-
.map_err(|e| anyhow::anyhow!("SSH command failed: {}", e))
216+
let status = cmd.status().await?;
217+
if !status.success() {
218+
return Err(anyhow::anyhow!("SSH command failed: {}", status));
219+
}
220+
Ok(())
220221
}
221222

222223
/// Run SSH command with given arguments and return the stdout.

crates/omnix-ci/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! omnix-ci: CI for Nix projects
22
#![warn(missing_docs)]
3-
#![feature(exit_status_error)]
4-
#![feature(let_chains)]
53
pub mod command;
64
pub mod config;
75
pub mod flake_ref;

crates/omnix-develop/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(let_chains)]
21
pub mod config;
32
pub mod core;
43
pub mod readme;

crates/omnix-health/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ pub async fn run_all_checks_with(
150150

151151
async fn print_info_banner(flake_url: Option<&FlakeUrl>, nix_info: &NixInfo) -> anyhow::Result<()> {
152152
let pwd = std::env::current_dir()?;
153-
let md = async |s: &str| render_markdown(&pwd, s).await;
154153

155154
let mut table = String::from("| Property | Value |\n|----------|-------|\n");
156155
table.push_str(&format!(
@@ -177,7 +176,7 @@ async fn print_info_banner(flake_url: Option<&FlakeUrl>, nix_info: &NixInfo) ->
177176
nix_info.nix_env.total_disk_space
178177
));
179178

180-
tracing::info!("{}", md(&table).await?);
179+
tracing::info!("{}", render_markdown(&pwd, &table).await?);
181180
Ok(())
182181
}
183182

crates/omnix-health/src/traits.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,31 @@ impl Check {
4343
/// Log the results using tracing crate
4444
pub async fn tracing_log(&self) -> anyhow::Result<()> {
4545
let pwd = std::env::current_dir()?;
46-
let md = async |s: &str| omnix_common::markdown::render_markdown(&pwd, s).await;
46+
use omnix_common::markdown::render_markdown;
4747
match &self.result {
4848
CheckResult::Green => {
4949
tracing::info!("✅ {}", self.title.green().bold());
50-
tracing::info!("{}", md(&self.info).await?.dimmed());
50+
tracing::info!("{}", render_markdown(&pwd, &self.info).await?.dimmed());
5151
}
5252
CheckResult::Red { msg, suggestion } => {
53-
let solution = md(&format!(
54-
"**Problem**: {}\\\n**Fix**: {}\n",
55-
msg, suggestion
56-
))
53+
let solution = render_markdown(
54+
&pwd,
55+
&format!("**Problem**: {}\\\n**Fix**: {}\n", msg, suggestion),
56+
)
5757
.await?;
5858
if self.required {
59-
tracing::error!("❌ {}", md(&self.title).await?.red().bold());
60-
tracing::error!("{}", md(&self.info).await?.dimmed());
59+
tracing::error!(
60+
"❌ {}",
61+
render_markdown(&pwd, &self.title).await?.red().bold()
62+
);
63+
tracing::error!("{}", render_markdown(&pwd, &self.info).await?.dimmed());
6164
tracing::error!("{}", solution);
6265
} else {
63-
tracing::warn!("🟧 {}", md(&self.title).await?.yellow().bold());
64-
tracing::warn!("{}", md(&self.info).await?.dimmed());
66+
tracing::warn!(
67+
"🟧 {}",
68+
render_markdown(&pwd, &self.title).await?.yellow().bold()
69+
);
70+
tracing::warn!("{}", render_markdown(&pwd, &self.info).await?.dimmed());
6571
tracing::warn!("{}", solution);
6672
}
6773
}

doc/src/history.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release history
22

3+
## Unreleased
4+
5+
### Chores
6+
7+
- Allow building on stable version of Rust (#427)
8+
39
## 1.0.0 (2025-02-17) {#1.0.0}
410

511
### Enhancements

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly"
2+
channel = "stable"
33
targets = ["x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl"]

0 commit comments

Comments
 (0)