From 7a20f4f36f09baa13863287ca63454b499fa2e11 Mon Sep 17 00:00:00 2001 From: Dmitri Makarov Date: Thu, 9 Feb 2023 17:49:20 -0500 Subject: [PATCH] Add aarch64 to build hosts running macOS --- .github/workflows/main.yml | 42 +++++++++++++++++++------------------- build.sh | 22 ++++++++++++++------ 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ea7c9c4..528e26e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,13 +71,13 @@ jobs: - name: Upload ${{ matrix.tar }} BPF tarball uses: actions/upload-artifact@v3 with: - name: solana-bpf-tools-${{ matrix.tar }}.tar.bz2 - path: solana-bpf-tools-${{ matrix.tar }}.tar.bz2 + name: solana-bpf-tools-${{ matrix.tar }}-x86_64.tar.bz2 + path: solana-bpf-tools-${{ matrix.tar }}-x86_64.tar.bz2 - name: Upload ${{ matrix.tar }} SBF tarball uses: actions/upload-artifact@v3 with: - name: solana-sbf-tools-${{ matrix.tar }}.tar.bz2 - path: solana-sbf-tools-${{ matrix.tar }}.tar.bz2 + name: solana-sbf-tools-${{ matrix.tar }}-x86_64.tar.bz2 + path: solana-sbf-tools-${{ matrix.tar }}-x86_64.tar.bz2 release: name: Upload Release Assets @@ -88,19 +88,19 @@ jobs: - name: Download Linux BPF tarball uses: actions/download-artifact@v3 with: - name: solana-bpf-tools-linux.tar.bz2 + name: solana-bpf-tools-linux-x86_64.tar.bz2 - name: Download macOS BPF tarball uses: actions/download-artifact@v3 with: - name: solana-bpf-tools-osx.tar.bz2 + name: solana-bpf-tools-osx-x86_64.tar.bz2 - name: Download Linux SBF tarball uses: actions/download-artifact@v3 with: - name: solana-sbf-tools-linux.tar.bz2 + name: solana-sbf-tools-linux-x86_64.tar.bz2 - name: Download macOS SBF tarball uses: actions/download-artifact@v3 with: - name: solana-sbf-tools-osx.tar.bz2 + name: solana-sbf-tools-osx-x86_64.tar.bz2 - name: Download Windows BPF tarball uses: actions/download-artifact@v3 with: @@ -108,7 +108,7 @@ jobs: - name: Download Windows SBF tarball uses: actions/download-artifact@v3 with: - name: solana-sbf-tools-windows.tar.bz2 + name: solana-sbf-tools-windows-x86_64.tar.bz2 - name: Create Release id: create_release uses: actions/create-release@v1 @@ -126,8 +126,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: solana-bpf-tools-linux.tar.bz2 - asset_name: solana-bpf-tools-linux.tar.bz2 + asset_path: solana-bpf-tools-linux-x86_64.tar.bz2 + asset_name: solana-bpf-tools-linux-x86_64.tar.bz2 asset_content_type: application/zip - name: Release macOS BPF tarball id: upload-release-macos-bpf @@ -136,8 +136,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: solana-bpf-tools-osx.tar.bz2 - asset_name: solana-bpf-tools-osx.tar.bz2 + asset_path: solana-bpf-tools-osx-x86_64.tar.bz2 + asset_name: solana-bpf-tools-osx-x86_64.tar.bz2 asset_content_type: application/zip - name: Release Linux SBF tarball id: upload-release-linux-sbf @@ -146,8 +146,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: solana-sbf-tools-linux.tar.bz2 - asset_name: solana-sbf-tools-linux.tar.bz2 + asset_path: solana-sbf-tools-linux-x86_64.tar.bz2 + asset_name: solana-sbf-tools-linux-x86_64.tar.bz2 asset_content_type: application/zip - name: Release macOS SBF tarball id: upload-release-macos-sbf @@ -156,8 +156,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: solana-sbf-tools-osx.tar.bz2 - asset_name: solana-sbf-tools-osx.tar.bz2 + asset_path: solana-sbf-tools-osx-x86_64.tar.bz2 + asset_name: solana-sbf-tools-osx-x86_64.tar.bz2 asset_content_type: application/zip - name: Release Windows BPF tarball id: upload-release-windows-bpf @@ -166,8 +166,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: solana-bpf-tools-windows.tar.bz2 - asset_name: solana-bpf-tools-windows.tar.bz2 + asset_path: solana-bpf-tools-windows-x86_64.tar.bz2 + asset_name: solana-bpf-tools-windows-x86_64.tar.bz2 asset_content_type: application/zip - name: Release Windows SBF tarball id: upload-release-windows-sbf @@ -176,6 +176,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: solana-sbf-tools-windows.tar.bz2 - asset_name: solana-sbf-tools-windows.tar.bz2 + asset_path: solana-sbf-tools-windows-x86_64.tar.bz2 + asset_name: solana-sbf-tools-windows-x86_64.tar.bz2 asset_content_type: application/zip diff --git a/build.sh b/build.sh index f8dafaf..4285513 100755 --- a/build.sh +++ b/build.sh @@ -5,16 +5,26 @@ unameOut="$(uname -s)" case "${unameOut}" in Darwin*) EXE_SUFFIX= - HOST_TRIPLE=x86_64-apple-darwin - ARTIFACT=solana-bpf-tools-osx.tar.bz2;; + if [[ "$(uname -m)" == "arm64" ]] ; then + HOST_TRIPLE=aarch64-apple-darwin + ARTIFACT=solana-bpf-tools-osx-aarch64.tar.bz2 + else + HOST_TRIPLE=x86_64-apple-darwin + ARTIFACT=solana-bpf-tools-osx-x86_64.tar.bz2 + fi;; MINGW*) EXE_SUFFIX=.exe HOST_TRIPLE=x86_64-pc-windows-msvc - ARTIFACT=solana-bpf-tools-windows.tar.bz2;; + ARTIFACT=solana-bpf-tools-windows-x86_64.tar.bz2;; Linux* | *) EXE_SUFFIX= - HOST_TRIPLE=x86_64-unknown-linux-gnu - ARTIFACT=solana-bpf-tools-linux.tar.bz2 + if [[ "$(uname -m)" == "arm64" ]] ; then + HOST_TRIPLE=aarch64-unknown-linux-gnu + ARTIFACT=solana-bpf-tools-linux-aarch64.tar.bz2 + else + HOST_TRIPLE=x86_64-unknown-linux-gnu + ARTIFACT=solana-bpf-tools-linux-x86_64.tar.bz2 + fi esac cd "$(dirname "$0")" @@ -160,5 +170,5 @@ if [[ "$(uname)" == "Darwin" ]] && [[ $# == 1 ]] && [[ "$1" == "--docker" ]] ; t id=$(docker create solanalabs/bpf-tools /build.sh "${OUT_DIR}") docker cp build.sh "${id}:/" docker start -a "${id}" - docker cp "${id}:${OUT_DIR}/solana-bpf-tools-linux.tar.bz2" "${OUT_DIR}" + docker cp "${id}:${OUT_DIR}/solana-bpf-tools-linux-x86_64.tar.bz2" "${OUT_DIR}" fi