libyal / libewf

Libewf is a library to access the Expert Witness Compression Format (EWF)
GNU Lesser General Public License v3.0
263 stars 76 forks source link

test_python_module tests failing due to missing PYTHON environment variable #180

Open jengelh opened 1 year ago

jengelh commented 1 year ago
$ ./configure --disable-static --disable-rpath --enable-wide-character-type --enable-python PYTHON_VERSION=3.8
[...]
$ grep ^PYTHON.= Makefile
PYTHON = python3.8

Within libewf-20230212, make itself knows the right Python interpreter. However, this make variable is not exported. As a result, when make check invokes test_python_module.sh, the environment has no PYTHON set, and test_python_modules.sh then defaults to usr /usr/bin/python. In my case, /usr/bin/python is a different Python version (2.7) and refuses to load the just-built pyewf.so.

If I add export PYTHON to tests/Makefile.am, the check job succeeds with no failures.

joachimmetz commented 1 year ago

Why is the PYTHON environment variable not already set in your environment? What shell, operating system and distribution (including versions) are you using?

jengelh commented 1 year ago

Nothing in the openSUSE Tumbleweed x86_64 20230210 distribution sets this environment variable upon login. Nor is it set in a Debian bookmark x32 20230210 chroot upon chroot+bash --login. Even if $PYTHON was generally set, the python version used during the libewf build may be different (e.g. 3.8 vs 3.10).

jengelh commented 1 year ago

The debian-live-11.6.0-amd64-xfce.iso also does not set $PYTHON in the default shell.

joachimmetz commented 1 year ago

Sounds to me like a niche issue with certain default configurations of certain Linux distributions that can be easily worked around. I'll have a look when time permits, but note that this is not a high priority for me.