Fails to generate GObject-Introspection information on MSYS2 MinGW
I was trying to build libdex under MSYS2's UCRT64 environment with latest dependencies. If I turn off introspection (-Dintrospection=disabled
) then the build goes fine, but if I wanted to generation introspection information, it gives the following error:
[66/68] Generating src/Dex-1.gir with a custom command (wrapped by meson to set PATH, to set env)
FAILED: src/Dex-1.gir
"D:/Software/msys2/ucrt64/bin/meson" "--internal" "exe" "--unpickle" "D:/projects/build/libdex/build/meson-private/meson_exe_g-ir-scanner.exe_9d047c718a50c0f95db0a576f2cd25c00f27b506.dat"
while executing ['D:/Software/msys2/ucrt64/bin/g-ir-scanner.exe', '--quiet', '--no-libtool', '--namespace=Dex', '--nsversion=1', '--warn-all', '--output', 'src/Dex-1.gir', '--c-include=libdex.h', '-DDEX_COMPILATION', '-ID:/projects/build/libdex/src', '-ID:/projects/build/libdex/build/src', '-ID:/projects/build/libdex/src/.', '-ID:/projects/build/libdex/build/src/.', '--filelist=D:/projects/build/libdex/build/src/libdex-1-1.dll.p/Dex_1_gir_filelist', '--include=Gio-2.0', '--symbol-prefix=dex', '--identifier-prefix=Dex', '--cflags-begin', '-ID:/projects/build/libdex/build', '-ID:/projects/build/libdex/src/.', '-ID:/projects/build/libdex/build/src/.', '-ID:/Software/msys2/ucrt64/include', '-ID:/Software/msys2/ucrt64/include/glib-2.0', '-ID:/Software/msys2/ucrt64/lib/glib-2.0/include', '-ID:/Software/msys2/ucrt64/include/gobject-introspection-1.0', '--cflags-end', '--add-include-path=D:/Software/msys2/ucrt64/share/gir-1.0', '-LD:/projects/build/libdex/build/src', '--library', 'dex-1', '--extra-library=atomic', '-LD:/Software/msys2/ucrt64/lib', '--extra-library=gio-2.0', '--extra-library=gobject-2.0', '--extra-library=glib-2.0', '--extra-library=intl', '--extra-library=girepository-1.0', '--sources-top-dirs', 'D:/projects/build/libdex/', '--sources-top-dirs', 'D:/projects/build/libdex/build/']
--- stdout ---
--- stderr ---
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gutils.h:378: syntax error, unexpected INTEGER, expecting identifier in ' if ((__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 0); if (nth_bit < -1) G_PASTE (_g_boolean_var_, 0) = 1; else G_PASTE (_g_boolean_var_, 0) = 0; G_PASTE (_g_boolean_var_, 0); }), 0)))' at '0'
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gutils.h:393: syntax error, unexpected INTEGER, expecting identifier in ' if (nth_bit < 0 || (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 1); if (nth_bit > 4 * 8) G_PASTE (_g_boolean_var_, 1) = 1; else G_PASTE (_g_boolean_var_, 1) = 0; G_PASTE (_g_boolean_var_, 1); }), 0)))' at '1'
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gutils.h:408: syntax error, unexpected INTEGER, expecting identifier in ' return (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 2); if (number) G_PASTE (_g_boolean_var_, 2) = 1; else G_PASTE (_g_boolean_var_, 2) = 0; G_PASTE (_g_boolean_var_, 2); }), 1)) ?' at '2'
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gstring.h:196: syntax error, unexpected INTEGER, expecting identifier in ' if ((__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 3); if (gstring != ' at '3'
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gstring.h:218: syntax error, unexpected INTEGER, expecting identifier in ' if (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 4); if (gstring == ' at '4'
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gstring.h:221: syntax error, unexpected INTEGER, expecting identifier in ' if (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 5); if (val == ' at '5'
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gstring.h:229: syntax error, unexpected INTEGER, expecting identifier in ' if ((__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 6); if (gstring->len + len_unsigned < gstring->allocated_len) G_PASTE (_g_boolean_var_, 6) = 1; else G_PASTE (_g_boolean_var_, 6) = 0; G_PASTE (_g_boolean_var_, 6); }), 1)))' at '6'
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gstring.h:232: syntax error, unexpected IF in ' if ((__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 7); if (val + len_unsigned <= end || val > end + len_unsigned) G_PASTE (_g_boolean_var_, 7) = 1; else G_PASTE (_g_boolean_var_, 7) = 0; G_PASTE (_g_boolean_var_, 7); }), 1)))' at 'if'
D:\Software\msys2\ucrt64\include\glib-2.0\glib\gstring.h:232: syntax error, unexpected INTEGER, expecting identifier in ' if ((__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 7); if (val + len_unsigned <= end || val > end + len_unsigned) G_PASTE (_g_boolean_var_, 7) = 1; else G_PASTE (_g_boolean_var_, 7) = 0; G_PASTE (_g_boolean_var_, 7); }), 1)))' at '7'
D:\Software\msys2\ucrt64\include\glib-2.0\gobject\gobject.h:819: syntax error, unexpected INTEGER, expecting identifier in ' do { if (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 8); if ((((g_type_check_instance_is_fundamentally_a ((GTypeInstance*) ((weak_pointer)), (((GType) ((20) << (2))))))))) G_PASTE (_g_boolean_var_, 8) = 1; else G_PASTE (_g_boolean_var_, 8) = 0; G_PASTE (_g_boolean_var_, 8); }), 1)) ; else g_assertion_message (((gchar*) 0), "D:/Software/msys2/ucrt64/include/glib-2.0/gobject/gobject.h", 819, ((const char*) (__func__)), "'" "G_IS_OBJECT (weak_pointer)" "' should be TRUE"); } while (0);' at '8'
D:\Software\msys2\ucrt64\include\glib-2.0\gobject\gobject.h:819: syntax error, unexpected ')', expecting identifier or '(' in ' do { if (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 8); if ((((g_type_check_instance_is_fundamentally_a ((GTypeInstance*) ((weak_pointer)), (((GType) ((20) << (2))))))))) G_PASTE (_g_boolean_var_, 8) = 1; else G_PASTE (_g_boolean_var_, 8) = 0; G_PASTE (_g_boolean_var_, 8); }), 1)) ; else g_assertion_message (((gchar*) 0), "D:/Software/msys2/ucrt64/include/glib-2.0/gobject/gobject.h", 819, ((const char*) (__func__)), "'" "G_IS_OBJECT (weak_pointer)" "' should be TRUE"); } while (0);' at ')'
D:\Software\msys2\ucrt64\include\glib-2.0\gobject\gobject.h:822: syntax error, unexpected INTEGER, expecting identifier in ' do { if (__builtin_expect (__extension__ ({ int G_PASTE (_g_boolean_var_, 9); if ((weak_pointer) == ' at '9'
D:\Software\msys2\ucrt64\include\glib-2.0\gobject\gobject.h:822: syntax error, unexpected ')', expecting identifier or '(' in '# 822 "D:/Software/msys2/ucrt64/include/glib-2.0/gobject/gobject.h"' at ')'
Traceback (most recent call last):
File "D:\Software\msys2\ucrt64\bin\g-ir-scanner-script.py", line 100, in <module>
sys.exit(scanner_main(sys.argv))
File "D:/Software/msys2/ucrt64/lib/gobject-introspection/giscanner/scannermain.py", line 610, in scanner_main
shlibs = create_binary(transformer, options, args)
File "D:/Software/msys2/ucrt64/lib/gobject-introspection/giscanner/scannermain.py", line 430, in create_binary
binary = compile_introspection_binary(options,
File "D:/Software/msys2/ucrt64/lib/gobject-introspection/giscanner/dumper.py", line 294, in compile_introspection_binary
return dc.run()
File "D:/Software/msys2/ucrt64/lib/gobject-introspection/giscanner/dumper.py", line 170, in run
self._link(bin_path, introspection_obj)
File "D:/Software/msys2/ucrt64/lib/gobject-introspection/giscanner/dumper.py", line 282, in _link
subprocess.check_call(args)
File "D:/Software/msys2/ucrt64/lib/python3.10/subprocess.py", line 364, in check_call
retcode = call(*popenargs, **kwargs)
File "D:/Software/msys2/ucrt64/lib/python3.10/subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "D:/Software/msys2/ucrt64/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:/Software/msys2/ucrt64/lib/python3.10/subprocess.py", line 1380, in _execute_child
args = list2cmdline(args)
File "D:/Software/msys2/ucrt64/lib/python3.10/subprocess.py", line 563, in list2cmdline
for arg in map(os.fsdecode, seq):
File "D:/Software/msys2/ucrt64/lib/python3.10/os.py", line 823, in fsdecode
filename = fspath(filename) # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not NoneType