gstreamer plain build with auto features enabled fails on gobject-instrospection even if introspection is disabled
Since the bump of glib to 2.74.1, some mechanism in the build system concludes that the subproject gobject-introspection is buildable and that it should be built. Then later when running g-ir-scanner as part of gobject-introspection the build fails because of an include path problem. Adding option -Dintrospection=disabled does not help. An easy workaround to the problem is to install gobject-instrospection from the distro and the build system will not try use the subproject fallback.
The problem is easily reproducible by running a plain gstreamer build within a docker container from the image set up by the Dockerfile below:
FROM ubuntu:22.04 RUN apt-get update -y && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ # gobject-introspection \ # libgirepository1.0-dev \ pkg-config \ build-essential \ cmake \ python3 \ python3-pip \ python3-setuptools \ python3-wheel \ ninja-build \ autoconf \ libtool \ gcc \ git \ g++ \ flex \ bison # gives us meson 0.64.1 RUN pip3 install meson
Executing the lines below from within the container creates a build that fails:
# main is 66087b62766d0fb1362baab494930144d5985305 at the time of writing git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git ( cd gstreamer && meson setup -Dintrospection=disabled ../build ) ninja -C build
Error output below:
In file included from /build/g-ir-cpp-qxwustf9.c:4: /gstreamer/subprojects/glib-2.74.1/gobject/glib-types.h:26:10: fatal error: glib.h: No such file or directory 26 | #include <glib.h> | ^~~~~~~~ compilation terminated.
Uncommenting the commented lines in the dockerfile is a workaround for the issue.