GST 1.20.2 (and main) on Ubuntu 20.04 `-Dintrospection=enabled` fails because 'master' is not the branch
Describe your issue
Unable to compile GStreamer 1.20.2 on Ubuntu 20.04 if the introspection
option is enabled or if gobject-introspection
is available (but incompatible?) in the operating system.
Expected Behavior
In this case it appears there are attempts to let meson download and install the compatible/required version, however the processes are broken on Ubuntu 20.04. I would expect the processes to work.
Observed Behavior
Meson attempts to fall back to the pango.wrap
, which points to a tagged version with its own gobject-introspection.wrap
, that points at a non-existent master
branch (now main
). Patching the pango.wrap
to an updated version that would fix this issue results in another build failure for subprojects/gstreamer
and subprojects/gst-plugins-base
because the -Dintrospection=enabled
option causes the configuration to abort because g-ir-scanner
is not found (a program provided by gobject-introspection
). Patching the meson.build
files in this case allows the configuration to proceed, which then pulls pango and builds gobject-introspection
from that updated wrap.
Setup
- Operating System: Ubuntu 20.04
- Device: Computer
- GStreamer Version: 1.20.2
- Command line: bash
Steps to reproduce the bug
I installed gobject-introspection
via apt
and then tried configuring the gstreamer build, tag 1.20.2:
meson -Dgpl=enabled builddir
The configuration failed because though meson
found the dependency via pkgconfig
, it fell back to using the .wrap
version of the dependency instead, which it found by way of pango. Meson then failed when attempting to clone the master
branch of gobject-introspection
.
I then ran apt remove gobject-introspection
and tried letting meson handle the dependency on its own by setting the build option:
rm -rf builddir
meson -Dgpl=enabled -Dintrospection=enabled builddir
The error was essentially the same but clarified that it arrived at this dependency because of Pango. The pango.wrap
version is 1.48.7. That version of Pango contains a the gobject-introspection.wrap
that points at the master
branch which was renamed to main
on this commit. The fix version of Pango is 1.50.6.
I then performed a fresh clone of the 1.20.2
GStreamer tag, patched the pango.wrap
to use the 1.50.6 tag, and re-attempted build configuration with the command above. However, it did not fix the issue. Now it does not try pulling Pango to get the dependency (there is no directory for it in subprojects
after the configuration attempt fails). Rather, the error is it cannot find g-ir-scanner
, which is part of gobject-introspection
, so I think there is a dependency tree issue for gstreamer
in the meson.build
:
gstreamer| Project name: gstreamer
gstreamer| Project version: 1.20.2
gstreamer| C compiler for the host machine: cc (gcc 9.4.0 "cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0")
gstreamer| C linker for the host machine: cc ld.bfd 2.34
gstreamer| Compiler for C supports link arguments -Wl,-Bsymbolic-functions: YES (cached)
gstreamer| Compiler for C supports arguments -fvisibility=hidden: YES (cached)
gstreamer| Compiler for C supports arguments -fno-strict-aliasing: YES
gstreamer| Message: Disabling GLib cast checks
gstreamer| Has header "dlfcn.h" : YES
gstreamer| Has header "inttypes.h" : YES
gstreamer| Has header "memory.h" : YES
gstreamer| Has header "poll.h" : YES
gstreamer| Has header "stdint.h" : YES
gstreamer| Has header "stdio_ext.h" : YES
gstreamer| Has header "strings.h" : YES
gstreamer| Has header "string.h" : YES
gstreamer| Has header "sys/param.h" : YES
gstreamer| Has header "sys/poll.h" : YES
gstreamer| Has header "sys/prctl.h" : YES
gstreamer| Has header "sys/socket.h" : YES
gstreamer| Has header "sys/stat.h" : YES
gstreamer| Has header "sys/times.h" : YES
gstreamer| Has header "sys/time.h" : YES (cached)
gstreamer| Has header "sys/types.h" : YES
gstreamer| Has header "sys/utsname.h" : YES
gstreamer| Has header "sys/wait.h" : YES
gstreamer| Has header "ucontext.h" : YES
gstreamer| Has header "unistd.h" : YES (cached)
gstreamer| Has header "sys/resource.h" : YES
gstreamer| Has header "sys/uio.h" : YES
gstreamer| Checking whether type "struct tm" has member "tm_gmtoff" : YES
gstreamer| Checking for function "gmtime_r" : YES
gstreamer| Checking for function "sigaction" : YES
gstreamer| Checking for function "getrusage" : YES
gstreamer| Checking for function "fseeko" : YES
gstreamer| Checking for function "ftello" : YES
gstreamer| Checking for function "poll" : YES
gstreamer| Checking for function "ppoll" : YES
gstreamer| Checking for function "pselect" : YES
gstreamer| Checking for function "getpagesize" : YES
gstreamer| Checking for function "clock_gettime" : YES (cached)
gstreamer| Checking for function "clock_nanosleep" : YES
gstreamer| Checking for function "strnlen" : YES
gstreamer| Checking for function "getline" : YES
gstreamer| Checking for function "mkstemp" : YES
gstreamer| Checking for function "alarm" : YES
gstreamer| Checking for function "gettimeofday" : YES (cached)
gstreamer| Checking for function "localtime_r" : YES
gstreamer| Checking if "pthread_setname_np(const char*)" : links: NO
gstreamer| Header <pthread.h> has symbol "pthread_condattr_setclock" : YES
gstreamer| Header <pthread.h> has symbol "pthread_cond_timedwait_relative_np" : NO
gstreamer| Checking if "futex(2) system call" : links: YES
gstreamer| Checking if "posix timers from time.h" compiles: YES
gstreamer| Checking if "monotonic clock from time.h" compiles: YES
gstreamer| Checking if "__uint128_t available" compiles: YES
gstreamer| Checking for function "getpid" : YES
gstreamer| Checking for function "strdup" : YES
gstreamer| Checking for function "strsignal" : YES
gstreamer| Checking for type "clockid_t" : YES
gstreamer| Checking for type "timer_t" : YES
gstreamer| Checking whether type "struct timespec" has members "tv_sec", "tv_nsec" : YES
gstreamer| Checking whether type "struct itimerspec" has members "it_interval", "it_value" : YES
gstreamer| Found pkg-config: /usr/bin/pkg-config (0.29.1)
gstreamer| Did not find CMake 'cmake'
gstreamer| Found CMake: NO
gstreamer| Run-time dependency libunwind found: NO (tried pkgconfig and cmake)
gstreamer| Run-time dependency libdw found: NO (tried pkgconfig and cmake)
gstreamer| Has header "dbghelp.h" : NO
gstreamer| Checking for function "backtrace" : YES
gstreamer| Message: Minimal support for stack traces, no source info.
gstreamer| Has header "execinfo.h" : YES
gstreamer| Checking for function "backtrace" : YES
gstreamer| Compiler for C supports arguments -Wmissing-declarations: YES
gstreamer| Compiler for C supports arguments -Wmissing-prototypes: YES
gstreamer| Compiler for C supports arguments -Wredundant-decls: YES
gstreamer| Compiler for C supports arguments -Wundef: YES
gstreamer| Compiler for C supports arguments -Wwrite-strings: YES
gstreamer| Compiler for C supports arguments -Wformat: YES
gstreamer| Compiler for C supports arguments -Wformat-nonliteral: YES
gstreamer| Compiler for C supports arguments -Wformat-security: YES
gstreamer| Compiler for C supports arguments -Wold-style-definition: YES
gstreamer| Compiler for C supports arguments -Winit-self: YES
gstreamer| Compiler for C supports arguments -Wmissing-include-dirs: YES
gstreamer| Compiler for C supports arguments -Waddress: YES
gstreamer| Compiler for C supports arguments -Waggregate-return: YES
gstreamer| Compiler for C supports arguments -Wno-multichar: YES
gstreamer| Compiler for C supports arguments -Wdeclaration-after-statement: YES
gstreamer| Compiler for C supports arguments -Wvla: YES
gstreamer| Compiler for C supports arguments -Wpointer-arith: YES
gstreamer| Library gmp found: NO
gstreamer| Library gsl found: NO
gstreamer| Library gslcblas found: NO
gstreamer| Library dl found: YES
gstreamer| Checking for function "dladdr" with dependency -ldl: YES
gstreamer| Run-time dependency glib-2.0 found: YES 2.64.6
gstreamer| Run-time dependency gobject-2.0 found: YES 2.64.6
gstreamer| Run-time dependency gmodule-2.0 found: YES 2.64.6
gstreamer| Run-time dependency gio-2.0 found: YES 2.64.6
gstreamer| Run-time dependency gio-unix-2.0 found: YES 2.64.6
gstreamer| Library m found: YES
gstreamer| Library rt found: YES
gstreamer| Program g-ir-scanner found: NO
subprojects/gstreamer/meson.build:509:0: ERROR: Program 'g-ir-scanner' not found or not executable
I modified that line as well as the same line found in gst-plugins-base
to be required: false
rather than being tied to enabling the option, since the following build_gir
variable (line 512 in the subprojects/gstreamer/meson.build
case) seems to be intended to flag whether it's necessary to pull and build the package from source. Re-running the meson ... builddir
configuration step from above succeeded this time in pulling pango
and building the gobject-introspection
dependency.
How reproducible is the bug?
Always
Screenshots if relevant
Solutions you have tried
See Steps to Reproduce above; the patches are in-line below. I do not think these are entirely the correct solution, however. The pango wrap version should probably be bumped but the meson.build
patches are probably not right given there is a top-level meson.build
check for this option that perhaps should be dealing with this missing / unmet dependency in a more resilient manner.
diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build
index 6d64762aae..68d6037e06 100644
--- a/subprojects/gst-plugins-base/meson.build
+++ b/subprojects/gst-plugins-base/meson.build
@@ -428,7 +428,7 @@ if cc.has_member('struct tcp_info', 'tcpi_reordering', prefix: '#include <netine
core_conf.set('HAVE_LINUX_TCP_INFO', true)
endif
-gir = find_program('g-ir-scanner', required : get_option('introspection'))
+gir = find_program('g-ir-scanner', required : false)
gnome = import('gnome')
build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build
index 62cefa19e9..1988e21c39 100644
--- a/subprojects/gstreamer/meson.build
+++ b/subprojects/gstreamer/meson.build
@@ -506,7 +506,7 @@ mathlib = cc.find_library('m', required : false)
# Also provides clock_gettime in glibc < 2.17
rt_lib = cc.find_library('rt', required : false)
-gir = find_program('g-ir-scanner', required : get_option('introspection'))
+gir = find_program('g-ir-scanner', required : false)
gnome = import('gnome')
build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
diff --git a/subprojects/pango.wrap b/subprojects/pango.wrap
index 7da354c912..dd27c4a1b0 100644
--- a/subprojects/pango.wrap
+++ b/subprojects/pango.wrap
@@ -1,4 +1,4 @@
[wrap-git]
url=https://gitlab.gnome.org/GNOME/pango.git
push-url=git@gitlab.gnome.org:GNOME/pango.git
-revision=1.48.7
+revision=1.50.6