Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(desktop): build macOS releases with Xcode 26.6 (#3107)

Max3dba769f176c
diff --git a/.github/workflows/desktop-package.yml b/.github/workflows/desktop-package.yml
index fe284137e..115950da8 100644
--- a/.github/workflows/desktop-package.yml
+++ b/.github/workflows/desktop-package.yml
@@ -60,20 +60,30 @@ jobs:
# Never a release: a release build always carries its tag.
DESKTOP_CACHE_WARMUP: ${{ !inputs.release_tag && (github.event_name == 'push' || github.event_name == 'schedule') }}
DESKTOP_VERSION: ${{ inputs.version || '0.0.0' }}
+ DEVELOPER_DIR: ${{ matrix.developer_dir }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
- os: macos-15
+ os: macos-26
+ developer_dir: /Applications/Xcode_26.6.app/Contents/Developer
+ cache_scope: default-target-
+ cache_separator: "-"
bundle: app
artifact_glob: desktop/target/release/bundle/dmg/*.dmg
- target: x86_64-apple-darwin
- os: macos-15-intel
+ os: macos-26-intel
+ developer_dir: /Applications/Xcode_26.6.app/Contents/Developer
+ cache_scope: default-target-
+ cache_separator: "-"
bundle: app
artifact_glob: desktop/target/release/bundle/dmg/*.dmg
- target: x86_64-pc-windows-msvc
os: windows-latest
+ developer_dir: ""
+ cache_scope: ""
+ cache_separator: ""
bundle: nsis
artifact_glob: desktop/target/release/bundle/nsis/*setup.exe
steps:
@@ -82,6 +92,23 @@ jobs:
fetch-depth: 0
ref: ${{ inputs.source_sha || github.sha }}
+ - name: Report pinned Apple toolchain
+ if: runner.os == 'macOS'
+ shell: bash
+ run: |
+ set -euo pipefail
+ [ -d "$DEVELOPER_DIR" ] || {
+ echo "Pinned Xcode is missing: $DEVELOPER_DIR" >&2
+ exit 1
+ }
+ xcodebuild -version
+ [ "$(xcodebuild -version | sed -n '1p')" = "Xcode 26.6" ] || {
+ echo "Expected Xcode 26.6 from $DEVELOPER_DIR" >&2
+ exit 1
+ }
+ xcrun --sdk macosx --show-sdk-version
+ echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> "$GITHUB_ENV"
+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22.23.4"
@@ -125,8 +152,8 @@ jobs:
desktop/target/release/build
desktop/target/release/deps
desktop/target/cua-driver-patched
- key: ${{ runner.os }}-${{ matrix.target }}-desktop-package-${{ steps.toolchain.outputs.rustc }}-${{ hashFiles('desktop/Cargo.lock', 'desktop/cua-driver/sources.json') }}
- restore-keys: ${{ env.DESKTOP_CACHE_WARMUP != 'true' && format('{0}-{1}-desktop-package-{2}-', runner.os, matrix.target, steps.toolchain.outputs.rustc) || '' }}
+ key: ${{ runner.os }}-${{ matrix.target }}-desktop-package-${{ steps.toolchain.outputs.rustc }}-${{ matrix.cache_scope }}${{ steps.toolchain.outputs.apple }}${{ matrix.cache_separator }}${{ hashFiles('desktop/Cargo.lock', 'desktop/cua-driver/sources.json') }}
+ restore-keys: ${{ env.DESKTOP_CACHE_WARMUP != 'true' && format('{0}-{1}-desktop-package-{2}-{3}{4}{5}', runner.os, matrix.target, steps.toolchain.outputs.rustc, matrix.cache_scope, steps.toolchain.outputs.apple, matrix.cache_separator) || '' }}
- name: Build Workbench
working-directory: ui
@@ -209,7 +236,7 @@ jobs:
path: |
desktop/src-tauri/binaries/cua-driver-${{ matrix.target }}
desktop/src-tauri/binaries/cua-driver-${{ matrix.target }}.provenance.json
- key: cua-driver-${{ matrix.target }}-${{ steps.toolchain.outputs.apple }}-${{ hashFiles('desktop/cua-driver/**', 'desktop/scripts/prepare-cua-driver.py') }}
+ key: cua-driver-${{ matrix.target }}-${{ steps.toolchain.outputs.apple }}-default-target-${{ hashFiles('desktop/cua-driver/**', 'desktop/scripts/prepare-cua-driver.py') }}
- name: Prepare pinned Cua Driver sidecar
if: runner.os == 'macOS'
@@ -247,6 +274,20 @@ jobs:
--features bundled-runtime
--config tauri.release.conf.json
+ - name: Verify macOS SDK and deployment target ceiling
+ if: runner.os == 'macOS'
+ working-directory: desktop
+ shell: bash
+ run: |
+ set -euo pipefail
+ app="target/release/bundle/macos/Avibe.app"
+ executable="$(plutil -extract CFBundleExecutable raw -o - "$app/Contents/Info.plist")"
+ python ../scripts/desktop_release.py verify-macos-build-version \
+ --binary "$app/Contents/MacOS/$executable" \
+ --binary "$app/Contents/Helpers/cua-driver" \
+ --minimum-sdk 26.0 \
+ --maximum-deployment-target 11.0
+
- name: Save Rust build cache
if: ${{ !inputs.release_tag && steps.rust-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
diff --git a/.github/workflows/desktop-shell.yml b/.github/workflows/desktop-shell.yml
index 55acf9173..bc35c09e3 100644
--- a/.github/workflows/desktop-shell.yml
+++ b/.github/workflows/desktop-shell.yml
@@ -11,6 +11,7 @@ on:
- "desktop/**"
- "ui/src/i18n/en.json"
- "ui/src/i18n/zh.json"
+ - "scripts/desktop_release.py"
- ".github/workflows/desktop-shell.yml"
- ".github/workflows/desktop-package.yml"
push:
@@ -20,6 +21,7 @@ on:
- "desktop/**"
- "ui/src/i18n/en.json"
- "ui/src/i18n/zh.json"
+ - "scripts/desktop_release.py"
- ".github/workflows/desktop-shell.yml"
- ".github/workflows/desktop-package.yml"
@@ -38,16 +40,40 @@ jobs:
shell:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
+ env:
+ DEVELOPER_DIR: ${{ matrix.developer_dir }}
strategy:
fail-fast: false
matrix:
- os: [macos-15, windows-latest]
+ include:
+ - os: macos-26
+ developer_dir: /Applications/Xcode_26.6.app/Contents/Developer
+ cache_scope: xcode-26.6-default-target-
+ - os: windows-latest
+ developer_dir: ""
+ cache_scope: ""
defaults:
run:
working-directory: desktop
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - name: Report pinned Apple toolchain
+ if: runner.os == 'macOS'
+ run: |
+ set -euo pipefail
+ [ -d "$DEVELOPER_DIR" ] || {
+ echo "Pinned Xcode is missing: $DEVELOPER_DIR" >&2
+ exit 1
+ }
+ xcodebuild -version
+ [ "$(xcodebuild -version | sed -n '1p')" = "Xcode 26.6" ] || {
+ echo "Expected Xcode 26.6 from $DEVELOPER_DIR" >&2
+ exit 1
+ }
+ xcrun --sdk macosx --show-sdk-version
+ echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> "$GITHUB_ENV"
+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22.23.4"
@@ -63,8 +89,8 @@ jobs:
~/.cargo/registry/cache
~/.cargo/git/db
desktop/target
- key: ${{ runner.os }}-desktop-cargo-${{ hashFiles('desktop/Cargo.lock') }}
- restore-keys: ${{ runner.os }}-desktop-cargo-
+ key: ${{ runner.os }}-${{ matrix.cache_scope }}desktop-cargo-${{ hashFiles('desktop/Cargo.lock') }}
+ restore-keys: ${{ runner.os }}-${{ matrix.cache_scope }}desktop-cargo-
- name: Report toolchain
run: |
@@ -114,3 +140,11 @@ jobs:
- name: Build the shell
run: cargo build --workspace
+
+ - name: Verify macOS SDK and deployment target ceiling
+ if: runner.os == 'macOS'
+ run: >
+ python ../scripts/desktop_release.py verify-macos-build-version
+ --binary target/debug/avibe-desktop
+ --minimum-sdk 26.0
+ --maximum-deployment-target 11.0
diff --git a/scripts/desktop_release.py b/scripts/desktop_release.py
index 00114e917..70acf57cf 100644
--- a/scripts/desktop_release.py
+++ b/scripts/desktop_release.py
@@ -76,6 +76,97 @@ def resolve(tag: str, source_sha: str | None = None) -> dict[str, str]:
"package_version": package_version_from_release_tag(tag)}
+def _numeric_version(value: str) -> tuple[int, ...]:
+ if re.fullmatch(r"[0-9]+(?:\.[0-9]+)*", value) is None:
+ raise ValueError(f"Invalid Mach-O build version: {value}")
+ parts = tuple(int(part) for part in value.split("."))
+ while len(parts) > 1 and parts[-1] == 0:
+ parts = parts[:-1]
+ return parts
+
+
+def parse_macos_build_versions(output: str) -> list[tuple[str, str]]:
+ records: list[tuple[str, str]] = []
+ command: str | None = None
+ minos: str | None = None
+ sdk: str | None = None
+
+ def finish_command() -> None:
+ nonlocal command, minos, sdk
+ if command == "LC_BUILD_VERSION":
+ if minos is None or sdk is None:
+ raise ValueError("Incomplete LC_BUILD_VERSION command")
+ _numeric_version(minos)
+ _numeric_version(sdk)
+ records.append((minos, sdk))
+ command = None
+ minos = None
+ sdk = None
+
+ for line in output.splitlines():
+ fields = line.split()
+ if len(fields) >= 2 and fields[:2] == ["Load", "command"]:
+ finish_command()
+ elif len(fields) == 2 and fields[0] == "cmd":
+ command = fields[1]
+ elif command == "LC_BUILD_VERSION" and len(fields) == 2:
+ if fields[0] == "minos":
+ minos = fields[1]
+ elif fields[0] == "sdk":
+ sdk = fields[1]
+ finish_command()
+ if not records:
+ raise ValueError("Mach-O binary has no LC_BUILD_VERSION command")
+ return records
+
+
+def verify_macos_build_versions(
+ binaries: list[Path],
+ *,
+ minimum_sdk: str,
+ maximum_deployment_target: str,
+) -> None:
+ minimum_sdk_value = _numeric_version(minimum_sdk)
+ maximum_deployment_target_value = _numeric_version(maximum_deployment_target)
+ for binary in binaries:
+ if binary.is_symlink() or not binary.is_file():
+ raise ValueError(f"Missing or invalid Mach-O binary: {binary}")
+ architectures = subprocess.check_output(
+ ["lipo", "-archs", str(binary)],
+ text=True,
+ stderr=subprocess.STDOUT,
+ ).split()
+ if not architectures:
+ raise ValueError(f"Mach-O binary has no architecture: {binary}")
+ for architecture in architectures:
+ output = subprocess.check_output(
+ ["otool", "-arch", architecture, "-l", str(binary)],
+ text=True,
+ stderr=subprocess.STDOUT,
+ )
+ records = parse_macos_build_versions(output)
+ if len(records) != 1:
+ raise ValueError(
+ f"{binary} [{architecture}]: expected exactly one "
+ f"LC_BUILD_VERSION command, got {len(records)}"
+ )
+ minos, sdk = records[0]
+ print(
+ f"{binary} [{architecture}]: "
+ f"LC_BUILD_VERSION minos {minos}, sdk {sdk}"
+ )
+ if _numeric_version(sdk) < minimum_sdk_value:
+ raise ValueError(
+ f"{binary} [{architecture}]: expected LC_BUILD_VERSION sdk >= "
+ f"{minimum_sdk}, got {sdk}"
+ )
+ if _numeric_version(minos) > maximum_deployment_target_value:
+ raise ValueError(
+ f"{binary} [{architecture}]: expected LC_BUILD_VERSION minos <= "
+ f"{maximum_deployment_target}, got {minos}"
+ )
+
+
def prepare(
version: str,
tag: str,
@@ -459,6 +550,10 @@ def main() -> None:
resolver = sub.add_parser("resolve")
resolver.add_argument("--tag", required=True)
resolver.add_argument("--output", type=Path, required=True)
+ build_version = sub.add_parser("verify-macos-build-version")
+ build_version.add_argument("--binary", action="append", type=Path, required=True)
+ build_version.add_argument("--minimum-sdk", default="26.0")
+ build_version.add_argument("--maximum-deployment-target", default="11.0")
prep = sub.add_parser("prepare")
prep.add_argument("--version", required=True)
prep.add_argument("--tag", default="")
@@ -499,6 +594,12 @@ def main() -> None:
# outputs the step already wrote (enabled/updater_enabled).
with args["output"].open("a", encoding="utf-8") as stream:
stream.write("".join(f"{key}={value}\n" for key, value in resolve(args["tag"]).items()))
+ elif command == "verify-macos-build-version":
+ verify_macos_build_versions(
+ args["binary"],
+ minimum_sdk=args["minimum_sdk"],
+ maximum_deployment_target=args["maximum_deployment_target"],
+ )
elif command == "prepare":
prepare(**args)
elif command == "record":
diff --git a/tests/test_desktop_release.py b/tests/test_desktop_release.py
index ad4e1195a..c8e1d02f3 100644
--- a/tests/test_desktop_release.py
+++ b/tests/test_desktop_release.py
@@ -510,6 +510,107 @@ def test_manual_record_names_the_layers_it_produced(tmp_path, profile, layers):
assert (work / "manual" / "Avibe_3.1.2-dev.1_aarch64-apple-darwin.SIGNATURE").read_text() == layers
+def test_macos_build_version_parser_requires_the_pinned_sdk_and_caps_deployment_target(
+ tmp_path, monkeypatch, capsys
+):
+ binary = tmp_path / "avibe-desktop"
+ binary.write_bytes(b"Mach-O fixture")
+
+ def build_version(minos="11.0", sdk="26.5"):
+ return f"""
+Load command 9
+ cmd LC_BUILD_VERSION
+ cmdsize 32
+ platform 1
+ minos {minos}
+ sdk {sdk}
+ ntools 1
+"""
+
+ def verify(output, architectures="x86_64"):
+ def check_output(command, **kwargs):
+ if command[:2] == ["lipo", "-archs"]:
+ return architectures
+ assert command[:2] == ["otool", "-arch"]
+ return output
+
+ monkeypatch.setattr(release.subprocess, "check_output", check_output)
+ release.verify_macos_build_versions(
+ [binary],
+ minimum_sdk="26.0",
+ maximum_deployment_target="11.0",
+ )
+
+ verify(build_version(minos="10.13"))
+ assert f"{binary} [x86_64]: LC_BUILD_VERSION minos 10.13, sdk 26.5" in capsys.readouterr().out
+ verify(build_version(minos="11.0"), architectures="arm64")
+ assert f"{binary} [arm64]: LC_BUILD_VERSION minos 11.0, sdk 26.5" in capsys.readouterr().out
+ for output, message in (
+ (build_version(sdk="15.5"), "sdk >= 26.0"),
+ (build_version(minos="13.0"), "minos <= 11.0"),
+ ):
+ with pytest.raises(ValueError, match=message):
+ verify(output)
+
+
+def test_macos_desktop_builds_pin_xcode_and_check_link_metadata():
+ package = workflow("desktop-package.yml")["jobs"]["package"]
+ package_macos = [
+ item
+ for item in package["strategy"]["matrix"]["include"]
+ if item["target"].endswith("apple-darwin")
+ ]
+ assert {(item["target"], item["os"]) for item in package_macos} == {
+ ("aarch64-apple-darwin", "macos-26"),
+ ("x86_64-apple-darwin", "macos-26-intel"),
+ }
+ for item in package_macos:
+ assert item["developer_dir"] == "/Applications/Xcode_26.6.app/Contents/Developer"
+ assert "macosx_deployment_target" not in item
+ assert item["cache_scope"] == "default-target-"
+ assert package["env"]["DEVELOPER_DIR"] == "${{ matrix.developer_dir }}"
+ assert "MACOSX_DEPLOYMENT_TARGET" not in package["env"]
+ cache = next(
+ item for item in package["steps"] if item.get("name") == "Restore Rust build cache"
+ )
+ assert "steps.toolchain.outputs.apple" in cache["with"]["key"]
+ assert "matrix.cache_scope" in cache["with"]["key"]
+
+ shell = workflow("desktop-shell.yml")["jobs"]["shell"]
+ shell_macos = next(
+ item
+ for item in shell["strategy"]["matrix"]["include"]
+ if item["os"] == "macos-26"
+ )
+ assert shell_macos["developer_dir"] == "/Applications/Xcode_26.6.app/Contents/Developer"
+ assert "macosx_deployment_target" not in shell_macos
+ assert "MACOSX_DEPLOYMENT_TARGET" not in shell["env"]
+
+ for job in (package, shell):
+ report = next(
+ item
+ for item in job["steps"]
+ if item.get("name") == "Report pinned Apple toolchain"
+ )
+ assert "xcodebuild -version" in report["run"]
+ assert "xcrun --sdk macosx --show-sdk-version" in report["run"]
+ assert "SDKROOT=" in report["run"]
+ check = next(
+ item
+ for item in job["steps"]
+ if item.get("name") == "Verify macOS SDK and deployment target ceiling"
+ )
+ assert "verify-macos-build-version" in check["run"]
+ assert "--minimum-sdk 26.0" in check["run"]
+ assert "--maximum-deployment-target 11.0" in check["run"]
+ package_check = next(
+ item
+ for item in package["steps"]
+ if item.get("name") == "Verify macOS SDK and deployment target ceiling"
+ )
+ assert "Contents/Helpers/cua-driver" in package_check["run"]
+
+
def test_workflow_signs_every_macos_layer_before_recording():
package = workflow("desktop-package.yml")
triggers = package.get("on", package.get(True))