Discussion:
Bug#944003: apparmor: Fails to build for python 3.8
(too old to reply)
i***@debian.org
2019-11-02 15:30:02 UTC
Permalink
Source: apparmor
Version: 2.13.3-6
Severity: important
Tags: sid bullseye
X-Debbugs-Cc: Matthias Klose <***@debian.org>

As discovered on #942663, src:apparmor fails to build for python 3.8.

Example failure log¹:

configure:4690: gcc -o conftest -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/python3.8 -I/usr/include/python3.8 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now conftest.c -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -L/usr/lib -lcrypt -lpthread -ldl -lutil -lm -lm >&5
/usr/bin/ld: /tmp/cc08CYZS.o: in function `main':
./libraries/libapparmor.python3.8/conftest.c:18: undefined reference to `Py_Initialize'
collect2: error: ld returned 1 exit status

Those Py_Initialize() calls can be found there:

- upstream Git: libraries/libapparmor/m4/ac_python_devel.m4

- upstream tarball: libraries/libapparmor/configure

Dear upstream & Ubuntu folks, I probably won't be able to investigate
this further in the next weeks, so help would be warmly welcome.

[1] https://launchpadlibrarian.net/447332483/buildlog_ubuntu-focal-amd64.apparmor_2.13.3-5ubuntu2_BUILDING.txt.gz

Cheers,
--
intrigeri
Christian Boltz
2019-11-03 00:00:01 UTC
Permalink
Hello,
Post by i***@debian.org
As discovered on #942663, src:apparmor fails to build for python 3.8.
...
Post by i***@debian.org
- upstream Git: libraries/libapparmor/m4/ac_python_devel.m4
- upstream tarball: libraries/libapparmor/configure
This is part of the libapparmor bindings which are generated with swig,
which I'm not really familiar with. However, there's an interesting
detail on http://www.swig.org/Release/RELEASENOTES for swig 4.0.1 (which
is the latest release):
- Add Python 3.8 support.

Which swig version gets used in the failing builds?
If it's older than 4.0.1, then updating swig is probably the first thing
to do/test ;-)

Note that this is just a wild guess ;-)


Regards,

Christian Boltz
--
seccheck runs here on a host that contains 3 daily backups of 10+ SAP
hosts, and the "Local Monthly Security" Mail size is 562 MB. This mail
size causes an unfriednly, suspicious grin on the face of my mail
admin... [Werner Flamme in opensuse-security]
intrigeri
2019-11-08 08:40:02 UTC
Permalink
Hi Matthias,
Post by i***@debian.org
As discovered on #942663, src:apparmor fails to build for python 3.8.
[…]
./libraries/libapparmor.python3.8/conftest.c:18: undefined reference to `Py_Initialize'
collect2: error: ld returned 1 exit status
I've investigated a bit and I now believe that tis bug is the symptom
of #943657 (which included a fix for a problem that was not described
in details): I've crudely patched debian/{control,rules} locally to
force building against both python 3.7 & 3.8, and I can't reproduce
this bug — the bindings are successfully built for these 2 pythons.
And Christian Boltz confirmed¹ that your patch for #943657 fixed the
build of the libapparmor Python binding for 3.8 in his environment
as well.

I'm nevertheless keeping this bug open: Christian reported² that the
test suite fails with python 3.8, which will make src:apparmor FTBFS
once 3.8 is the default version (we run the upstream test suite only
for the default python). I did not try reproducing this yet.
Matthias, do you have an environment where python 3.8 is the default,
where you could reproduce this?

[1] https://gitlab.com/apparmor/apparmor/merge_requests/430
[2] https://gitlab.com/apparmor/apparmor/issues/62
https://bugs.python.org/issue38688

Cheers,
--
intrigeri
Loading...