After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617867 - gtk+/gdk-pixbuf fails to build from git outside source tree
gtk+/gdk-pixbuf fails to build from git outside source tree
Status: RESOLVED FIXED
Product: gdk-pixbuf
Classification: Platform
Component: general
2.21.x
Other All
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
Depends on:
Blocks: 569778
 
 
Reported: 2010-05-06 08:41 UTC by Theppitak Karoonboonyanan
Modified: 2011-03-02 01:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes for the 3 subdirs (5.24 KB, patch)
2010-05-06 09:01 UTC, Theppitak Karoonboonyanan
none Details | Review
Updated patch with conflicts resolved (5.75 KB, patch)
2010-05-08 02:52 UTC, Theppitak Karoonboonyanan
none Details | Review
Yet another conflict resolution (5.76 KB, patch)
2010-05-09 09:41 UTC, Theppitak Karoonboonyanan
none Details | Review
Updated patch, only for gdk-pixbuf (2.74 KB, patch)
2010-07-04 06:44 UTC, Theppitak Karoonboonyanan
none Details | Review
Updated patch for GTK+ 2.21.x (3.84 KB, patch)
2010-07-04 10:30 UTC, Theppitak Karoonboonyanan
none Details | Review
Updated patch for gdk-pixbuf, remove srcdir prefix (1.14 KB, patch)
2010-07-04 14:45 UTC, Theppitak Karoonboonyanan
none Details | Review

Description Theppitak Karoonboonyanan 2010-05-06 08:41:36 UTC
By setting 'buildroot' in .jhbuildrc so that jhbuild builds stuffs from outside git source trees, GTK+ fails to build, with the following messages:

---8<---
libtool: link: gcc -DGDK_PIXBUF_DISABLE_DEPRECATED -g -O2 -I/home/gnome2/include -Wall -o .libs/test-gdk-pixbuf test-gdk-pixbuf.o -pthread  -L/home/gnome2/lib64 ./.libs/libgdk_pixbuf-2.0.so /home/gnome2/lib64/libgio-2.0.so /home/gnome2/lib64/libgobject-2.0.so /home/gnome2/lib64/libgmodule-2.0.so /home/gnome2/lib64/libgthread-2.0.so -lrt /home/gnome2/lib64/libglib-2.0.so -lm -pthread -Wl,-rpath -Wl,/home/gnome2/lib64
make[4]: Leaving directory `/home/thep/build/gnome_git/gtk+/gdk-pixbuf'
make[3]: Leaving directory `/home/thep/build/gnome_git/gtk+/gdk-pixbuf'
make[2]: Leaving directory `/home/thep/build/gnome_git/gtk+/gdk-pixbuf'
make[1]: Leaving directory `/home/thep/build/gnome_git/gtk+'
make[4]: *** No rule to make target `/home/thep/vcs/gnome_git/gtk+/gdk-pixbuf/gdk-pixbuf-enum-types.h', needed by `GdkPixbuf-2.0.gir'.  Stop.
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
---8<---

It's these lines that caused the problem:

>  GdkPixbuf_2_0_gir_FILES = \
>    $(addprefix $(srcdir)/,$(libgdk_pixbufinclude_HEADERS)) \
>    $(addprefix $(srcdir)/,$(libgdk_pixbuf_2_0_la_SOURCES))

Here, $(libgdk_pixbufinclude_HEADERS) and $(libgdk_pixbuf_2_0_la_SOURCES) include all headers and source files, including generated files in $(builddir). So, adding $(srcdir) prefix here is just wrong.

Similar problems also occur in gdk/ and gtk/ subdirs.

Note that this kind of problem may not be caught by 'make distcheck', as the generated files are included in the distributed tarball. But this is not the case for VCS builds, such as with jhbuild.
Comment 1 Theppitak Karoonboonyanan 2010-05-06 09:01:33 UTC
Created attachment 160410 [details] [review]
Fixes for the 3 subdirs

For gdk-pixbuf:
- Split the generated sources from the list and treat them differently, just like how header files are done.
- Note that gdk-pixdata.h seems to be manual source file. So, it's moved into $(gdk_pixbuf_headers). If this causes problem in some rules, let's try another way.

For gdk:
- Split $(introspection_files) into 2 categories: manual and built, and treat them differently.
- $(srcdir) prefix is removed from "$(srcdir)/x11/*.c", as it's to be added later in Gdk_2_0_gir_FILES line. Adding it twice causes build failure when builddir != srcdir. (I later found similar report in Bug 613788.)

For gtk:
- Generated sources are split from $(gtk_base_c_sources) into $(gtk_base_c_built_sources), and the latter is added to all other irrelevant appearances of the former, to retain old behavior.
- $(introspection_files) contents are replaced with fine-grained lists. Only manual files are included. And generated files are moved into $(introspection_built_sources), which are treated differently in Gtk_2_0_gir_FILES assignment.
Comment 2 Theppitak Karoonboonyanan 2010-05-08 02:52:47 UTC
Created attachment 160553 [details] [review]
Updated patch with conflicts resolved

Updates in this patch:

- Format patch with git format-patch
- Resolve conflict with recent changes in gtk/Makefile.am
- Fix problem with gdk-pixbuf/gdk-pixdata.h introduced in previous patch, as $(gdk_pixbuf_headers) are also used in gdk-pixbuf-enum-types.h generation. Adding gdk-pixdata.h to it just caused excessive source injection to $(GLIB_MKENUMS), and thus compilation error after that.
Comment 3 Theppitak Karoonboonyanan 2010-05-09 09:41:12 UTC
Created attachment 160630 [details] [review]
Yet another conflict resolution
Comment 4 Theppitak Karoonboonyanan 2010-07-04 06:38:20 UTC
Reassign the bug to gdk-pixbuf, which is now split out of GTK+, and is the only one left affected by this bug.
Comment 5 Theppitak Karoonboonyanan 2010-07-04 06:44:11 UTC
Created attachment 165207 [details] [review]
Updated patch, only for gdk-pixbuf

With this update:
- I've rearranged GdkPixbuf_2_0_gir_FILES so that gdk-pixdata.h is also included, and the files are listed in the same order as defined in the previously used *_HEADERS and *_SOURCES variables.
- gdk-pixbuf-alias.h is added to MAINTAINERCLEANFILES, as it's still left after 'make distclean'.
Comment 6 Theppitak Karoonboonyanan 2010-07-04 10:30:52 UTC
Created attachment 165215 [details] [review]
Updated patch for GTK+ 2.21.x

It appears GTK+ 2.21.x is still affected by this bug. And this patch is updated to catch up with recent git snapshot. Now gtk/gtkmarshal.h is another file that causes the problem.
Comment 7 Theppitak Karoonboonyanan 2010-07-04 10:31:44 UTC
Reassigned the bug back to general GTK+.
Comment 8 Theppitak Karoonboonyanan 2010-07-04 12:13:00 UTC
See also Bug 623520 for GTK+ 3.
Comment 9 Christian Persch 2010-07-04 12:35:33 UTC
The split into srcdir and builddir sources shouldn't be necessary anymore now that bug 616425 is fixed.
Comment 10 Theppitak Karoonboonyanan 2010-07-04 14:45:20 UTC
Created attachment 165223 [details] [review]
Updated patch for gdk-pixbuf, remove srcdir prefix

Updated patch for gdk-pixbuf, by removing $(addprefix ...) clause and let the files be resolved via VPATH, according to gobject-introspection >= 0.6.14.

For GTK+ 2.21.x, it depends on gobject-introspection >= 0.6.7, which is too old for the change, and changing the dependency for a stable version is not a good idea, is it?
Comment 11 Jon Nordby 2011-03-02 01:24:30 UTC
This was fixed for gdk-pixbuf in commit 866cb727612f8d9c0