Bug 1728273

Summary: dxf2gcode fails to build on Fedora 31 (rawhide)
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-qt5Assignee: Rex Dieter <rdieter>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwrobel, igor.raits, kde-sig, rdieter, than
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-31 13:38:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1700317, 1686977, 1732841    
Attachments:
Description Flags
dxf2gcode rebuild in rawhide using python 3.8.0b2 none

Description Miro Hrončok 2019-07-09 13:56:10 UTC
dxf2gcode fails to build with Python 3.8.0b2:

+ python3 ./make_py_uic.py 5
Fatal Python error: PyQt5.QtCore: Unable to embed qt.conf
Traceback (most recent call last):
  File "./make_py_uic.py", line 96, in <module>
    subprocess.check_call(cmd1, shell=True)  # shell=True argument needed on Linux
  File "/usr/lib64/python3.8/subprocess.py", line 348, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'pyuic5 /tmp/tmp37q4kafn -o dxf2gcode_ui5.py' died with <Signals.SIGABRT: 6>.
error: Bad exit status from /var/tmp/rpm-tmp.iN94Tt (%build)
Using platform tools "pyuic5" and "pyrcc5"

Or in rawhide:

+ python3 ./make_py_uic.py 5
BUILDSTDERR: Fatal Python error: PyQt5.QtCore: Unable to embed qt.conf
BUILDSTDERR: Traceback (most recent call last):
BUILDSTDERR:   File "./make_py_uic.py", line 96, in <module>
BUILDSTDERR:     subprocess.check_call(cmd1, shell=True)  # shell=True argument needed on Linux
BUILDSTDERR:   File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
BUILDSTDERR:     raise CalledProcessError(retcode, cmd)
BUILDSTDERR: subprocess.CalledProcessError: Command 'pyuic5 /tmp/tmp5z9y6ktk -o dxf2gcode_ui5.py' died with <Signals.SIGABRT: 6>.
BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.qhDY4j (%build)
BUILDSTDERR:     Bad exit status from /var/tmp/rpm-tmp.qhDY4j (%build)

This is not Python 3.8 specific, but blocks the Python 3.8 rebuild.

Rawhide scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=36152021

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

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

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 Damian Wrobel 2019-07-26 17:06:19 UTC
Created attachment 1593770 [details]
dxf2gcode rebuild in rawhide using python 3.8.0b2

I didn't have any problems rebuilding dxf2gcode using python 3.8.0b2.

[sw@dell source]$ python3 --version
Python 3.8.0b2
[sw@dell source]$ rpm -qv python3
python3-3.8.0~b2-1.fc31.x86_64
[sw@dell source]$ rpm -qv python3-qt5
python3-qt5-5.12.3-2.fc31.x86_64
[sw@dell source]$ rpmbuild --rebuild https://kojipkgs.fedoraproject.org//packages/dxf2gcode/20190103/3.fc30/src/dxf2gcode-20190103-3.fc30.src.rpm  && echo OK
OK
[sw@dell source]$

Please let me know if it works for you.

Comment 2 Damian Wrobel 2019-07-26 20:18:21 UTC
I think that I can reproduce the problem by uninstalling manually python3-qt5 package as I don't see it being installed here[1], however based on [2] it should be installed.

------------------------------------------------------------------------
[sw@dell source]$ head -n2 /usr/bin/pyuic5
#!/usr/bin/sh
/usr/bin/python3 -Ic "import PyQt5.uic.pyuic" &> /dev/null
[sw@dell source]$ /usr/bin/python3 -Ic "import PyQt5.uic.pyuic"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt5.uic'
[sw@dell source]$ sudo dnf install python3-qt5 -y
Last metadata expiration check: 0:16:10 ago on Fri 26 Jul 2019 07:59:04 PM UTC.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                          Architecture                                Version                                            Repository                                                   Size
===================================================================================================================================================================================================================
Installing:
 python3-qt5                                      x86_64                                      5.12.3-2.fc31                                      group_python-python3.8                                      1.4 M

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

/usr/lib/python3.8/site-packages/dnf/package.py:57: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  return super(Package, self).chksum

Total download size: 1.4 M
Installed size: 8.5 M
Downloading Packages:
python3-qt5-5.12.3-2.fc31.x86_64.rpm                                                                                                                                               631 kB/s | 1.4 MB     00:02    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              629 kB/s | 1.4 MB     00:02     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                           1/1 
  Installing       : python3-qt5-5.12.3-2.fc31.x86_64                                                                                                                                                          1/1 
  Running scriptlet: python3-qt5-5.12.3-2.fc31.x86_64                                                                                                                                                          1/1 
  Verifying        : python3-qt5-5.12.3-2.fc31.x86_64                                                                                                                                                          1/1 

Installed:
  python3-qt5-5.12.3-2.fc31.x86_64                                                                                                                                                                                 

Complete!
[sw@dell source]$ /usr/bin/python3 -Ic "import PyQt5.uic.pyuic"
[sw@dell source]$ echo $?
0
[sw@dell source]$ ./make
make_py_uic.py  make-srpms.sh   make_tr.py      
[sw@dell source]$ ./make_py_uic.py 
Using platform tools "pyuic5" and "pyrcc5"

pyuic5 /tmp/tmp5l90g7zz -o dxf2gcode_ui5.py
pyrcc5 -o dxf2gcode_images5_rc.py dxf2gcode_images.qrc
Please consider to not commit any auto-generated files.

READY
[sw@dell source]$ echo $?
0
[sw@dell source]$ 
------------------------------------------------------------------------

Excerpt from [1]: 

DEBUG util.py:587:  Installing:
DEBUG util.py:587:   python2-qt5                   x86_645.12.3-2.fc31                   copr_base                                                     1.3 M
DEBUG util.py:587:   python3-configobj             noarch5.0.6-15.fc31                   copr_base                                                     62 k
DEBUG util.py:587:   python3-devel                 x86_643.8.0~b2-1.fc31                 copr_base                                                     214 k
DEBUG util.py:587:   python3-pyopengl              x86_643.1.1a1-15.fc31                 copr_base                                                     2.3 M
DEBUG util.py:587:   python3-qt5-base              x86_645.12.3-2.fc31                   copr_base                                                     3.0 M

Instead of python3-qt5, python2-qt5 is installed and that's seem to be the problem, which probably would need a further investigation.


[1] https://copr-be.cloud.fedoraproject.org/results/@python/python3.8/fedora-rawhide-x86_64/00965355-dxf2gcode/root.log.gz
[2] https://src.fedoraproject.org/rpms/dxf2gcode/blob/master/f/dxf2gcode.spec#_26

Comment 3 Miro Hrončok 2019-07-26 22:34:08 UTC
> Instead of python3-qt5, python2-qt5 is installed and that's seem to be the problem, which probably would need a further investigation.

That's caused by this:

$ repoquery --repo=rawhide --whatprovides '/usr/bin/pyuic5'
python2-qt5-0:5.12.3-2.fc31.i686
python2-qt5-0:5.12.3-2.fc31.x86_64
python3-qt5-0:5.12.3-2.fc31.i686
python3-qt5-0:5.12.3-2.fc31.x86_64

So the file is provided by both packages.

Installing /usr/bin/pyuic5 brings in python2-qt5 (alphabetically sooner) and the file is:

$ cat /usr/bin/pyuic5
#!/usr/bin/sh
/usr/bin/python3 -Ic "import PyQt5.uic.pyuic" &> /dev/null
if [ $? -eq 0 ]; then
  exec /usr/bin/python3 -Im PyQt5.uic.pyuic ${1+"$@"}
else
  exec /usr/bin/python2 -c "import sys; del sys.path[0]; import PyQt5.uic.pyuic; PyQt5.uic.pyuic.main()" ${1+"$@"}
fi


You should probably stick with buildrequiring python3-qt5 explicitly. CCing Rex for thoughts.

Comment 4 Rex Dieter 2019-07-26 22:52:57 UTC
I'll echo what Miro said, you should explictly add BuildRequires: tag on one of python2-qt5 or python3-qt5 to ensure it's built using the environment you intend.

The script contents above is mostly a hack to make it work with either one (python3 being preferred if available).  (Suggestions welcome there if anyone has better ideas on how to handle that).

Comment 5 Miro Hrončok 2019-07-26 23:00:25 UTC
Adding "Suggests: pythonX-qt5" to pythonX-qt5-base might make this case:

BuildRequires:  /usr/bin/pyuic5
BuildRequires:  python3dist(pyqt5)

resolve more appropriately (untested assumption).

Comment 6 Damian Wrobel 2019-07-29 09:57:18 UTC
IMHO the change [3] introduced by Igor:

 -BuildRequires:  python3-qt5
 +BuildRequires:  python3dist(pyqt5)

was a good move and I would prefer not to revert it. Mostly because "BuildRequires:  python3dist(pyqt5)" precisely specifies in which environment we're interested in (python3 not python2). So despite of issues with 'pyuic5' having in spec file:

 BuildRequires:  python3dist(pyqt5)

should pull in: python3-qt5 as well (not only python3-qt5-base - assuming we would like to be aligned with what 'pip install PyQt5' would have installed). Please have a look at my today's attempt to rebuilt spec file from master for: {f29,f30,rawhide} [4] - in each case I don't see 'python3-qt5' to be installed.

[3] https://src.fedoraproject.org/rpms/dxf2gcode/c/b8cb12fc45c3e0e89ba38c9627d39c3fcc815c9f?branch=master
[4] https://copr.fedorainfracloud.org/coprs/dwrobel/dxf2gcode/build/987741/

Comment 7 Rex Dieter 2019-07-29 13:26:18 UTC
$ rpm -q --whatprovides 'python3dist(pyqt5)'
python3-qt5-base-5.12.2-5.fc30.x86_64

Unfortunately not (currently).

Comment 8 Rex Dieter 2019-07-29 13:30:57 UTC
Another alternative is we could consider:
pyuic5 (and friends) from python?-qt5 to python?-qt5-base

I'll look into that in the meantime.

Comment 9 Damian Wrobel 2019-07-29 15:19:57 UTC
(In reply to Rex Dieter from comment #7)
> $ rpm -q --whatprovides 'python3dist(pyqt5)'
> python3-qt5-base-5.12.2-5.fc30.x86_64
> 
> Unfortunately not (currently).

Isn't that somehow related to bug 1730635? If that's the case, it should also very likely solve dxf2gcode problem.


(In reply to Rex Dieter from comment #8)
> Another alternative is we could consider:
> pyuic5 (and friends) from python?-qt5 to python?-qt5-base
> 
From dxf2gcode standpoint it would be transparent as it explicitly requires [5]: BuildRequires:  /usr/bin/pyuic5

> I'll look into that in the meantime.

Thank you.

[5] https://src.fedoraproject.org/rpms/dxf2gcode/blob/master/f/dxf2gcode.spec#_23

Comment 10 Rex Dieter 2019-07-30 17:49:25 UTC
We'll see if this helps,

%changelog
* Tue Jul 30 2019 Rex Dieter <rdieter> - 5.12.3-5
- move pyuic and friends to -base (#1728273)
- move Provides: PyQt5 to python3-qt5 (#1730635)

Comment 11 Damian Wrobel 2019-07-31 08:08:30 UTC
I did a scratch build [6] and it succeed.

There is no single python2 package being installed:
$ curl -s https://kojipkgs.fedoraproject.org//work/tasks/574/36700574/root.log | grep python2
$

Although, python3-qt5 is still not installed (only python3-qt5-base):
$ curl -s https://kojipkgs.fedoraproject.org//work/tasks/574/36700574/root.log | grep python3-qt5
DEBUG util.py:587:   python3-qt5-base          x86_64 5.12.3-5.fc31                     build 3.2 M
DEBUG util.py:587:    python3-qt5-base-5.12.3-5.fc31.x86_64                                         

(In reply to Rex Dieter from comment #10)
> - move pyuic and friends to -base (#1728273)
The build failure itself seems to be fixed.

> - move Provides: PyQt5 to python3-qt5 (#1730635)
python3dist(pyqt5) - still does not pull in python3-qt5


[6] https://koji.fedoraproject.org/koji/taskinfo?taskID=36700574

Comment 12 Raphael Groner 2019-07-31 09:32:04 UTC
Sorry, I accidently dropped Rex instead of me not interested...

Comment 13 Rex Dieter 2019-07-31 13:38:38 UTC
Not implicitly pulling in python3-qt5 is no longer a problem, since the needed file content was moved to -base.  I'll consider this issue closed (from python-qt5 point of view).