Build CPython Linux with clang on CI

Pretty much what the title says. During the weekend I’ve been thinking about building CPython with clang on Linux. This means covering the aarch64-unknown-linux-gnu and x86_64-unknown-linux-gnu in Tier-2.

The rationale behind this is that clang is getting some “more” traction in the project (see JIT and tail-calling interpreter) and it would be nicer to have more coverage with this compiler from the CI point of view.

Now I’m not suggesting to duplicate every job we have in the CI to be run with clang but to find a nice subset in order to have some validation with this compiler as well.

I would suggest for both x86_64 and aarch64:

  • build/test: release/debug
  • build/test (free threading): release/debug
  • JIT: release/debug

We need to balance the coverage with the explosion of the number of CI jobs for every PR.

What do you think?

5 Likes

I’m in favor of just “smearing” some clang across a fraction of the Linux matrix. We don’t necessarily need new runs for it, but it is good to use just for the sake of ensuring compatibility with a different compiler’s interpretation of the C language before issues are uncovered post-merge.

Thanksfully macOS builds guarantee we’ve got clang/llvm coverage for the basics (C language interpretation); which leaves us with clang on Linux specifics as the hole to fill in.

ex: flip one release build on both architectures over to it.

6 Likes