Skip to content

Commit b12ad6d

Browse files
authored
ci: reintroduce x86-64 test for non-SSE environment
The old CI test was removed (#77 (comment)) due to rust-lang/rust#116672 causing a mismatch of data layouts with the custom target (`src/tests/x86_64-soft_float.json`): ```console error: data-layout for target `x86_64-soft_float-10047705440633310713`, `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128`, differs from LLVM target's `x86_64-unknown-none` default layout, `e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128` ``` This PR removes the unused custom target and reintroduces the CI test with the now-available tier 2 target [`x86_64-unknown-none`](https://doc.rust-lang.org/nightly/rustc/platfor m-support/x86_64-unknown-none.html). This makes this test much more robust, since we don't have to update a custom target ourselves and can even use stable Rust now. PR #146
1 parent 21def52 commit b12ad6d

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,29 @@ jobs:
162162
- name: Run tests without any features enabled (core-only)
163163
run: cargo test --verbose --no-default-features
164164

165+
# This job uses a target to build the memchr crate on x86-64 but *without*
166+
# SSE/AVX target features. This is relevant for virtually all OS kernels.
167+
build-for-x86-64-but-non-sse-target:
168+
runs-on: ubuntu-latest
169+
steps:
170+
- name: Checkout repository
171+
uses: actions/checkout@v3
172+
- name: Install Rust
173+
uses: dtolnay/rust-toolchain@master
174+
with:
175+
toolchain: stable
176+
targets: x86_64-unknown-none
177+
- name: Build for x86_64-unknown-none with only 'alloc' enabled
178+
run: cargo build --verbose --no-default-features --features alloc --target x86_64-unknown-none
179+
- name: Run tests for x86_64-unknown-linux-gnu without SSE
180+
run: cargo test --verbose
181+
env:
182+
RUSTFLAGS: -C target-feature=-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float
183+
- name: Run tests for x86_64-unknown-linux-gnu without SSE with only 'alloc' enabled
184+
run: cargo test --verbose --no-default-features --features alloc
185+
env:
186+
RUSTFLAGS: -C target-feature=-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float
187+
165188
# This job runs a stripped down version of CI to test the MSRV. The specific
166189
# reason for doing this is that dev-dependencies tend to evolve more quickly.
167190
# There isn't as tight of a control on them because, well, they're only used

src/tests/x86_64-soft_float.json

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

0 commit comments

Comments
 (0)