GNOME Bugzilla – Bug 598114
build overwrites interfaces/interfaces-enumtypes.h with wrong enumtypes
Last modified: 2009-10-16 07:25:48 UTC
cd gst-plugins-base/gst-libs/gst make clean all ls -alt */*enumtypes.h -rw-r--r-- 1 ensonic users 916 11. Okt 23:01 audio/audio-enumtypes.h -rw-r--r-- 1 ensonic users 1786 11. Okt 23:00 interfaces/interfaces-enumtypes.h -rw-r--r-- 1 ensonic users 373 11. Okt 22:54 video/video-enumtypes.h -rw-r--r-- 1 ensonic users 1194 11. Okt 22:53 rtsp/gstrtsp-enumtypes.h -rw-r--r-- 1 ensonic users 419 11. Okt 22:53 pbutils/pbutils-enumtypes.h touch audio/gstringbuffer.h make 2>&1 >make.log V=1 ls -alt */*enumtypes.h -rw-r--r-- 1 ensonic users 916 11. Okt 23:03 interfaces/interfaces-enumtypes.h -rw-r--r-- 1 ensonic users 916 11. Okt 23:03 audio/audio-enumtypes.h -rw-r--r-- 1 ensonic users 373 11. Okt 22:54 video/video-enumtypes.h -rw-r--r-- 1 ensonic users 1194 11. Okt 22:53 rtsp/gstrtsp-enumtypes.h -rw-r--r-- 1 ensonic users 419 11. Okt 22:53 pbutils/pbutils-enumtypes.h as you can see interfaces/interfaces-enumtypes.h contains the same stuff as audio/audio-enumtypes.h To temporarily fix it run: cd interfaces/ && make clean all && cd .. The problem seems to be that building audio/mixerutils.c references gst/interfaces/mixer.h which in turn references gst/interfaces/interfaces-enumtypes.h. This triggers the rule in common/glib-gen.mak %-enumtypes.h: $(glib_enum_headers) glib-mkenums ... unfortunately it is triggered for the wrong headers :/ I added an echo to the rule: glib-mkenums ../../../gst-libs/gst/interfaces/interfaces-enumtypes.h : multichannel.h gstringbuffer.h Is there any other way than removing the pattern rule and using e.g. glib_enum_basename=audio in Makefile.am and $(glib_enum_basename)-enumtypes.h: $(glib_enum_headers) glib-mkenums ... $(glib_enum_basename)-enumtypes.c: $(glib_enum_headers) glib-mkenums ... in common/glib-gen.mak?
I did a quick check and the above suggestion works. I'd like to get a 2nd opinion though, as we have to change it everywhere. > find . -name "Makefile.am" -exec grep -l "common/glib-gen.mak" {} \; ./gst-plugins-bad/gst/selector/Makefile.am ./gst-plugins-bad/gst/camerabin/Makefile.am ./gst-plugins-bad/gst-libs/gst/app/Makefile.am ./gst-plugins-bad/gst-libs/gst/interfaces/Makefile.am ./gst-plugins-base/gst/tcp/Makefile.am ./gst-plugins-base/gst/playback/Makefile.am ./gst-plugins-base/gst-libs/gst/app/Makefile.am ./gst-plugins-base/gst-libs/gst/interfaces/Makefile.am ./gst-plugins-base/gst-libs/gst/rtsp/Makefile.am ./gst-plugins-base/gst-libs/gst/audio/Makefile.am ./gst-plugins-base/gst-libs/gst/video/Makefile.am ./gst-plugins-base/gst-libs/gst/pbutils/Makefile.am ./gst-plugins-good/gst/udp/Makefile.am ./gst-plugins-good/gst/rtpmanager/Makefile.am
Created attachment 145328 [details] [review] only run rule actions in local dir This would be a less intrusive change. It prevents the rule to be executed in for tagets in other directories. make also sets a $(CURDIR) but I found no easy way to use it (e.g. to prepend it to the target of the pattern rule). Below shows the output of [$(CURDIR)] $@ : $^ [ /home/ensonic/projects/gstreamer/gst-plugins-base/gst-libs/gst/audio ] building audio-enumtypes.h : multichannel.h gstringbuffer.h CC audio.o CC gstringbuffer.o [ /home/ensonic/projects/gstreamer/gst-plugins-base/gst-libs/gst/audio ] building ../../../gst-libs/gst/interfaces/interfaces-enumtypes.h : multichannel.h gstringbuffer.h
That patch looks good IMHO
I think I'd prefer the solution suggested in comment #1. The approach taken in the patch looks fragile and possibly non-portable to me.
build: use glib_gen_basename for generated files. Fixes #598114 We used pattern rules before. This breaks if a header is references from a different directory. For marshallers I could trigger useless rebuilds. For enums it caused that the genrated files where overwritten with wrong content as the pattern rule has a static dependecy. So it created enumtypes for dir a in dir b. I'll push the patches for base/good now as well, but wait with ugly and bad for after the freeze.