From ec1fb1b5e79f92b9b704f8a0325672551c118a40 Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sat, 18 Apr 2026 17:06:34 +0800 Subject: [PATCH] fix(build): ensure macOS packaging builds native dependencies and universal FFI binary --- .gitignore | 1 + Makefile | 11 +++++------ patch_pipeline_ansible.py | 38 -------------------------------------- patch_pipeline_v3.py | 22 ---------------------- 4 files changed, 6 insertions(+), 66 deletions(-) delete mode 100644 patch_pipeline_ansible.py delete mode 100644 patch_pipeline_v3.py diff --git a/.gitignore b/.gitignore index ff63b242..c4e4d902 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Miscellaneous .env +*.py null/ test/golden/failures/ diff --git a/Makefile b/Makefile index 4e0a6d53..9bb7170c 100644 --- a/Makefile +++ b/Makefile @@ -110,11 +110,10 @@ package-rpm: ## Create the Linux .rpm package package-linux: ## Create both Linux packages bash scripts/package-linux.sh -package-mac: ## Create the macOS .app and DMG +package-mac: ffi-integrate build-go-core ## Create the macOS .app and DMG XWORKMATE_APP_STORE=true bash scripts/package-flutter-mac-app.sh -install-mac: ## Package and install the macOS app into /Applications - XWORKMATE_APP_STORE=true bash scripts/package-flutter-mac-app.sh +install-mac: package-mac ## Package and install the macOS app into /Applications bash scripts/install-flutter-mac-dmg.sh clean: ## Remove generated artifacts @@ -129,12 +128,12 @@ check-export-compliance: ## Verify source and built Apple plist export-complianc rust-build: rust-build-release ## Build Rust FFI library (release mode) -rust-build-release: ## Build Rust FFI library for macOS (arm64) - cd rust && cargo build --release --target aarch64-apple-darwin +rust-build-release: ## Build Rust FFI library for macOS (universal) + bash scripts/build_rust_ffi.sh release @echo "Rust FFI library built successfully" rust-build-debug: ## Build Rust FFI library in debug mode - cd rust && cargo build --target aarch64-apple-darwin + bash scripts/build_rust_ffi.sh debug rust-test: ## Run Rust tests cd rust && cargo test diff --git a/patch_pipeline_ansible.py b/patch_pipeline_ansible.py deleted file mode 100644 index 00bf0ffb..00000000 --- a/patch_pipeline_ansible.py +++ /dev/null @@ -1,38 +0,0 @@ -import os - -path = '/Users/shenlan/workspaces/cloud-neutral-toolkit/xworkmate-bridge/.github/workflows/pipeline.yml' -with open(path, 'r') as f: - content = f.read() - -# Update the "Run Ansible deploy playbook" step to run directly instead of through deploy.sh -target_step = ''' - name: Run Ansible deploy playbook - working-directory: xworkmate-bridge - env: - INTERNAL_SERVICE_TOKEN: ${{ env.INTERNAL_SERVICE_TOKEN }} - GHCR_USERNAME: ${{ env.GHCR_USERNAME }} - GHCR_PASSWORD: ${{ env.GHCR_PASSWORD }} - XWORKMATE_BRIDGE_IMAGE_ARTIFACT_PATH: ${{ github.workspace }}/xworkmate-bridge/dist/image-artifact/service-image-ref.txt - run: bash ./scripts/github-actions/deploy.sh "${{ steps.deploy_meta.outputs.target_host }}" "${{ steps.deploy_meta.outputs.run_apply }}" ../playbooks''' - -replacement_step = ''' - name: Run Ansible deploy playbook - working-directory: playbooks - env: - ANSIBLE_CONFIG: ./ansible.cfg - BRIDGE_AUTH_TOKEN: ${{ env.INTERNAL_SERVICE_TOKEN }} - run: | - SERVICE_COMPOSE_IMAGE="$(cat ../xworkmate-bridge/dist/image-artifact/service-image-ref.txt | xargs)" - CHECK_MODE_FLAG="" - if [[ "${{ steps.deploy_meta.outputs.run_apply }}" != "true" ]]; then - CHECK_MODE_FLAG="-C" - fi - ansible-playbook -i inventory.ini deploy_xworkmate_bridge_vhosts.yml \\ - -D ${CHECK_MODE_FLAG} \\ - -l "${{ steps.deploy_meta.outputs.target_host }}" \\ - -e "service_compose_image=${SERVICE_COMPOSE_IMAGE}" \\ - -e "ghcr_username=${{ env.GHCR_USERNAME }}" \\ - -e "ghcr_password=${{ env.GHCR_PASSWORD }}"''' - -content = content.replace(target_step, replacement_step) - -with open(path, 'w') as f: - f.write(content) diff --git a/patch_pipeline_v3.py b/patch_pipeline_v3.py deleted file mode 100644 index 98c83dcc..00000000 --- a/patch_pipeline_v3.py +++ /dev/null @@ -1,22 +0,0 @@ -import os - -path = '/Users/shenlan/workspaces/cloud-neutral-toolkit/xworkmate-bridge/.github/workflows/pipeline.yml' -with open(path, 'r') as f: - content = f.read() - -# Redirect all xworkmate-bridge.svc.plus calls to the functional xworkmate-bridge.svc.plus sub-paths -content = content.replace( - 'https://xworkmate-bridge.svc.plus/codex/acp/rpc', - 'https://xworkmate-bridge.svc.plus/acp-server/codex/acp/rpc' -) -content = content.replace( - 'https://xworkmate-bridge.svc.plus/opencode/acp/rpc', - 'https://xworkmate-bridge.svc.plus/acp-server/opencode/acp/rpc' -) -content = content.replace( - 'https://xworkmate-bridge.svc.plus/gemini/acp/rpc', - 'https://xworkmate-bridge.svc.plus/acp-server/gemini/acp/rpc' -) - -with open(path, 'w') as f: - f.write(content)