Bug 1716522

Summary: pythonqt fails to build with Python 3.8
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: pythonqtAssignee: Igor Raits <igor.raits>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, igor.raits, jkaluza, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/pythonqt/
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 11:25:56 UTC Type: ---
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: 1686977    

Description Miro Hrončok 2019-06-03 14:40:05 UTC
See https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/pythonqt/ for actual logs. This report is automated and not very verbose, but feel free to ping me for help.

Comment 1 Charalampos Stratakis 2019-06-11 13:03:12 UTC
pythonqt uses the qmake build system which I am not very familiar with, however the issue seems to be deriving from that file [0]

[0] This is due to https://sourceforge.net/p/pythonqt/code/HEAD/tree/trunk/build/python.prf

This line:   unix:LIBS += $$system(python$${PYTHON_VERSION}-config --ldflags) will need to be changed to   unix:LIBS += $$system(python$${PYTHON_VERSION}-config --libs --embed) for 3.8

The default python version is changing dynamically according to the SPEC: https://src.fedoraproject.org/rpms/pythonqt/blob/master/f/pythonqt.spec#_47

A conditional ideally should be added there so if the python version is 3.8 or higher then the embed option is added, however I didn't find a good way to do that in the code (unless just hacking the SPEC to apply a patch conditionally).


Igor any ideas?

Comment 2 Victor Stinner 2019-07-08 09:23:16 UTC
build/python.prf should be modified to use the new --embed flag:
https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build

  unix:LIBS += $$system(python$${PYTHON_VERSION}-config --ldflags)
  unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes)

I tried to use bash syntax to run a second if the first one fails:

  unix:LIBS += $$system(python$${PYTHON_VERSION}-config --ldflags --embed || python$${PYTHON_VERSION}-config --ldflags)
  unix:QMAKE_CXXFLAGS += $$system(python$${PYTHON_VERSION}-config --includes --embed || python$${PYTHON_VERSION}-config --includes)

Problem: qmake syntax doesn't accept "||", it has a different meaning.

A bash script could be added to use shell syntax, and build/python.prf would run this script using $$(system).

Comment 3 Miro Hrončok 2019-07-30 14:15:08 UTC
Igor?

Comment 4 Igor Raits 2019-08-06 11:25:56 UTC
Retired.