From 51cfb46c784d5150ec04bff0b7ab9323cf075df5 Mon Sep 17 00:00:00 2001 From: Nisheeth Barthwal Date: Thu, 23 Jan 2025 14:17:26 +0100 Subject: [PATCH] use cross --- .github/workflows/release.yml | 81 ++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56aef48d5..64c475a72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,19 +124,22 @@ jobs: - name: Install required Rust targets run: rustup target add ${{ matrix.target }} + + - name: Install cross v0.2.5 from source + run: cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.5 - uses: Swatinem/rust-cache@v2 with: key: ${{ matrix.target }} cache-on-failure: true - - name: Apple M1 setup - if: matrix.target == 'aarch64-apple-darwin' - run: | - brew install make - echo "PATH=/usr/local/opt/make/libexec/gnubin:$PATH" >> $GITHUB_ENV - echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV - echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV + # - name: Apple M1 setup + # if: matrix.target == 'aarch64-apple-darwin' + # run: | + # brew install make + # echo "PATH=/usr/local/opt/make/libexec/gnubin:$PATH" >> $GITHUB_ENV + # echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV + # echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV - name: Apple Darwin if: matrix.target == 'x86_64-apple-darwin' @@ -144,42 +147,42 @@ jobs: brew install make echo "PATH=/usr/local/opt/make/libexec/gnubin:$PATH" >> $GITHUB_ENV - - name: Linux ARM setup - if: matrix.target == 'aarch64-unknown-linux-gnu' - run: | - set -x - ls -l /etc/apt/sources.list - ls -l /etc/apt/sources.list.d - cat /etc/apt/sources.list.d/ubuntu.sources - ls -l /etc/apt/sources.list.d/ubuntu.sources + # - name: Linux ARM setup + # if: matrix.target == 'aarch64-unknown-linux-gnu' + # run: | + # set -x + # ls -l /etc/apt/sources.list + # ls -l /etc/apt/sources.list.d + # cat /etc/apt/sources.list.d/ubuntu.sources + # ls -l /etc/apt/sources.list.d/ubuntu.sources - echo 'updating' - sudo echo 'Types: deb - URIs: http://ports.ubuntu.com/ubuntu-ports/ - Suites: noble noble-updates noble-backports - Architectures: arm64 - Components: main restricted universe multiverse - Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg + # echo 'updating' + # sudo echo 'Types: deb + # URIs: http://ports.ubuntu.com/ubuntu-ports/ + # Suites: noble noble-updates noble-backports + # Architectures: arm64 + # Components: main restricted universe multiverse + # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg - Types: deb - URIs: http://ports.ubuntu.com/ubuntu-ports/ - Suites: noble-security - Architectures: arm64 - Components: main restricted universe multiverse - Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg' | sudo dd of=/etc/apt/sources.list.d/ubuntu.sources + # Types: deb + # URIs: http://ports.ubuntu.com/ubuntu-ports/ + # Suites: noble-security + # Architectures: arm64 + # Components: main restricted universe multiverse + # Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg' | sudo dd of=/etc/apt/sources.list.d/ubuntu.sources - # deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main universe - # deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main universe + # # deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main universe + # # deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main universe - echo 'check' - cat /etc/apt/sources.list.d/ubuntu.sources - sudo dpkg --add-architecture arm64 - sudo apt-get update -y - sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu pkg-config pkg-config:arm64 libssl-dev:arm64 - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV - echo "C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include" >> $GITHUB_ENV - echo "CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include" >> $GITHUB_ENV + # echo 'check' + # cat /etc/apt/sources.list.d/ubuntu.sources + # sudo dpkg --add-architecture arm64 + # sudo apt-get update -y + # sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu pkg-config pkg-config:arm64 libssl-dev:arm64 + # echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + # echo "C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include" >> $GITHUB_ENV + # echo "CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include" >> $GITHUB_ENV - name: Build binaries env: @@ -196,7 +199,7 @@ jobs: # flags+=(--features asm-keccak) # fi - RUSTFLAGS='-C target-feature=+crt-static' cargo build --release --bin forge --bin cast --target "$target" "${flags[@]}" + RUSTFLAGS='-C target-feature=+crt-static' OPENSSL_STATIC=1 cross build --release --bin forge --bin cast --target "$target" "${flags[@]}" bins=(cast forge) for name in "${bins[@]}"; do