From d06fe93171d5d1a29bebf8030544a8a6383089d9 Mon Sep 17 00:00:00 2001 From: sreedevk Date: Sat, 19 Jul 2025 12:27:49 +0000 Subject: [PATCH] fix pipeline breaks --- .cargo/config.toml | 2 -- .github/workflows/release.yml | 31 ++++++++++++++++++++++++++++--- README.md | 13 +++++++++++-- 3 files changed, 39 insertions(+), 7 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 5cd7d81..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -rustflags = ["-C", "target-feature=+aes,+sse2"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ffe5e0..4bdce9a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Deduplicator Build & Release CI Pipeline +name: Deduplicator Release Build CI Pipeline on: push: @@ -8,6 +8,8 @@ on: jobs: lint_test: runs-on: ubuntu-latest + env: + RUSTFLAGS: "-C target-feature=+aes,+sse2" steps: - name: Checkout repository uses: actions/checkout@v4 @@ -35,15 +37,19 @@ jobs: - target: aarch64-unknown-linux-gnu os: ubuntu-latest artifact_name: linux-aarch64 + rustflags: "-C target-feature=+aes,+neon" - target: x86_64-unknown-linux-gnu os: ubuntu-latest artifact_name: linux-amd64 + rustflags: "-C target-feature=+aes,+sse2" - target: x86_64-apple-darwin os: macos-14 artifact_name: macos-amd64 + rustflags: "-C target-feature=+aes,+sse2" - target: aarch64-apple-darwin os: macos-14 artifact_name: macos-arm64 + rustflags: "-C target-feature=+aes,+neon" steps: - name: Checkout repository @@ -55,12 +61,31 @@ jobs: - name: Add target run: rustup target add ${{ matrix.target }} + - name: Install cross-compilation toolchain (Linux ARM only) + if: matrix.target == 'aarch64-unknown-linux-gnu' + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu + - name: Build release binary - run: cargo build --release --target ${{ matrix.target }} + env: + RUSTFLAGS: ${{ matrix.rustflags }} + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: ${{ matrix.target == 'aarch64-unknown-linux-gnu' && 'aarch64-linux-gnu-gcc' || '' }} + run: | + if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then + export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc + fi + cargo build --release --target ${{ matrix.target }} - name: Package binary run: | - BINARY_NAME=$(basename $(find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable | head -1)) + if [[ "${{ matrix.os }}" == macos* ]]; then + BINARY_NAME=$(find target/${{ matrix.target }}/release -maxdepth 1 -type f -perm +111 -print0 | xargs -0 basename | head -1) + else + BINARY_NAME=$(find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable -print0 | xargs -0 basename | head -1) + fi + + echo "Packaging binary: $BINARY_NAME" mkdir -p release cp target/${{ matrix.target }}/release/$BINARY_NAME release/$BINARY_NAME tar -C release -czf ${{ matrix.artifact_name }}.tar.gz $BINARY_NAME diff --git a/README.md b/README.md index edb8e32..9c087a7 100644 --- a/README.md +++ b/README.md @@ -61,14 +61,23 @@ Currently, you can only install deduplicator using cargo package manager. > GxHash relies on aes hardware acceleration, so please set `RUSTFLAGS` to `"-C target-feature=+aes"` or `"-C target-cpu=native"` before > installing. -#### install from crates.io +#### install from crates.io (stable) + ```bash $ RUSTFLAGS="-C target-cpu=native" cargo install deduplicator + +# or + +$ RUSTFLAGS="-C target-feature=+aes,+sse2" cargo install deduplicator ``` -#### install from git +#### install from git (nightly) ```bash $ RUSTFLAGS="-C target-cpu=native" cargo install deduplicator --git https://github.com/sreedevk/deduplicator + +# or + +$ RUSTFLAGS="-C target-feature=+aes,+sse2" cargo install --git https://github.com/sreedevk/deduplicator ``` ## Performance