On 1/18/2020 9:21 PM, Kevin Buckley via lfs-dev wrote:
On the back of trying to build Xen 4.12.2 on an LFS system, I've hit
an issue whereby the Xen M4 python_devel module fails but, even when I
fix that, Python3 seems to report the "wrong" info.
<snip>
ac_python_version=`$PYTHON -c 'import distutils.sysconfig; \
print(distutils.sysconfig.get_config_var("VERSION"))'`
This is Python2 syntax. The short answer is to use Python2.
The longer answer is that you probably have a ton of work to do.
Also, while it doesn't matter in this case, distutils is (very) slowly
on the way out. If not already dependent on distutils, using python
itself is probably better in the long run for testing the installed
python version, something like:
$PYTHON -c 'import sys; print(".".join(map(str, sys.version_info[:2])))'
If, for some reason, you need to separate the values, you can also use
sys.version_info.major and sys.version_info.minor.
Or, maybe better, sysconfig.get_config_var('VERSION') - but that can't
work with 'python -c'.
>Installed Library: libpython3.7m.so and libpython3.so>Installed
Directories: /usr/include/python3.7m,
>/usr/lib/python3 and /usr/share/doc/python-3.7.4
>
>but, on the LFS system, we have
>
>>ls -o /usr/lib/libpython3.*
>
>lrwxrwxrwx 1 python3 20 Nov 17 18:20 /usr/lib/libpython3.7m.so ->
libpython 3.7m.so.1.0
>-rwxr-xr-x 1 python3 3265256 Nov 17 20:10 /usr/lib/libpython3.7m.so.1.0
>-rwxr-xr-x 1 python3 13984 Nov 17 20:10 /usr/lib/libpython3.so
Unless I'm missing something, those agree with the text in the book.
>So why, if the distutils module returns the version as "3.7" do the
Python installation
>have the extra "m" on the names of its shared libraries ?
Nothing is "wrong" here. You do have /usr/lib/libpython3.so. See
https://legacy.python.org/dev/peps/pep-3149/for rationale, and more
importantly, how to fix it in distutils. That said, as I mentioned
before, while I haven't looked at the Xen source (so I don't know for
certain), you've probably got a whole heck of a lot more work to do to
make it play nicely with Python3.
--DJ
--
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page