Failed to compile GLib on macOS 12.4: AttributeError: 'xmlparser' object has no attribute 'CommentHandler'
I'm trying to compile GLib on macOS, with rustpython 0.1.2
(install from source code) as my python runtime and meson 0.63.0
, ninja 1.11.0
. But it fails with the following error:
ninja: Entering directory `build'
[342/1323] Compiling C object glib/tests/autoptr.p/autoptr.c.o
../glib/tests/autoptr.c:448:34: warning: variable 'other' set but not used [-Wunused-but-set-variable]
g_autoptr(GRecMutexLocker) other = NULL;
^
1 warning generated.
[372/1323] Generating gio/gdbus-daemon-generated with a custom command
FAILED: gio/gdbus-daemon-generated.h gio/gdbus-daemon-generated.c
/Users/harrypotter/.local/bin/python3 gio/gdbus-2.0/codegen/gdbus-codegen --interface-prefix org. --output-directory gio --generate-c-code gdbus-daemon-generated --c-namespace _G ../gio/dbus-daemon.xml
Traceback (most recent call last):
File "gio/gdbus-2.0/codegen/gdbus-codegen", line 55, in <module>
sys.exit(codegen_main.codegen_main())
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/codegen_main.py", line 415, in codegen_main
xml_data, h_type_implies_unix_fd=(glib_min_required >= (2, 64))
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/parser.py", line 301, in parse_dbus_xml
parser = DBusXMLParser(xml_data, h_type_implies_unix_fd)
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/parser.py", line 41, in __init__
self._parser.CommentHandler = self.handle_comment
AttributeError: 'xmlparser' object has no attribute 'CommentHandler'
[374/1323] Generating gio/xdp-dbus with a custom command
FAILED: gio/xdp-dbus.h gio/xdp-dbus.c
/Users/harrypotter/.local/bin/python3 gio/gdbus-2.0/codegen/gdbus-codegen --interface-prefix org.freedesktop.portal. --output-directory gio --generate-c-code xdp-dbus --c-namespace GXdp ../gio/org.freedesktop.portal.Documents.xml ../gio/org.freedesktop.portal.OpenURI.xml ../gio/org.freedesktop.portal.ProxyResolver.xml ../gio/org.freedesktop.portal.Trash.xml
Traceback (most recent call last):
File "gio/gdbus-2.0/codegen/gdbus-codegen", line 55, in <module>
sys.exit(codegen_main.codegen_main())
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/codegen_main.py", line 415, in codegen_main
xml_data, h_type_implies_unix_fd=(glib_min_required >= (2, 64))
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/parser.py", line 301, in parse_dbus_xml
parser = DBusXMLParser(xml_data, h_type_implies_unix_fd)
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/parser.py", line 41, in __init__
self._parser.CommentHandler = self.handle_comment
AttributeError: 'xmlparser' object has no attribute 'CommentHandler'
[379/1323] Generating gio/tests/gdbus-object-manager-example/objectmanager-gen with a custom command
FAILED: gio/tests/gdbus-object-manager-example/objectmanager-gen.h gio/tests/gdbus-object-manager-example/objectmanager-gen.c gio/tests/gdbus-object-manager-example/objectmanager-gen-org.gtk.GDBus.Example.ObjectManager.Animal.xml gio/tests/gdbus-object-manager-example/objectmanager-gen-org.gtk.GDBus.Example.ObjectManager.Cat.xml
/Users/harrypotter/.local/bin/python3 gio/gdbus-2.0/codegen/gdbus-codegen --interface-prefix org.gtk.GDBus.Example.ObjectManager. --c-namespace Example --c-generate-object-manager --output-directory gio/tests/gdbus-object-manager-example --generate-c-code objectmanager-gen --generate-docbook objectmanager-gen --symbol-decorator _GLIB_EXTERN --symbol-decorator-define HAVE_CONFIG_H ../gio/tests/gdbus-object-manager-example/gdbus-example-objectmanager.xml
Traceback (most recent call last):
File "gio/gdbus-2.0/codegen/gdbus-codegen", line 55, in <module>
sys.exit(codegen_main.codegen_main())
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/codegen_main.py", line 415, in codegen_main
xml_data, h_type_implies_unix_fd=(glib_min_required >= (2, 64))
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/parser.py", line 301, in parse_dbus_xml
parser = DBusXMLParser(xml_data, h_type_implies_unix_fd)
File "/Users/harrypotter/Workspace/apps/glib/build/gio/gdbus-2.0/codegen/parser.py", line 41, in __init__
self._parser.CommentHandler = self.handle_comment
AttributeError: 'xmlparser' object has no attribute 'CommentHandler'
[381/1323] Generating gio/gioenumtypes_h with a custom command (wrapped by meson to capture output)
ninja: build stopped: subcommand failed.
I also tried with a normal python3.10
runtime but it raises the same error.
For further information, here is versions of all the tools I'm using:
Edited by 27Onion Nebell