[libcamera-devel] ninja build breaks out of venv

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Dec 6 11:23:28 CET 2021


On Mon, Dec 06, 2021 at 10:06:15AM +0000, Kieran Bingham wrote:
> Hi Brian,
> 
> Quoting Brian Olson (2021-12-05 13:05:42)
> > $ ninja -C build install
> > ...
> > /usr/bin/python3
> > /blah/blah/blah/libcamera/utils/tracepoints/./gen-tp-header.py ...
> > Traceback (most recent call last):
> >   File "/blah/blah/blah/libcamera/utils/tracepoints/./gen-tp-header.py",
> > line 10, in <module>
> >     import jinja2
> > ModuleNotFoundError: No module named 'jinja2'
> > 
> > Yeah, I don't have it installed at the root level, but I have jinja2
> > installed in the venv I was running ninja from. I don't know how to say
> > "use this python3" other than putting it in the PATH, which it was, but
> > ninja ignored that and went with /usr/bin/python3, and that failed.
> 
> The only thing I can imagine is happening here, is that meson is
> 'breaking' out of the venv when calling install. I believe meson uses
> pkexec or such to elevate to root prividiges when installing. I can only
> assume that this 'escapes' the venv, by not keeping environment
> variables.

It may be possible to work around it by first running `ninja -C build`
before the installation step.

> As this is a meson bug, it's probably something to report over at:
> 
> https://github.com/mesonbuild/meson/issues
> 
> A quick search on venv there brings up:
> 
> - Wrong install_path generated by python module for virtual environment interpreter
>   https://github.com/mesonbuild/meson/issues/7623
> 
> Which might be related, so worth referencing if you create a new issue
> there.
> 
> If you'd prefer us to log that bug, let me know and I'll try to post
> something, but it might be better coming from you as you have the issue
> at hand and can replicate it, while I do not use venvs I'm afraid.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list