Skip to content

chore: Switch to stable rust #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 28, 2025
Merged
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
10 changes: 5 additions & 5 deletions crates/omnix-ci/src/command/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ pub async fn ci_run(
for (subflake_name, subflake) in &config.0 {
let name = subflake_name.italic();

if let Some(s) = only_subflake
&& s != subflake_name
{
tracing::info!("\n🍊 {} {}", name, "skipped (deselected out)".dimmed());
continue;
if let Some(s) = only_subflake {
if s != subflake_name {
tracing::info!("\n🍊 {} {}", name, "skipped (deselected out)".dimmed());
continue;
}
}

let compatible_system = subflake.can_run_on(&systems);
Expand Down
9 changes: 5 additions & 4 deletions crates/omnix-ci/src/command/run_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,11 @@ async fn run_ssh(host: &str, args: &[String]) -> anyhow::Result<()> {

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

cmd.status()
.await?
.exit_ok()
.map_err(|e| anyhow::anyhow!("SSH command failed: {}", e))
let status = cmd.status().await?;
if !status.success() {
return Err(anyhow::anyhow!("SSH command failed: {}", status));
}
Ok(())
}

/// Run SSH command with given arguments and return the stdout.
Expand Down
2 changes: 0 additions & 2 deletions crates/omnix-ci/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! omnix-ci: CI for Nix projects
#![warn(missing_docs)]
#![feature(exit_status_error)]
#![feature(let_chains)]
pub mod command;
pub mod config;
pub mod flake_ref;
Expand Down
1 change: 0 additions & 1 deletion crates/omnix-develop/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(let_chains)]
pub mod config;
pub mod core;
pub mod readme;
3 changes: 1 addition & 2 deletions crates/omnix-health/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ pub async fn run_all_checks_with(

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

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

tracing::info!("{}", md(&table).await?);
tracing::info!("{}", render_markdown(&pwd, &table).await?);
Ok(())
}

Expand Down
26 changes: 16 additions & 10 deletions crates/omnix-health/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,31 @@ impl Check {
/// Log the results using tracing crate
pub async fn tracing_log(&self) -> anyhow::Result<()> {
let pwd = std::env::current_dir()?;
let md = async |s: &str| omnix_common::markdown::render_markdown(&pwd, s).await;
use omnix_common::markdown::render_markdown;
match &self.result {
CheckResult::Green => {
tracing::info!("✅ {}", self.title.green().bold());
tracing::info!("{}", md(&self.info).await?.dimmed());
tracing::info!("{}", render_markdown(&pwd, &self.info).await?.dimmed());
}
CheckResult::Red { msg, suggestion } => {
let solution = md(&format!(
"**Problem**: {}\\\n**Fix**: {}\n",
msg, suggestion
))
let solution = render_markdown(
&pwd,
&format!("**Problem**: {}\\\n**Fix**: {}\n", msg, suggestion),
)
.await?;
if self.required {
tracing::error!("❌ {}", md(&self.title).await?.red().bold());
tracing::error!("{}", md(&self.info).await?.dimmed());
tracing::error!(
"❌ {}",
render_markdown(&pwd, &self.title).await?.red().bold()
);
tracing::error!("{}", render_markdown(&pwd, &self.info).await?.dimmed());
tracing::error!("{}", solution);
} else {
tracing::warn!("🟧 {}", md(&self.title).await?.yellow().bold());
tracing::warn!("{}", md(&self.info).await?.dimmed());
tracing::warn!(
"🟧 {}",
render_markdown(&pwd, &self.title).await?.yellow().bold()
);
tracing::warn!("{}", render_markdown(&pwd, &self.info).await?.dimmed());
tracing::warn!("{}", solution);
}
}
Expand Down
6 changes: 6 additions & 0 deletions doc/src/history.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release history

## Unreleased

### Chores

- Allow building on stable version of Rust (#427)

## 1.0.0 (2025-02-17) {#1.0.0}

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly"
channel = "stable"
targets = ["x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl"]