Description
Hello,
I am trying to make package build by meson-python installable by pip using pip install --user .
(a complete build script, CI config)
Recent changes in pip broke this and mesonpep517 has the same issue
jeandet/mesonpep517#1 (comment)
mesonpep517 has opened pull request which is fixing this, however merging takes some time and I simply need this so I tried meson-python.
The result is the same:
...
File "/tmp/pip-build-env-j8gehd_x/overlay/local/lib/python3.10/dist-packages/mesonpy/__init__.py", line 477, in _meson
return self._proc('meson', *args)
File "/tmp/pip-build-env-j8gehd_x/overlay/local/lib/python3.10/dist-packages/mesonpy/__init__.py", line 472, in _proc
subprocess.check_call(list(args))
File "/usr/lib/python3.10/subprocess.py", line 364, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python3.10/subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.10/subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1842, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'meson'
There is a full log from build
The problem is that pip does modify the PATH and meson executable will be missing. Note that this happens only if meson is not installed in the advance.
You can fix it by executing meson as a module function and not as an executable, as you are currently doing https://github.com/FFY00/meson-python/blob/main/mesonpy/__init__.py#L477 . (see changes in mesonpep517 pull request). (Note that the user typically does not have meson installed in advance.)
Ubuntu 22.04 LTS
- python3.10
- pip-22.0.2
- meson-0.63.0
- ninja-1.10.1
- meson_python-0.7.0