From 78abe800ed85dea18d7ad2948e274301cf407d6d Mon Sep 17 00:00:00 2001 From: Damocles Date: Mon, 4 May 2026 00:27:34 +0200 Subject: [PATCH] plugin: log build.rs bridge-file presence; use manifest dir for robust path --- plugin/build.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugin/build.rs b/plugin/build.rs index b2f36ce..0f10623 100644 --- a/plugin/build.rs +++ b/plugin/build.rs @@ -26,8 +26,17 @@ fn main() { // Crane's deps-only build stubs out lib.rs and removes our bridge sources to // build a dummy crate that only compiles dependencies. Skip cxx-qt codegen in // that case - we just want cxx-qt-lib (the heavy dep) cached, not our own glue. + // Use CARGO_MANIFEST_DIR for a robust path that doesn't depend on cargo's CWD. + let manifest = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); let bridge_files = ["src/system_stats.rs", "src/cpu_service.rs"]; - if !bridge_files.iter().all(|p| std::path::Path::new(p).exists()) { + let present: Vec = bridge_files + .iter() + .map(|p| manifest.join(p).exists()) + .collect(); + println!("cargo:warning=build.rs manifest_dir={}", manifest.display()); + println!("cargo:warning=build.rs bridge_files present: {present:?}"); + if !present.iter().all(|b| *b) { + println!("cargo:warning=build.rs bailing: bridge files missing (deps-only build?)"); return; }