Bug 1737014 - vdr-epg-daemon fails to build with Python 3.8
Summary: vdr-epg-daemon fails to build with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: vdr-epg-daemon
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: MartinKG
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-08-02 10:04 UTC by Miro Hrončok
Modified: 2019-08-27 08:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-27 06:27:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2019-08-02 10:04:12 UTC
vdr-epg-daemon fails to build with Python 3.8.0b3.

/usr/bin/ld: ./lib/libhorchi.a(python.o): in function `_Py_DECREF':
/usr/include/python3.8/object.h:478: undefined reference to `_Py_Dealloc'
/usr/bin/ld: ./lib/libhorchi.a(python.o): in function `Python::init(char const*)':
/builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:262: undefined reference to `PyErr_Occurred'
/usr/bin/ld: ./lib/libhorchi.a(python.o): in function `Python::execute(cDbTable*, int, char const*)':
/builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:301: undefined reference to `PyObject_CallObject'
/usr/bin/ld: /builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:314: undefined reference to `PyUnicode_AsEncodedString'
/usr/bin/ld: /builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:315: undefined reference to `PyBytes_AsString'
/usr/bin/ld: ./lib/libhorchi.a(python.o): in function `_Py_DECREF':
/usr/include/python3.8/object.h:478: undefined reference to `_Py_Dealloc'
/usr/bin/ld: ./lib/libhorchi.a(python.o): in function `Python::episodeName(_object*, _object*)':
/builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:63: undefined reference to `Py_BuildValue'
/usr/bin/ld: /builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:61: undefined reference to `Py_BuildValue'
/usr/bin/ld: ./lib/libhorchi.a(python.o): in function `Python::episodePart(_object*, _object*)':
/builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:119: undefined reference to `Py_BuildValue'
/usr/bin/ld: /builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:117: undefined reference to `Py_BuildValue'
/usr/bin/ld: ./lib/libhorchi.a(python.o): in function `Python::episodeNumber(_object*, _object*)':
/builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:127: undefined reference to `Py_BuildValue'
/usr/bin/ld: ./lib/libhorchi.a(python.o):/builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.c:125: more undefined references to `Py_BuildValue' follow
/usr/bin/ld: ./lib/libhorchi.a(python.o): in function `Python::PyInitEvent()':
/builddir/build/BUILD/vdr-epg-daemon-1.1.146/lib/python.h:72: undefined reference to `PyModule_Create2'


The build no longer links to libpython, resulting in undefined references to Python API like _Py_Dealloc.
Code that embeds Python (rather than building an extension module) needs to pass `--embed` to any `python3-config --libs` invocation to build with Python 3.8.
More information: 
https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build



For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.8/fedora-rawhide-x86_64/00992313-vdr-epg-daemon/

For all our attempts to build vdr-epg-daemon with Python 3.8, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/vdr-epg-daemon/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.8:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Let us know here if you have any questions.

Comment 1 MartinKG 2019-08-03 16:59:17 UTC
I solved the issue by changing the following lines in the vdr-epg-daemon.spec file.

%if 0%{?fedora} <= 30
BuildRequires:  python2-devel
%else
#BuildRequires:  python3-devel
BuildRequires:  python38
%endif
...
## Add --embed flag for python 3.8 Support in 'Makefile'
%if 0%{?fedora} >= 31
sed -i -e 's|python-config --libs|python3.8-config --libs --embed|' Makefile
sed -i -e 's|python-config|python3.8-config|' Make.config
%endif

Comment 2 Miro Hrončok 2019-08-03 21:05:47 UTC
%else
#BuildRequires:  python3-devel
BuildRequires:  python38
%endif

Don't do this please. The package shall build against python3-devel. We will update python3-devel to 3.8 in Fedora in ~a week.

Comment 3 Ben Cotton 2019-08-13 16:49:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 4 Miro Hrončok 2019-08-14 22:24:33 UTC
The coordinated rebuild of Python 3.8 has started in the `f32-python` side tag.

If you figure out how to rebuild this package, please don't rebuild it in regular rawhide, but use the side tag instead:

    on branch master:
    $ fedpkg build --target=f32-python

To wait for a build to show up in the side tag, do:

    $ koji wait-repo f32-python --build=<nvr>

Where <nvr> is name-version-release of the source package, e.g. python-foo-1.1-2.fc32.

An updated mock config is posted at:
http://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Note that it will take a while before the essential packages are rebuilt, so don't expect all your dependencies to be available right away.

Thanks. Let us know if you need up to date info, or if you have any questions.



PS this message is mass posted to all the bugs that block the PYTHON38 bug. If this is also a Fedora 31 FTBFS bug and you manage to fix it, you can do a f31 build as usual:

    on branch f31:
    $ fedpkg build

Comment 5 Miro Hrončok 2019-08-21 16:35:19 UTC
The f32-python side tag has been merged. In order to rebuild the package, do it in regular rawhide, but please wait until python3-3.8 is tagged:

  $ koji wait-repo f32-build --build python3-3.8.0~b3-3.fc32


If your built already started in f32-python, after it is finished, please tag it to rawhide with:

  $ koji tag-build f32-pending <nvr>

For example:

  $ koji tag-build f32-pending libreoffice-6.3.0.4-3.fc32

Thanks!

(This comment is mass posted to all bugzillas blocking the PYTHON38 tracking bug.)

Comment 6 Miro Hrončok 2019-08-21 17:29:21 UTC
(Python 3.8 has landed in the rawhide buildroot.)

Comment 7 MartinKG 2019-08-27 06:27:22 UTC
successfully built for rawhide.

Comment 8 Miro Hrončok 2019-08-27 08:10:07 UTC
Thank You!


Note You need to log in before you can comment on or make changes to this bug.