Re: [Buildroot] [autobuild.buildroot.org] Daily results for 2025-06-14

"Franciszek Stachura" <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
Hello everyone, 

On Mon Jun 16, 2025 at 12:53 PM CEST, Fiona Klute via buildroot wrote:
> Hi everyone,
>
> you might've noticed there are a lot of autobuild failures for 
> host-gobject-introspection errors recently. One example:
> https://autobuild.buildroot.org/results/b9904209e13c1e4ce496aaff2f194064d2a6c691/
>
>  From the error messages it looks like *something* links against system 
> libreadline, which then links against libncursesw from host-ncurses 
> (probably due to the LD_LIBRARY_PATH override), isn't fully compatible, 
> and then the warning
>
>> /bin/sh: /home/autobuild/autobuild/instance-22/output-1/host/lib/libncursesw.so.6: no version information available (required by /usr/lib/libreadline.so.8)
>
> somehow ends up in the linker command line (which seems like a bug in 
> itself, probably in in GOI, regardless of library paths).
>
> My problem is that I can't reproduce the issue, and without that I don't 
> see how I can figure out where exactly things go wrong. I tried on my 
> regular build system, and also with the 
> registry.gitlab.com/buildroot.org/buildroot/base:20250218.2110 image, 
> and both built host-gobject-introspection just fine with config from the 
> linked autobuild run (and a few others I've tried).
>
> Does anyone else have an idea, or a suggestion how to replicate the 
> autobuild environment (because there must be some difference if it 
> consistently fails there, but not with the container)?

host-gobject-introspection errors still regularly appear in autobuild,
so I thought I would investigate.

I believe that at least two conditions have to be met to hit this:
* Host is based on a distro that uses libncursesw.so.6.6 (i.e. Arch, as
  is the case with James' autobuilder instance)
* Ncurses is built before host-gobject-introspection

Right before the error, the following happens:

1. Something (meson? [1]) calls gi-scanner, a python script that is supposed to
   compile something else
2. gi-scanner calls pkg-config to get build options (tracebacks [2])
3. pkg-config outputs a warning (no version information available...) to stderr
4. gi-scanner captures stderr with stdout and parsers that as build options,
   which are then passed to gcc

What could potentially fix this, is stopping gi-scanner from capturing stderr of
pkg-config by simply removing "stderr=subprocess.STDOUT" from
subprocess.check_output call in giscanner/pkgconfig.py (see line 34). This
probably should be sent upstream.

From what I understand, pkg-config is a shell script. Buildroot calls it with
LD_LIBRARY_PATH=$BUILDROOT/output/host/lib.
Bash links with /usr/lib/libreadline.so.8.
readline links with libncursesw.so.6.
A buildroot-version of libncursesw.so.6 is included in output/host/lib (in
LD_LIBRARY_PATH supplied by buildroot), however, libreadline.so.8 is not.

So, the warning seems to be caused by system-bash dynamically linking with some
libraries supplied by the system, and some libraries supplied by buildroot. The
warning also appears if I simply run
LD_LIBRARY_PATH=$BUILDROOT/output/host/lib bash.
Wouldn't it make sense to also build and use host-bash and host-readline?

Commenting out line 45 of package/gobject-introspection/gobject-introspection.mk
also fixed the error for me on Arch, but of course the comment above that line
suggests that this is not the correct thing to do.  That line was introduced in
8270fca2 (package/gobject-introspection: fix host-linking), later modified in
5ef6f949 (package/gobject-introspection: bump version to 1.84.0).

What really adds to the mystery, is the fact that if you run make
host-gobject-introspection ~3-4 times in a row, the compilation step may just
finish normally.

Config: https://gist.github.com/fstachura/0cd14adeb1181731a88c959c9e1977d9
make ncurses && make host-gobject-introspection

[1] subdir('giscanner') in meson.build, maybe tools/meson.build

[2] 

File "tools/g-ir-scanner", line 134, in <module>
    sys.exit(scanner_main(args))
File "giscanner/scannermain.py", line 672, in scanner_main
    shlibs = create_binary(transformer, options, args)
File "giscanner/scannermain.py", line 483, in create_binary
    binary = compile_introspection_binary(options, File
"giscanner/dumper.py", line 304, in compile_introspection_binary
    return dc.run()
File "giscanner/dumper.py", line 164, in run
    introspection_obj = self._compile(c_path)
File "giscanner/dumper.py", line 187, in _compile
    cflags = pkgconfig.cflags(self._packages, 
File "giscanner/pkgconfig.py", line 53, in cflags
    out = check_output(flags, ignore_errors, command)


File "tools/g-ir-scanner", line 134, in <module>
    sys.exit(scanner_main(args))
File "giscanner/scannermain.py", line 659, in scanner_main
    process_packages(options, packages)
File "giscanner/scannermain.py", line 366, in process_packages
    flags = pkgconfig.cflags(packages)
File "giscanner/pkgconfig.py", line 52, in cflags
    out = check_output(flags, ignore_errors, command)                                                                                                                                                                                                                         

Regards,
Franek Stachura
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.