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 598114 - build overwrites interfaces/interfaces-enumtypes.h with wrong enumtypes
build overwrites interfaces/interfaces-enumtypes.h with wrong enumtypes
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.26
Assigned To: Stefan Sauer (gstreamer, gtkdoc dev)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-11 21:00 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2009-10-16 07:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
only run rule actions in local dir (1.32 KB, patch)
2009-10-13 07:15 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2009-10-11 21:00:49 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?
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2009-10-11 21:08:06 UTC
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
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2009-10-13 07:15:32 UTC
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
Comment 3 Sebastian Dröge (slomo) 2009-10-14 06:47:20 UTC
That patch looks good IMHO
Comment 4 Tim-Philipp Müller 2009-10-14 07:51:22 UTC
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.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2009-10-16 07:25:48 UTC
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.