envconfig: read CYTHON from the environment and use it if set#12674
envconfig: read CYTHON from the environment and use it if set#12674eli-schwartz merged 1 commit intomesonbuild:masterfrom erikbs:feature/cython-env-var
Conversation
Add support for specifying Cython compiler using the CYTHON environment variable. If not set, proceed with the names hard coded for Cython.
…s note In commit 58c2aeb, an asterisk used to indicate "see note at bottom" was doubled up into an "italicize this paragraph", which didn't contextually make any sense. See: #12674 (comment)
The docs have a formatting typo. The issue is that some environment variables were deprecated in favor of other environment variables. The environment variables listed in that table under "note" should not be used, in favor of exclusively using the variables listed in the second or third column. |
I'd just like to point out for the record that you should not be doing this. The cython program does not care what version of python it internally implements, it still produces transpiled C/C++ files the same. There's no good reason to name it according to the version of python that was used as an underlying framework -- the current two names we check are a filthy hack to work around the fact that Debian is both very common, and very broken -- they renamed cython to cython3 which is incorrect, and it caused a lot of people and projects tremendous pain. |
…s note In commit 58c2aeb, an asterisk used to indicate "see note at bottom" was doubled up into an "italicize this paragraph", which didn't contextually make any sense. See: mesonbuild#12674 (comment)
…s note In commit 58c2aeb, an asterisk used to indicate "see note at bottom" was doubled up into an "italicize this paragraph", which didn't contextually make any sense. See: mesonbuild#12674 (comment)
Add support for specifying Cython compiler using the
CYTHONenvironment variable. If not set, proceed with the names hard coded for Cython. Inspired by issue #1645, which ended up with this solution being implemented forVALAC(bc30ad6).There is already a line in the existing code that reads the
CYTHONvariable, but only in test code.Motivation: MacPorts uses versioned names (e.g.,
cython-3.12) and so does not exposecythonorcython3by default (there is a command to create symlinks tocython/cython3). Its NumPy package is currently built by patching NumPy’s bundled version of Meson to use the solution I am proposing here, and that is also where I got the idea from.Note: I read that these environment variables are deprecated and that environment variables in Meson generally should be “avoided whenever possible”, but as far as I could see there is no new solution in place yet?
Edit:
I should add that
cython-3.12itself is a symlink to thecythonbinary, but it resides in a folder that is not on PATH. This is deliberate, so that different Python versions can live side by side.