Bug 1791688

Summary: gnucash fails to build with Python 3.9: -Werror=declaration-after-statement in _PyVectorcall_Function
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: gnucashAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, dreua, mhroncok, notting, pviktori, vstinner
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: 2020-04-14 08:51:07 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: 1785415    

Description Miro Hrončok 2020-01-16 11:37:25 UTC
gnucash fails to build with Python 3.9.0a2:

In file included from /usr/include/python3.9/abstract.h:843,
                 from /usr/include/python3.9/Python.h:147,
                 from /builddir/build/BUILD/gnucash-3.7/libgnucash/core-utils/swig-core-utils-python.c:149:
/usr/include/python3.9/cpython/abstract.h: In function '_PyVectorcall_Function':
/usr/include/python3.9/cpython/abstract.h:69:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]


Python uses C99 features, gnucash should not -Werror on C90 warnings.

See https://www.python.org/dev/peps/pep-0007/#c-dialect



For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01145277-gnucash/

For all our attempts to build gnucash with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/gnucash/

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.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Victor Stinner 2020-01-16 14:24:58 UTC
> /usr/include/python3.9/cpython/abstract.h:69:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

Python 3.6 uses C99: "Python versions greater than or equal to 3.6 use C89 with several select C99 features"
https://www.python.org/dev/peps/pep-0007/#c-dialect

Does gnucash explicitly asks for ISO C90 standard?

Comment 2 Ben Cotton 2020-02-11 17:34:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 3 Miro Hrončok 2020-03-16 12:41:47 UTC
Bill, could you please have look and report this upstream if needed? Thanks.

Comment 4 Bill Nottingham 2020-04-14 02:09:24 UTC
Sorry about the delay. Is this still a thing? I see the latest builds in the copr succeed.

AFAICT, there's no real reason for this other than a bunch of explicit -Werror and -Wdeclaration-after-statement in the CMake configuration.

Comment 5 Miro Hrončok 2020-04-14 08:51:07 UTC
Thanks, this is now indeed green (successful build).

> AFAICT, there's no real reason for this other than a bunch of explicit -Werror and -Wdeclaration-after-statement in the CMake configuration

Yes.