From a61616ec26fff9d0800697ea1ce380e3df66c29c Mon Sep 17 00:00:00 2001 From: Olivier Giniaux Date: Wed, 15 May 2024 23:33:12 +0200 Subject: [PATCH] Fix x86 hybrid build since rust 1.79 (#68) * Fix x86 hybrid build since rust update * Try remove stdsimd * Display version * Try github macos runner * Set version to 3.2.0 * Test rustc 1.72 with hybrid * Add rust version compat check * Try use patch in v * Another test * Disable fail fast * Fix hybrid * Fix missing cpu feature * No hybrid * Workflow dispatch --- .github/workflows/build_test.yml | 11 ++++++++++- .github/workflows/rust_version.yml | 28 ++++++++++++++++++++++++++++ Cargo.toml | 2 +- src/lib.rs | 2 +- 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/rust_version.yml diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index e1b34b5..79713e8 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -17,6 +17,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Rust version + run: cargo rustc -- --version + - name: Build run: cargo build --release @@ -33,6 +36,9 @@ jobs: - name: Switch to nightly rust run: rustup default nightly + - name: Rust version + run: cargo rustc -- --version + - name: Build run: cargo build --release @@ -41,11 +47,14 @@ jobs: build_test_arm: name: Build & Test ARM - runs-on: buildjet-2vcpu-ubuntu-2204-arm + runs-on: macos-latest steps: - uses: actions/checkout@v3 + - name: Rust version + run: cargo rustc -- --version + - name: Build run: cargo build --release diff --git a/.github/workflows/rust_version.yml b/.github/workflows/rust_version.yml new file mode 100644 index 0000000..30e608f --- /dev/null +++ b/.github/workflows/rust_version.yml @@ -0,0 +1,28 @@ +name: Rust Version Compatibility + +on: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + + build_test_x86: + name: Build & Test X86 + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + version: ["1.65", "1.72", "1.78"] + + steps: + - uses: actions/checkout@v3 + + - name: Install ${{ matrix.version }} + run: rustup toolchain install ${{ matrix.version }} + + - name: Build + # RUSTFLAGS="-C target-cpu=native --cfg hybrid" + run: RUSTFLAGS="-C target-cpu=native" cargo +${{ matrix.version }} build --release \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index f06471c..a3d5df9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "gxhash" authors = ["Olivier Giniaux"] -version = "3.1.1" +version = "3.2.0" edition = "2021" description = "GxHash non-cryptographic algorithm" license = "MIT" diff --git a/src/lib.rs b/src/lib.rs index 0c54243..863d67e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,5 @@ // Hybrid SIMD width usage currently requires unstable 'stdsimd' -#![cfg_attr(hybrid, feature(stdsimd))] +#![cfg_attr(hybrid, feature(stdarch_x86_avx512))] #[rustfmt::skip] mod gxhash;