Source: glib2.0 Version: 2.58.0-1 Severity: important Tags: patch upstream User: helm...@debian.org Usertags: rebootstrap
Since version 2.58.0-1, glib2.0 fails to cross build from source, because it fails to find testmarshal.h in tests/gobject. The rules for generating it are conditional to !CROSS_COMPILING, because they run glib-genmarshall. That's a good reason, but it causes the build of the accumulator executable to fail. I guess cross compilation should either skip that executable or it should use the build system's glib-genmarshal. In the interest of reproducible builds, my patch opts for the latter. When applying it, you must also add "libglib2.0-dev-bin <cross>" to Build-Depends. An alternative solution could be not building libglib2.0-tests during cross compilation. That package contains the accumulator binary, so skipping it avoids the problem. I don't see an easy way to skip building installed tests though. Another alternative to the self-dependency could be a native build pass for generating glib-genmarshal. Other packages such as icu use that approach already. Please let me know if you have a strong opinion on the approach. Severity set to important, because this bug regresses architecture bootstrap. Helmut
--- glib2.0-2.58.0.orig/tests/gobject/Makefile.am +++ glib2.0-2.58.0/tests/gobject/Makefile.am @@ -51,19 +51,23 @@ installed_test_programs += timeloop-closure endif -# The marshal test requires running a binary, which means we cannot -# build it when cross-compiling -if !CROSS_COMPILING +# The marshal test requires running a binary, use the native system copy for +# cross compilation. +if CROSS_COMPILING +glib_genmarshal=glib-genmarshal +else glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal +glib_genmarshal_dep=$(glib_genmarshal) +endif testmarshal.h: stamp-testmarshal.h @true -stamp-testmarshal.h: testmarshal.list $(glib_genmarshal) +stamp-testmarshal.h: testmarshal.list $(glib_genmarshal_dep) $(AM_V_GEN) $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --header >> xgen-gmh \ && (cmp -s xgen-gmh testmarshal.h 2>/dev/null || cp xgen-gmh testmarshal.h) \ && rm -f xgen-gmh xgen-gmh~ \ && echo timestamp > $@ -testmarshal.c: testmarshal.h testmarshal.list $(glib_genmarshal) +testmarshal.c: testmarshal.h testmarshal.list $(glib_genmarshal_dep) $(AM_V_GEN) (echo "#include \"testmarshal.h\""; $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --body) >> xgen-gmc \ && cp xgen-gmc testmarshal.c \ && rm -f xgen-gmc xgen-gmc~ @@ -71,4 +75,3 @@ BUILT_SOURCES += testmarshal.h testmarshal.c CLEANFILES += stamp-testmarshal.h testmarshal.h testmarshal.c EXTRA_DIST += testcommon.h testmarshal.list -endif # !CROSS_COMPILING \ No newline at end of file