Files
openchamber/.github
kalac2232 77467311f1 fix(ci): ensure sidecar architecture matches target in macOS releases (#637)
* fix(ci): pass target architecture to beforeBuildCommand

Set TAURI_ENV_TARGET_TRIPLE environment variable before running
build commands to ensure sidecar binary matches target architecture.

Problem:
- CI builds both arm64 and x86_64 targets in parallel on arm64 runner
- beforeBuildCommand executes before Tauri sets TAURI_ENV_TARGET_TRIPLE
- build-sidecar.mjs fallbacks to process.arch (arm64 on CI runner)
- Both parallel tasks build arm64 sidecars, second task overwrites first
- Result: x86_64 releases contain arm64 sidecar → startup failure on Intel Macs

Solution:
- Explicitly set TAURI_ENV_TARGET_TRIPLE in CI workflow
- Add architecture verification step to detect mismatches early

Evidence:
- Official DMG OpenChamber_1.8.5_darwin-x86_64.dmg contains arm64 sidecar
- Local build with explicit env var produces correct x86_64 sidecar
- /Applications/OpenChamber.app/Contents/MacOS/openchamber-server: arm64
- packages/desktop/src-tauri/sidecars/...: x86_64 (with env var)

Fixes startup failure on Intel Macs where official x86_64 DMG
contains arm64 sidecar binary, causing indefinite loading screen.

* fix(ci): normalize architecture names in verification step

Fix architecture mismatch where macOS 'file' command reports ARM binaries
as 'arm64' but verification expects 'aarch64', causing false negatives
in ARM builds.

Changes:
- Update grep pattern to include 'arm64' in extraction
- Add normalize_arch() function to map arm64 -> aarch64
- Improve debug output to show raw and normalized architectures
- Update error messages to show both raw and normalized values

This fixes the issue reported by @btriapitsyn where ARM builds would
fail verification even with correct artifacts, because:
- macOS file command reports: 'Mach-O 64-bit executable arm64'
- Old grep pattern only matched: 'x86_64|aarch64'
- Result: empty string != 'aarch64' → false failure

The normalization ensures consistency between:
- macOS file output (arm64/x86_64)
- Rust/Cargo naming (aarch64/x86_64)
- Tauri target triples (aarch64-apple-darwin/x86_64-apple-darwin)

Fixes architecture verification for both ARM and Intel builds.
2026-03-12 17:56:45 +02:00
..
2026-02-12 17:50:56 +02:00