eepp / vlttng

Create LTTng virtual environments
MIT License
9 stars 7 forks source link

vlttng should check the version of /usr/bin/python when install babeltrace with Python bindings #6

Open frdeso opened 7 years ago

frdeso commented 7 years ago

When creating a env with Babeltrace with Python bindings on a Ubuntu, we need to change the PYTHON variable to point to the Python3 binary. As mentionned in the Babeltrace README:

export PYTHON="python3"                                
export PYTHON_CONFIG="/usr/bin/python3-config"

Without those exports, the configure script uses the /usr/bin/python binary which is python2.7 on Ubuntu. The make install target will then installs the Babeltrace module in the virtenv/usr//lib/python2.7/dist-packages directory rather then in the python3.X directory that we need it to be in.

Here is the env I am using :

vlttng --jobs -p lttng-ust-no-man-pages  \
    -p lttng-tools-no-man-pages \
    -p lttng-tools-master \
    -p lttng-ust-master \
    -p babeltrace-stable-1.4 \
    -p babeltrace-python \
    /root/virtenv

If you are not on Ubuntu you can recreate this issue with this LXD configuration: http://paste.ubuntu.com/23631618/

I am not quite sure how to fix this issue yet but I wanted to create this report to not forget about it.

eepp commented 7 years ago

It is true that Babeltrace needs Python 3 explicitly, and I guess that the project itself should default to python3 and python3-config. vlttng-quick asks you to specify your preferred Python version, eventually adding something like this to the vlttng command line:

-o projects.babeltrace.build-env.PYTHON=python3 -o projects.babeltrace.build-env.PYTHON_CONFIG=python3-config

I don't know how much vlttng should help you here. Should it force those environment variables for the babeltrace project?