FAILED: json-glib/Json-1.0.gir

Hello,

I am trying to build from source code “json-glib-1.6.2” (because it is required for “gegl” that is required for “babl” that is required for “gimp”).

However, here is what happens when I try:

$ ninja -C _build
ninja: Entering directory `_build'
[38/69] Generating Json-1.0.gir with a custom command
FAILED: json-glib/Json-1.0.gir 
/usr/bin/g-ir-scanner --no-libtool --namespace=Json --nsversion=1.0 --warn-all --output json-glib/Json-1.0.gir --c-include=json-glib/json-glib.h --quiet --c-include=json-glib/json-glib.h -DJSON_COMPILATION -I/tmp/build/gimp/json-glib-1.6.2/json-glib -I/tmp/build/gimp/json-glib-1.6.2/_build/json-glib -I/tmp/build/gimp/json-glib-1.6.2/_build/. -I/tmp/build/gimp/json-glib-1.6.2/. --filelist=/tmp/build/gimp/json-glib-1.6.2/_build/json-glib/libjson-glib-1.0.so.0.600.2.p/Json_1.0_gir_filelist --include=GObject-2.0 --include=Gio-2.0 --symbol-prefix=json --identifier-prefix=Json --pkg-export=json-glib-1.0 --cflags-begin -I/tmp/build/gimp/json-glib-1.6.2/_build/. -I/tmp/build/gimp/json-glib-1.6.2/. -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gobject-introspection-1.0 --cflags-end --add-include-path=/usr/share/gir-1.0 -L./json-glib --library json-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgirepository-1.0
/tmp/build/gimp/json-glib-1.6.2/_build/tmp-introspectLrmcCj/Json-1.0: error while loading shared libraries: libjson-glib-1.0.so.0: cannot open shared object file: No such file or directory
Command '['/tmp/build/gimp/json-glib-1.6.2/_build/tmp-introspectLrmcCj/Json-1.0', '--introspect-dump=/tmp/build/gimp/json-glib-1.6.2/_build/tmp-introspectLrmcCj/functions.txt,/tmp/build/gimp/json-glib-1.6.2/_build/tmp-introspectLrmcCj/dump.xml']' returned non-zero exit status 127
[51/69] Compiling C object json-glib/tests/serialize-simple.p/serialize-simple.c.o
ninja: build stopped: subcommand failed.

How to fix that please?

Remark: This issue has been previously sent to https://gitlab.gnome.org/GNOME/json-glib/-/issues/62 but it was the wrong place.

Thank you.
Best regards.

Are you able to access the file/tmp/build/gimp/json-glib-1.6.2/_build/json-glib/libjson-glib-1.0.so, and can you verify that it’s built correctly, uses the right architecture, and is not corrupted?

The file is a symbolic link:
$ ls -l _build/json-glib/libjson-glib-1.0.so
lrwxrwxrwx 1 yugiohjcj yugiohjcj 21 Jul 8 07:30 _build/json-glib/libjson-glib-1.0.so → libjson-glib-1.0.so.0
$ ls -l _build/json-glib/libjson-glib-1.0.so.0
lrwxrwxrwx 1 yugiohjcj yugiohjcj 27 Jul 8 07:30 _build/json-glib/libjson-glib-1.0.so.0 → libjson-glib-1.0.so.0.600.2
$ ls -l _build/json-glib/libjson-glib-1.0.so.0.600.2
-rwxr-xr-x 1 yugiohjcj yugiohjcj 854896 Jul 8 07:31 _build/json-glib/libjson-glib-1.0.so.0.600.2

But the pointed file is a file for the x64 architecture so it is good for my machine:
$ file _build/json-glib/libjson-glib-1.0.so.0.600.2
_build/json-glib/libjson-glib-1.0.so.0.600.2: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
$ uname -a
Linux desktop 5.2.8-desktop #1 SMP Wed Aug 14 16:58:00 CEST 2019 x86_64 Intel(R) Core™ i5-10600K CPU @ 4.10GHz GenuineIntel GNU/Linux

Not sure how to check that it is built correctly and not corrupted but I can do this:
$ du -h _build/json-glib/libjson-glib-1.0.so.0.600.2
836K _build/json-glib/libjson-glib-1.0.so.0.600.2
$ ldd _build/json-glib/libjson-glib-1.0.so.0.600.2
linux-vdso.so.1 (0x00007fffbc78b000)
libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007f30df049000)
libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007f30dedf0000)
libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007f30dead4000)
libc.so.6 => /lib64/libc.so.6 (0x00007f30de70b000)
libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007f30de508000)
libz.so.1 => /lib64/libz.so.1 (0x00007f30de2f3000)
libmount.so.1 => /lib64/libmount.so.1 (0x00007f30de0ad000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f30dde92000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f30ddc75000)
libffi.so.6 => /usr/lib64/libffi.so.6 (0x00007f30dda6d000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f30dd7fb000)
/lib64/ld-linux-x86-64.so.2 (0x00007f30df628000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f30dd5f7000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00007f30dd3b7000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f30dd1b3000)
librt.so.1 => /lib64/librt.so.1 (0x00007f30dcfab000)

Here is a more detailed version of how I am compiling:
$ tar xf json-glib-1.6.2.tar.xz
$ cd json-glib-1.6.2
$ meson _build .
The Meson build system
Version: 0.58.1
Source dir: /tmp/build/gimp/json-glib-1.6.2
Build dir: /tmp/build/gimp/json-glib-1.6.2/_build
Build type: native build
Project name: json-glib
Project version: 1.6.2
C compiler for the host machine: ccache cc (gcc 8.2.0 “cc (GCC) 8.2.0”)
C linker for the host machine: cc ld.bfd 2.26.20160125
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Run-time dependency gio-2.0 found: YES 2.60.0
Has header “unistd.h” : YES
Compiler for C supports arguments -Wcast-align: YES
Compiler for C supports arguments -Wlogical-op: YES
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wmissing-format-attribute: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wmissing-noreturn: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Wunused: YES
Compiler for C supports arguments -Wno-discarded-qualifiers: YES
Compiler for C supports arguments -Wno-int-conversion: YES
Compiler for C supports arguments -fno-strict-aliasing: YES
Compiler for C supports arguments -Wno-uninitialized: YES
Compiler for C supports arguments -Werror=address: YES
Compiler for C supports arguments -Werror=array-bounds: YES
Compiler for C supports arguments -Werror=empty-body: YES
Compiler for C supports arguments -Werror=format=2: YES
Compiler for C supports arguments -Werror=implicit: YES
Compiler for C supports arguments -Werror=init-self: YES
Compiler for C supports arguments -Werror=int-to-pointer-cast: YES
Compiler for C supports arguments -Werror=main: YES
Compiler for C supports arguments -Werror=missing-braces: YES
Compiler for C supports arguments -Werror=nested-externs: YES
Compiler for C supports arguments -Werror=nonnull: YES
Compiler for C supports arguments -Werror=pointer-to-int-cast: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=sequence-point: YES
Compiler for C supports arguments -Werror=trigraphs: YES
Compiler for C supports arguments -Werror=undef: YES
Compiler for C supports arguments -Werror=write-strings: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Compiler for C supports link arguments -Wl,-Bsymbolic: YES
Compiler for C supports link arguments -Wl,-z,relro: YES
Compiler for C supports link arguments -Wl,-z,now: YES
Compiler for C supports link arguments -Wl,–default-symver: YES
Program python3 found: YES (/usr/bin/python3)
Configuring config.h using configuration
Program glib-mkenums found: YES (/usr/bin/glib-mkenums)
Configuring json-version.h using configuration
Program g-ir-scanner found: YES (/usr/bin/g-ir-scanner)
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Build-time dependency gobject-introspection-1.0 found: YES 1.46.0
Dependency gobject-introspection-1.0 found: YES 1.46.0 (cached)
Program g-ir-scanner found: YES (/usr/bin/g-ir-scanner)
Dependency gobject-introspection-1.0 found: YES 1.46.0 (cached)
Program g-ir-compiler found: YES (/usr/bin/g-ir-compiler)
Program gtkdoc-scan found: YES (/usr/bin/gtkdoc-scan)
Configuring gtkdocentities.ent using configuration
Run-time dependency glib-2.0 found: YES 2.60.0
Program gtkdoc-scan found: YES (/usr/bin/gtkdoc-scan)
Program gtkdoc-scangobj found: YES (/usr/bin/gtkdoc-scangobj)
Program gtkdoc-mkdb found: YES (/usr/bin/gtkdoc-mkdb)
Program gtkdoc-mkhtml found: YES (/usr/bin/gtkdoc-mkhtml)
Program gtkdoc-fixxref found: YES (/usr/bin/gtkdoc-fixxref)
Program xsltproc found: YES (/usr/bin/xsltproc)
Build targets in project: 40

Found ninja-1.9.0 at /usr/bin/ninja
$ ninja -C _build
ninja: Entering directory `_build'
[68/69] Generating Json-1.0.gir with a custom command
FAILED: json-glib/Json-1.0.gir 
/usr/bin/g-ir-scanner --no-libtool --namespace=Json --nsversion=1.0 --warn-all --output json-glib/Json-1.0.gir --c-include=json-glib/json-glib.h --quiet --c-include=json-glib/json-glib.h -DJSON_COMPILATION -I/tmp/build/gimp/json-glib-1.6.2/json-glib -I/tmp/build/gimp/json-glib-1.6.2/_build/json-glib -I/tmp/build/gimp/json-glib-1.6.2/_build/. -I/tmp/build/gimp/json-glib-1.6.2/. --filelist=/tmp/build/gimp/json-glib-1.6.2/_build/json-glib/libjson-glib-1.0.so.0.600.2.p/Json_1.0_gir_filelist --include=GObject-2.0 --include=Gio-2.0 --symbol-prefix=json --identifier-prefix=Json --pkg-export=json-glib-1.0 --cflags-begin -I/tmp/build/gimp/json-glib-1.6.2/_build/. -I/tmp/build/gimp/json-glib-1.6.2/. -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gobject-introspection-1.0 --cflags-end --add-include-path=/usr/share/gir-1.0 -L./json-glib --library json-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgirepository-1.0
/tmp/build/gimp/json-glib-1.6.2/_build/tmp-introspecttiOZEP/Json-1.0: error while loading shared libraries: libjson-glib-1.0.so.0: cannot open shared object file: No such file or directory
Command '['/tmp/build/gimp/json-glib-1.6.2/_build/tmp-introspecttiOZEP/Json-1.0', '--introspect-dump=/tmp/build/gimp/json-glib-1.6.2/_build/tmp-introspecttiOZEP/functions.txt,/tmp/build/gimp/json-glib-1.6.2/_build/tmp-introspecttiOZEP/dump.xml']' returned non-zero exit status 127
ninja: build stopped: subcommand failed.

Do you see something weird in these outputs?

I found and fixed the problem.
It was a problem with the introspection optional feature.
As you can see in my previous message, the problem is with the /usr/bin/g-ir-scanner command.
This command is part of this package installed on my system: gobject-introspection-1.46.0.

So, I found these two workarounds:

  1. build json-glib with the -Dintrospection=disabled option
  2. uninstall the gobject-introspection-1.46.0 package before building json-glib

Best regards.

This looks like either a Meson bug or a gobject-introspection one: the build system should put the newly built directory at the front of the search path; that should prevent the system copy to “take over”.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.