From 231eee53c4bcd75d5300b4287cbe0f1752e4dc55 Mon Sep 17 00:00:00 2001 From: Dang Mai Date: Sun, 27 Oct 2024 11:15:17 -0700 Subject: [PATCH] Support Apex AST Serializer native executable for macOS x64 (#1681) * [apex-ast-serializer] add native executable for macOS x64 * Run package test on macOS x64 * Add CHANGELOG entry --- .github/workflows/tests-deployments.yml | 7 +++++++ CHANGELOG.md | 1 + .../prettier-plugin-apex/bin/install-apex-executables.ts | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-deployments.yml b/.github/workflows/tests-deployments.yml index ab5896eb..6fcdb6a4 100644 --- a/.github/workflows/tests-deployments.yml +++ b/.github/workflows/tests-deployments.yml @@ -134,6 +134,7 @@ jobs: - ubuntu-latest - windows-latest - macos-14 + - macos-13 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4.2.2 @@ -171,10 +172,16 @@ jobs: ASSET_NAME: apex-ast-serializer OUTPUT_NAME: apex-ast-serializer-${version}-linux-x64 ARTIFACT_NAME: apex-ast-serializer-linux-x64 + # macOS 14 and above are ARM64 by default, see this link for more info: + # https://github.com/actions/runner-images?tab=readme-ov-file#available-images - os: macos-14 ASSET_NAME: apex-ast-serializer OUTPUT_NAME: apex-ast-serializer-${version}-darwin-arm64 ARTIFACT_NAME: apex-ast-serializer-darwin-arm64 + - os: macos-13 + ASSET_NAME: apex-ast-serializer + OUTPUT_NAME: apex-ast-serializer-${version}-darwin-x64 + ARTIFACT_NAME: apex-ast-serializer-darwin-x64 env: ASSET_NAME: ${{ matrix.ASSET_NAME }} OUTPUT_NAME: ${{ matrix.OUTPUT_NAME }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 70b85de4..8b0226f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +- Support Apex AST Serializer native executable for macOS x64. - Improve native executable performance by utilizing Profile-Guided Optimization. - Improve parsing performance by directly serializing object references. - Improve parsing performance by using one-pass Depth-First Search to enrich AST. diff --git a/packages/prettier-plugin-apex/bin/install-apex-executables.ts b/packages/prettier-plugin-apex/bin/install-apex-executables.ts index f934062a..6c7cdd46 100755 --- a/packages/prettier-plugin-apex/bin/install-apex-executables.ts +++ b/packages/prettier-plugin-apex/bin/install-apex-executables.ts @@ -11,7 +11,12 @@ import { doesFileExist, getNativeExecutable } from "../src/util.js"; const { arch, platform } = process; -const PREBUILT_ARCHITECTURES = ["win32-x64", "linux-x64", "darwin-arm64"]; +const PREBUILT_ARCHITECTURES = [ + "win32-x64", + "linux-x64", + "darwin-arm64", + "darwin-x64", +]; const { values: { dev, force },