diff --git a/apps/desktop/src-tauri/build.rs b/apps/desktop/src-tauri/build.rs index c0380b8..5902e68 100644 --- a/apps/desktop/src-tauri/build.rs +++ b/apps/desktop/src-tauri/build.rs @@ -29,7 +29,7 @@ fn main() { ); } if std::env::var("PROFILE").as_deref() == Ok("release") - && matches!(target.as_str(), "windows" | "linux") + && matches!(target.as_str(), "windows" | "linux" | "macos") { let root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../.."); let status = std::process::Command::new(if cfg!(windows) { "python" } else { "python3" }) diff --git a/docs/EXTRACTION-ISOLATION.md b/docs/EXTRACTION-ISOLATION.md index dba3dd0..aab13a7 100644 --- a/docs/EXTRACTION-ISOLATION.md +++ b/docs/EXTRACTION-ISOLATION.md @@ -215,3 +215,16 @@ Windows throughput, cold filesystem caches or steady-state search latency. No persistent parser/cache optimization is justified by this small observation. Raw ignored report: `.searchi/qa/document-throughput-013.json`, SHA-256 `b86df0bf2ca0953317033b35b4642e6e0fadb93e50c499a7a28b1ae82512acd1`. + +## macOS staging preparation + +The helper staging tool now detects Darwin as macOS, recognizes native thin +64-bit little-endian Mach-O executables for Intel/Apple Silicon, and preserves +executable mode. Desktop release verification now covers macOS too. Header +layout and constants follow Apple's [loader header](https://github.com/apple-oss-distributions/xnu/blob/main/EXTERNAL_HEADERS/mach-o/loader.h) +and [CPU definitions](https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/mach/machine.h). +Six staging tests passed normally and under optimized Python, including mocked +Darwin defaults and synthetic header rejection. The actual staged Windows +helper still verifies. This is preparation only: native macOS build, loader +closure, resource-limit behavior, signing and application execution remain open. +Universal/fat extraction-helper binaries are not supported by this staging tool. diff --git a/tools/stage_extraction_worker.py b/tools/stage_extraction_worker.py index e817d0f..6a014dc 100644 --- a/tools/stage_extraction_worker.py +++ b/tools/stage_extraction_worker.py @@ -53,10 +53,17 @@ def identity(path): machine = struct.unpack_from('= 32 and header[:4] == b'\xcf\xfa\xed\xfe': + # Apple's mach_header_64: thin little-endian native executable. + cpu, _, filetype, commands, command_bytes = struct.unpack_from('