python / cpython

The Python programming language
https://www.python.org/
Other
61.21k stars 29.53k forks source link

Could not build CPython locally after #118307 #119736

Open Zheaoli opened 1 month ago

Zheaoli commented 1 month ago

Bug report

Bug description:

After #118307 , the developer needs to install LLVM 18 if they want to build CPython locally. But LLVM <= 17 is the most commonly used version in a lot of distributions of Linux( Like Ubuntu, Arch, Fedora)

I propose to add new environment variables like PYTHON_JIT_LLVM_VERSION to allow people override the default LLVM version requirement locally

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Zheaoli commented 1 month ago

cc @brandtbucher

ned-deily commented 1 month ago

Just to clarify, LLVM (other than just clang) is only required if you are building 3.13+ with the experimental just-in-time compiler feature enabled (--enable-experimental-jit). And, as documented in the JIT README in the cpython repo, "LLVM version 18 is required". If you are not experimenting with the JIT feature, compiler build requirements for 3.13+ have not changed, i.e. LLVM is not required.

brandtbucher commented 1 month ago

Yep. @Zheaoli, do you mind clarifying your issue further? Users won't need an LLVM install ever, and people building the interpreter only need LLVM to build the optional, experimental JIT.

It's not incredibly difficult to allow more versions (the current code actually works fine if you change a single 18 constant to a 17 or 19 in the build script), but for CI and support reasons I would like to avoid allowing more versions "just because we can". In fact, we are probably going to be targeting LLVM 19 for the 3.14 release once that's out, since it has some additional features that we'd like to use.

If you still believe that the current LLVM requirement is a burden, then maybe we can move the discussion to GH-115869.