Bug 1788092

Summary: gobject-introspection fails to build with Python 3.9
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: gobject-introspectionAssignee: Kalev Lember <klember>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, dcbw, fmuellner, klember, mhroncok, otaylor, walters, yaneti
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-01-17 16:57:06 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-06 12:00:47 UTC
gobject-introspection fails to build with Python 3.9.0a2.

Traceback (most recent call last):
  File "/builddir/build/BUILD/gobject-introspection-1.62.0/x86_64-redhat-linux-gnu/tools/g-ir-scanner", line 100, in <module>
    sys.exit(scanner_main(sys.argv))
  File "/builddir/build/BUILD/gobject-introspection-1.62.0/x86_64-redhat-linux-gnu/giscanner/scannermain.py", line 615, in scanner_main
    write_output(data, options)
  File "/builddir/build/BUILD/gobject-introspection-1.62.0/x86_64-redhat-linux-gnu/giscanner/scannermain.py", line 469, in write_output
    passthrough_gir(main_f_name, temp_f)
  File "/builddir/build/BUILD/gobject-introspection-1.62.0/x86_64-redhat-linux-gnu/giscanner/scannermain.py", line 260, in passthrough_gir
    parser.parse(path)
  File "/builddir/build/BUILD/gobject-introspection-1.62.0/x86_64-redhat-linux-gnu/giscanner/girparser.py", line 60, in parse
    self.parse_tree(tree)
  File "/builddir/build/BUILD/gobject-introspection-1.62.0/x86_64-redhat-linux-gnu/giscanner/girparser.py", line 69, in parse_tree
    self._parse_api(tree.getroot())
  File "/builddir/build/BUILD/gobject-introspection-1.62.0/x86_64-redhat-linux-gnu/giscanner/girparser.py", line 106, in _parse_api
    for node in root.getchildren():
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'


Indeed, getchildren() was deprecated since Python 3.2: Use "for node in root" instead.



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

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

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, but the initial bootstrapping has already started.
A build failure this early in the bootstrap sequence blocks us very much.

Comment 1 Miro Hrončok 2020-01-06 12:56:53 UTC
Adding this to prep makes the package build:

# Python 3.9 compatibility
# https://gitlab.gnome.org/GNOME/gobject-introspection/issues/325
# https://bugzilla.redhat.com/show_bug.cgi?id=1788092
sed -i 's/.getchildren()//' giscanner/girparser.py

Comment 2 Miro Hrončok 2020-01-06 13:09:13 UTC
Proposed the fix upstream.

Comment 3 Miro Hrončok 2020-01-17 16:57:06 UTC
The upstream fix is included in Fedora now, thanks Kalev.

Comment 4 Kalev Lember 2020-01-17 21:07:23 UTC
Great :) Thanks, Miro!