Bug 1788092 - gobject-introspection fails to build with Python 3.9
Summary: gobject-introspection fails to build with Python 3.9
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gobject-introspection
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-01-06 12:00 UTC by Miro Hrončok
Modified: 2020-01-17 21:07 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-01-17 16:57:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME/gobject-introspection/issues/325 0 None None None 2020-01-06 12:09:43 UTC
GNOME Gitlab GNOME/gobject-introspection/merge_requests/194 0 None None None 2020-01-06 13:09:13 UTC

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!


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