Skip to content

Lint SIMD code, fix generic expectation failures#696

Open
clarfonthey wants to merge 1 commit intorust-lang:masterfrom
clarfonthey:lint_simd
Open

Lint SIMD code, fix generic expectation failures#696
clarfonthey wants to merge 1 commit intorust-lang:masterfrom
clarfonthey:lint_simd

Conversation

@clarfonthey
Copy link
Contributor

@clarfonthey clarfonthey commented Feb 27, 2026

Closes #691.

This code ends up using a cursed bash feature (associative arrays) to help people running the lints on their own machines. Since we don't actually need a host compiler to lint the code, we can just download the necessary targets with rustc, with an exception carved out for whichever SIMD implementation the host target supports, to avoid downloading unnecessary targets (e.g. aarch64-unknown-linux-gnu when you're running on a Mac, for example).

Side note: this could be done with POSIX sh by replacing the associative arrays with variable expansion (creating new variables instead), but I couldn't be bothered when pretty much everyone has a copy of bash available.

@clarfonthey
Copy link
Contributor Author

cc @xtqqczze since you were the one who brought this up initially, and I assume you can run the script to verify that it correctly identifies that your target uses NEON.

@xtqqczze
Copy link
Contributor

I run the script, it appeared to run successfully, and I saw "Host target supports NEON" in the output.

FYI: If you wanted, you could specify something like the following in the GitHub Actions file:

      shell: bash
      run: ./ci/tools.sh

@clarfonthey
Copy link
Contributor Author

Eh, I figured I wouldn't bother messing with the CI config too much. The scripts aren't executable which is annoying, but, whatever.

Might change my mind and fix it later, though. :p

@xtqqczze
Copy link
Contributor

I just noticed the only target for miri test in CI is x86_64-unknown-linux-gnu...

@xtqqczze
Copy link
Contributor

We should probably include s390x-unknown-linux-gnu in some check, so as to have at least one big-endian target.

@clarfonthey
Copy link
Contributor Author

Yeah, not sure what the best solution for the miri tests would be, since it depends a lot on CI capacity. We already have quite a lot of jobs running and it's not exactly clear what the project is currently able to support. Ideally, we'd have miri run every test suite that's run normally, but that would be quite a lot of overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: run clippy for each target

2 participants