From bdffb44bb733dab404444066311f720399e74a50 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 13 Mar 2026 13:04:29 +0000 Subject: [PATCH] Skipping compilation of front-end for musl build --- server/build.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/build.rs b/server/build.rs index 50f5e24..d0f2db8 100644 --- a/server/build.rs +++ b/server/build.rs @@ -29,6 +29,19 @@ fn main() { return; } + // When cross-compiling (e.g. musl via `cross`), the Docker container + // has no Node/pnpm. The release script builds macOS first, so + // frontend/dist/ already exists. Skip the frontend build in that case. + let target = env::var("TARGET").unwrap_or_default(); + let host = env::var("HOST").unwrap_or_default(); + if target != host { + let dist = Path::new("../frontend/dist"); + if !dist.exists() { + panic!("Cross-compiling but frontend/dist/ is missing. Build macOS first."); + } + return; + } + let frontend_dir = Path::new("../frontend"); // Ensure dependencies are installed and build the frontend bundle.