From f8ad5fe3e98c449b8833f976ad17ab901f280226 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 13 Jun 2024 08:00:15 -0600 Subject: [PATCH] Arm builds (#12961) Release Notes: - N/A --- .cargo/config.toml | 6 ++- .github/workflows/ci.yml | 83 ++++++++++++++++++++++++++++++++++++++++ script/generate-licenses | 1 + 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 828d113ffd..39fabdb5b8 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -6,5 +6,9 @@ rustflags = ["-C", "symbol-mangling-version=v0", "--cfg", "tokio_unstable"] xtask = "run --package xtask --" [target.x86_64-unknown-linux-gnu] -linker = "/usr/bin/clang" +linker = "clang" +rustflags = ["-C", "link-arg=-fuse-ld=mold"] + +[target.aarch64-unknown-linux-gnu] +linker = "clang" rustflags = ["-C", "link-arg=-fuse-ld=mold"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f03bd5525..3b66927411 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -325,3 +325,86 @@ jobs: body: "" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + bundle-linux-aarch64: + timeout-minutes: 60 + name: Create arm64 Linux bundle + runs-on: + - hosted-linux-arm-1 + if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-bundling') }} + needs: [linux_tests] + env: + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + clean: false + - name: "Setup jq" + uses: dcarbone/install-jq-action@v2 + + - name: Set up Clang + run: | + sudo apt-get update + sudo apt-get install -y llvm-10 clang-10 build-essential cmake pkg-config libasound2-dev libfontconfig-dev libwayland-dev libxkbcommon-x11-dev libssl-dev libzstd-dev libvulkan1 libgit2-dev + echo "/usr/lib/llvm-10/bin" >> $GITHUB_PATH + + - uses: rui314/setup-mold@v1 + with: + mold_version: 2.32.0 + + - name: rustup + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Limit target directory size + run: script/clear-target-dir-if-larger-than 100 + + - name: Determine version and release channel + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + run: | + set -eu + + version=$(script/get-crate-version zed) + channel=$(cat crates/zed/RELEASE_CHANNEL) + echo "Publishing version: ${version} on release channel ${channel}" + echo "RELEASE_CHANNEL=${channel}" >> $GITHUB_ENV + + expected_tag_name="" + case ${channel} in + stable) + expected_tag_name="v${version}";; + preview) + expected_tag_name="v${version}-pre";; + nightly) + expected_tag_name="v${version}-nightly";; + *) + echo "can't publish a release on channel ${channel}" + exit 1;; + esac + if [[ $GITHUB_REF_NAME != $expected_tag_name ]]; then + echo "invalid release tag ${GITHUB_REF_NAME}. expected ${expected_tag_name}" + exit 1 + fi + + - name: Create and upload Linux .tar.gz bundle + run: script/bundle-linux + + - name: Upload Linux bundle to workflow run if main branch or specific label + uses: actions/upload-artifact@v4 + if: ${{ github.ref == 'refs/heads/main' }} || contains(github.event.pull_request.labels.*.name, 'run-bundling') }} + with: + name: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + path: target/release/zed-*.tar.gz + + - name: Upload app bundle to release + uses: softprops/action-gh-release@v1 + if: ${{ env.RELEASE_CHANNEL == 'preview' }} + with: + draft: true + prerelease: ${{ env.RELEASE_CHANNEL == 'preview' }} + files: target/release/zed-linux-aarch64.tar.gz + body: "" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/script/generate-licenses b/script/generate-licenses index 5f788ed03e..e1f83f3553 100755 --- a/script/generate-licenses +++ b/script/generate-licenses @@ -17,6 +17,7 @@ echo -e "# ###### CODE LICENSES ######\n" >> $OUTPUT_FILE [[ "$(cargo about --version)" == "cargo-about 0.6.1" ]] || cargo install cargo-about@0.6.1 echo "Generating cargo licenses" +cargo install cargo-about cargo about generate --fail -c script/licenses/zed-licenses.toml script/licenses/template.hbs.md >> $OUTPUT_FILE