From 45f8b8ffb07d7f34e3555552c95ed4c18ce5ac95 Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Sun, 16 Nov 2025 14:43:40 +0100 Subject: [PATCH] Chore: attempt another CI fix --- rog-aura/src/aura_detection.rs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/rog-aura/src/aura_detection.rs b/rog-aura/src/aura_detection.rs index 05935818..2839bf0d 100644 --- a/rog-aura/src/aura_detection.rs +++ b/rog-aura/src/aura_detection.rs @@ -168,20 +168,18 @@ impl LedSupportFile { // development environments), attempt to load the bundled // `data/aura_support.ron` from the crate so tests and local runs // behave the same as when the package is installed. - if let Ok(path) = std::env::var("CARGO_MANIFEST_DIR") { - let mut pb = std::path::PathBuf::from(path); - pb.push("data/aura_support.ron"); - if let Ok(buf) = std::fs::read_to_string(&pb) { - if !buf.is_empty() { - if let Ok(tmp) = ron::from_str::(&buf) { - data.0.append(&mut tmp.0.clone()); - data.0.sort_by(|a, b| a.device_name.cmp(&b.device_name)); - info!("Loaded bundled LED support data from {}", pb.display()); - return Some(data); - } else { - warn!("Could not parse bundled data file: {}", pb.display()); - } - } + // Attempt to load a bundled `aura_support.ron` included at compile time. + // Using `include_str!` ensures the data is available regardless of + // runtime `CARGO_MANIFEST_DIR` or CI environment differences. + let bundled_buf = include_str!("../data/aura_support.ron"); + if !bundled_buf.is_empty() { + if let Ok(tmp) = ron::from_str::(bundled_buf) { + data.0.append(&mut tmp.0.clone()); + data.0.sort_by(|a, b| a.device_name.cmp(&b.device_name)); + info!("Loaded bundled LED support data (embedded)"); + return Some(data); + } else { + warn!("Could not parse embedded bundled data file"); } }