Skip to content

Commit 6ca381c

Browse files
committed
Remove C bindings entirely
The C bindings approach has proven to be problematic across a variety of CI/CD implementations, particularly when cross-compiling to other targets. Moving to a pure Rust implementation should eliminate those issues.
1 parent 8ae96e2 commit 6ca381c

24 files changed

+20
-3307
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Architecture check
2828
run: cargo run arch-check
2929
- name: Architecture check (Optimized)
30-
run: cargo run --features=optimize_crc32_auto arch-check
30+
run: cargo run arch-check
3131
- if: ${{ matrix.rust-toolchain != 'nightly' }}
3232
name: Format
3333
run: cargo fmt -- --check
@@ -36,8 +36,6 @@ jobs:
3636
run: cargo clippy
3737
- name: Test
3838
run: cargo test
39-
- name: Test (Optimized)
40-
run: cargo test --features=optimize_crc32_auto
4139

4240
test-x86:
4341
name: Test accelerated (x86)
@@ -61,8 +59,6 @@ jobs:
6159
run: cross check --target ${{ matrix.target }}
6260
- name: Test
6361
run: cross test --target ${{ matrix.target }}
64-
- name: Test (Optimized)
65-
run: cross test --features=optimize_crc32_auto --target ${{ matrix.target }}
6662

6763
test-software:
6864
name: Test software fallback
@@ -85,6 +81,4 @@ jobs:
8581
- name: Check
8682
run: cross check --target ${{ matrix.target }}
8783
- name: Test
88-
run: cross test --target ${{ matrix.target }}
89-
- name: Test (Optimized)
90-
run: cross test --features=optimize_crc32_auto --target ${{ matrix.target }}
84+
run: cross test --target ${{ matrix.target }}

Cargo.lock

Lines changed: 0 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ criterion = "0.5"
3030
cbindgen = "0.28"
3131
bindgen = "0.70" # 0.70 is the last version that supports Rust 1.81 due to 'unsafe extern' blocks
3232

33-
[build-dependencies]
34-
cc = { version = "1.2", features = ["parallel"] }
35-
3633
# lto=true has a big improvement in performance
3734
[profile.release]
3835
lto = true
@@ -53,30 +50,12 @@ vpclmulqdq = []
5350
# enable AVX512 support in Rust for x86_64 using nightly toolchain builds
5451
avx512 = []
5552

56-
# enable using fast-crc32 optimized C implementations for CRC-32/ISCSI and CRC-32/ISO-HDLC, automatically detected
57-
optimize_crc32_auto = []
58-
59-
# the following features enable forcing custom optimized build features (rather than "auto" which attemps to pick the
60-
# best) for CRC-32/ISCSI and CRC-32/ISO-HDLC calculations, since architecture support and performance varies
61-
62-
# aarch64 NEON options
63-
optimize_crc32_neon_eor3_v9s3x2e_s3 = []
64-
optimize_crc32_neon_v12e_v1 = []
65-
optimize_crc32_neon_v3s4x2e_v2 = []
66-
67-
# blends eor3_v9s3x2e_s3 for "large" (>1KiB) payloads, and v12e_v1 for "small" ones, which tends to yield the best
68-
# results on modern aarch64 such as Graviton and Apple Silicon
69-
optimize_crc32_neon_blended = []
70-
71-
# x86 SSE+ options
72-
# this will blend automagically for CRC-32/ISO-HDLC which tends to have poor hardware support, but typically great
73-
# support for CRC-32/ISCSI
74-
optimize_crc32_avx512_vpclmulqdq_v3x2 = []
75-
76-
# non-blended alternatives
77-
optimize_crc32_avx512_v4s3x3 = []
78-
optimize_crc32_sse_v4s3x3 = []
79-
80-
[lints.rust]
81-
# build-time feature enablement
82-
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(optimized_crc32_iscsi)','cfg(optimized_crc32_iso_hdlc)' ] }
53+
# these features aren't in use, are deprecated, and will be removed in the next MAJOR version
54+
optimize_crc32_auto = [] # deprecated
55+
optimize_crc32_neon_eor3_v9s3x2e_s3 = [] # deprecated
56+
optimize_crc32_neon_v12e_v1 = [] # deprecated
57+
optimize_crc32_neon_v3s4x2e_v2 = [] # deprecated
58+
optimize_crc32_neon_blended = [] # deprecated
59+
optimize_crc32_avx512_vpclmulqdq_v3x2 = [] # deprecated
60+
optimize_crc32_avx512_v4s3x3 = [] # deprecated
61+
optimize_crc32_sse_v4s3x3 = [] # deprecated

build.rs

Lines changed: 0 additions & 230 deletions
This file was deleted.

0 commit comments

Comments
 (0)