Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: simplify python3 detection #239

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Conversation

eli-schwartz
Copy link
Collaborator

Don't look up the python module's find_installation() method. This is intended for detecting lots of information needed for compiling and installing python modules including the C-API interface to libpython, as well as site-packages layout information.

It's totally uninvolved with what we are doing, which is executing a script. For this, we just need any python program. Meson is written in python3, so we know in meson.build that we have that available -- which is also why meson guarantees that find_program('python3') always returns a valid python. Even if no python is installed on the system, meson will return the meson.exe runpython shim which runs the script using the copy of python bundled inside the redistributable meson Windows executable.

Don't look up the python module's find_installation() method. This is
intended for detecting lots of information needed for compiling and
installing python modules including the C-API interface to libpython, as
well as site-packages layout information.

It's totally uninvolved with what we are doing, which is executing a
script. For this, we just need any python program. Meson is written in
python3, so we know in meson.build that we have that available -- which
is also why meson guarantees that `find_program('python3')` always
returns a valid python. Even if no python is installed on the system,
meson will return the `meson.exe runpython` shim which runs the script
using the copy of python bundled inside the redistributable meson
Windows executable.
@eli-schwartz eli-schwartz merged commit b201380 into master Mar 7, 2024
9 of 13 checks passed
@eli-schwartz eli-schwartz deleted the es/python-find_program branch March 7, 2024 22:38
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.

1 participant