GNOME Bugzilla – Bug 340532
build fails: redeclaration of enumerator 'Nautilus_MetafileMonitor_metafile_changed_IMETHODS_INDEX'
Last modified: 2006-05-18 12:24:21 UTC
In file included from ../libnautilus-private/nautilus-metafile-factory.h:26, from nautilus-application.c:79: ../libnautilus-private/nautilus-metafile-server.h:552: error: redeclaration of enumerator 'Nautilus_MetafileMonitor_metafile_changed_IMETHODS_INDEX' nautilus-shell-interface.h:822: error: previous definition of 'Nautilus_MetafileMonitor_metafile_changed_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:554: error: redeclaration of enumerator 'Nautilus_MetafileMonitor_metafile_ready_IMETHODS_INDEX' nautilus-shell-interface.h:824: error: previous definition of 'Nautilus_MetafileMonitor_metafile_ready_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:554: error: conflicting types for 'Nautilus_MetafileMonitor__imethods_index' nautilus-shell-interface.h:824: error: previous declaration of 'Nautilus_MetafileMonitor__imethods_index' was here ../libnautilus-private/nautilus-metafile-server.h:557: error: redeclaration of enumerator 'Nautilus_Metafile_is_read_IMETHODS_INDEX' nautilus-shell-interface.h:827: error: previous definition of 'Nautilus_Metafile_is_read_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:558: error: redeclaration of enumerator 'Nautilus_Metafile_get_IMETHODS_INDEX' nautilus-shell-interface.h:828: error: previous definition of 'Nautilus_Metafile_get_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:559: error: redeclaration of enumerator 'Nautilus_Metafile_get_list_IMETHODS_INDEX' nautilus-shell-interface.h:829: error: previous definition of 'Nautilus_Metafile_get_list_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:560: error: redeclaration of enumerator 'Nautilus_Metafile_set_IMETHODS_INDEX' nautilus-shell-interface.h:830: error: previous definition of 'Nautilus_Metafile_set_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:561: error: redeclaration of enumerator 'Nautilus_Metafile_set_list_IMETHODS_INDEX' nautilus-shell-interface.h:831: error: previous definition of 'Nautilus_Metafile_set_list_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:562: error: redeclaration of enumerator 'Nautilus_Metafile_copy_IMETHODS_INDEX' nautilus-shell-interface.h:832: error: previous definition of 'Nautilus_Metafile_copy_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:563: error: redeclaration of enumerator 'Nautilus_Metafile_remove_IMETHODS_INDEX' nautilus-shell-interface.h:833: error: previous definition of 'Nautilus_Metafile_remove_IMETHODS_INDEX' was here../libnautilus-private/nautilus-metafile-server.h:564: error: redeclaration of enumerator 'Nautilus_Metafile_rename_IMETHODS_INDEX' nautilus-shell-interface.h:834: error: previous definition of 'Nautilus_Metafile_rename_IMETHODS_INDEX' was here../libnautilus-private/nautilus-metafile-server.h:565: error: redeclaration of enumerator 'Nautilus_Metafile_rename_directory_IMETHODS_INDEX' nautilus-shell-interface.h:835: error: previous definition of 'Nautilus_Metafile_rename_directory_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:566: error: redeclaration of enumerator 'Nautilus_Metafile_register_monitor_IMETHODS_INDEX' nautilus-shell-interface.h:836: error: previous definition of 'Nautilus_Metafile_register_monitor_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:568: error: redeclaration of enumerator 'Nautilus_Metafile_unregister_monitor_IMETHODS_INDEX' nautilus-shell-interface.h:838: error: previous definition of 'Nautilus_Metafile_unregister_monitor_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:568: error: conflicting types for 'Nautilus_Metafile__imethods_index' nautilus-shell-interface.h:838: error: previous declaration of 'Nautilus_Metafile__imethods_index' was here ../libnautilus-private/nautilus-metafile-server.h:572: error: redeclaration of enumerator 'Nautilus_MetafileFactory_open_IMETHODS_INDEX' nautilus-shell-interface.h:842: error: previous definition of 'Nautilus_MetafileFactory_open_IMETHODS_INDEX' was here ../libnautilus-private/nautilus-metafile-server.h:572: error: conflicting types for 'Nautilus_MetafileFactory__imethods_index' nautilus-shell-interface.h:842: error: previous declaration of 'Nautilus_MetafileFactory__imethods_index' was here
I get the same failure on CVS Head, and a very similar one in at-spi. I tried checking out several older versions of nautilus, but got the same error. So, I suspect this is an idl or bonobo bug or something...
confirming anyways
Looks like this is an ORBit2 bug. Run 'cvs -q -z3 update -Pd -D 2006-04-01' in the ORBit2 directory and then build it, then try building nautilus -- it should build without this error (does for me, anyway).
Caused by change in bug 340410. Being totally unfamiliar with ORBit2/bonobo, I'm not sure which part of the patch it was, but I'm trying to take a look...
Hi Elijah - binary chop on that patch is perhaps the only way to fix it. OTOH - the src/idl-compiler part of that code [ the only thing that can really affect the idl compilation is just killing dead-code: so it would be quite amazing if that was the problem :-) I might be more suspicious of: 2006-04-24 Kuang-Chun Cheng <kccheng@linuxdaq-labs.org> * src/idl-compiler/orbit-idl-c-headers.c emit per interface enum for index of xyz_imethods[]. I don't recall approving that personally - but ... ;-)
Yeah, it turns out when I was doing a binary search on cvs commits to find which patch caused the problem, I must have missed a make install or something and thus tagged the wrong patch as being the problem. It is indeed Kuang-Chun's patch that causes this error and not Kjartan's. I may not have time to look any closer for another day or two...
I see the problem. It's because in nautilus-shell-interface.h, the idl "../libnatilus-private/nautilus-metafile-server.idl" had been included which cause typedef enum { ... } Nautilus_Metafile*__imethods_index; been emitted twice. This didn't happen in "#include <Bonobo.idl>" ... The easy fix will be add a guarding #ifndef xyz #define xyz ... #endif /* xyz */ around emitted "typedef enum {...} ...". But since I copy/modify the emitting code from $ORBIT2_SRC/src/idl-compiler/orbit-idl-c-common.c maybe it's better for me to look at it more closer. Obviously, the "make check" in ORBit2 did not detect this issue. Regards KC -- Kuang-Chun Cheng kccheng@linuxdaq-labs.org
Created attachment 64878 [details] [review] quick fix of bug 340532 by using guarding macros Hi, Attachment is the patch which is a quick fix of this bug. The real solution should be avoiding enum been emitted twice. Also, I took Michael's suggestion and replace the capital suffix, _IMETHODS_INDEX, by __imethods_index. I don't have CVS account yet (request ID: gnome.org #1119), nobody reply my request ... so I will also post this patch to orbit mailing list and ask Jules to kindly commit this patch into CVS HEAD for me. This patch is tested under FC5. After I install the patched version, I used it to recompile ORBit2 itself again ... "make check" did not show me any error. Also, I use this patched version to compile nautilus-2.14.1, this time it pass and "make check" also show me no error on FC5. Regards KC -- Kuang-Chun Cheng kccheng@linuxdaq-labs.org, kcc1967@gmail.com
Comment on attachment 64878 [details] [review] quick fix of bug 340532 by using guarding macros >diff -u -r ORBit2-20060506/ChangeLog ORBit2-20060506-kcc/ChangeLog >--- ORBit2-20060506/ChangeLog 2006-05-03 04:48:28.000000000 +0800 >+++ ORBit2-20060506-kcc/ChangeLog 2006-05-06 02:07:15.000000000 +0800 >@@ -1,3 +1,9 @@ >+2006-05-06 Kuang-Chun Cheng <kccheng@linuxdaq-labs.org> >+ >+ * src/idl-compiler/orbit-idl-c-headers.c: >+ Add guarding macros around emitted per interface enum of xyz_imethods[]. >+ Fix Bug #340532. >+ > 2006-05-02 Kjartan Maraas <kmaraas@gnome.org> > > * configure.in: Remove SSL bits. >diff -u -r ORBit2-20060506/src/idl-compiler/orbit-idl-c-headers.c ORBit2-20060506-kcc/src/idl-compiler/orbit-idl-c-headers.c >--- ORBit2-20060506/src/idl-compiler/orbit-idl-c-headers.c 2006-05-02 18:10:18.000000000 +0800 >+++ ORBit2-20060506-kcc/src/idl-compiler/orbit-idl-c-headers.c 2006-05-06 01:53:01.000000000 +0800 >@@ -88,7 +88,7 @@ > fullname = g_strconcat (id, "_", IDL_IDENT ( > IDL_OP_DCL (tree).ident).str, NULL); > >- fprintf (of, "\t%s_IMETHODS_INDEX", fullname); >+ fprintf (of, "\t%s__imethods_index", fullname); > > g_free (fullname); > } >@@ -108,6 +108,10 @@ > IDL_INTERFACE (i->tree).ident), "_", 0); > > if (i->methods) { >+ >+ fprintf (of, "#ifndef __%s__imethods_index\n", id); >+ fprintf (of, "#define __%s__imethods_index\n", id); >+ > fprintf (of, "typedef enum {\n"); > > for (m = i->methods; m; m = m->next) { >@@ -118,7 +122,8 @@ > fprintf(of, "\n"); > } > >- fprintf (of, "} %s__imethods_index;\n\n", id); >+ fprintf (of, "} %s__imethods_index;\n", id); >+ fprintf (of, "#endif /* __%s__imethods_index */\n\n", id); > } > > g_free (id); >@@ -175,7 +180,7 @@ > > if (rinfo->idata) { > GSList *list = NULL; >- fprintf (ci->fh, "\n/* IMethods index */\n\n"); >+ fprintf (ci->fh, "\n/** IMethods index */\n\n"); > > list = ch_build_interfaces (list, tree); > ch_output_imethods_index (list, ci); >@@ -184,7 +189,7 @@ > fprintf(ci->fh, "#ifndef __ORBIT_IMETHODS_INDEX\n"); > fprintf(ci->fh, "#define __ORBIT_IMETHODS_INDEX\n"); > fprintf(ci->fh, "#define ORBIT_IMETHODS_INDEX(m) (m ## __imethods_index)\n"); >- fprintf(ci->fh, "#endif /* __ORBIT_IMETHODS_INDEX */\n"); >+ fprintf(ci->fh, "#endif /* __ORBIT_IMETHODS_INDEX */\n\n"); > > fprintf(ci->fh, "#ifdef __cplusplus\n"); > fprintf(ci->fh, "}\n");
Created attachment 64884 [details] [review] update of patch with test code included Same patch as previous one with test code included. Regards KC
(In reply to comment #5) > Hi Elijah - binary chop on that patch is perhaps the only way to fix it. > OTOH - the src/idl-compiler part of that code [ the only thing that can really > affect the idl compilation is just killing dead-code: so it would be quite > amazing if that was the problem :-) > > I might be more suspicious of: > > 2006-04-24 Kuang-Chun Cheng <kccheng@linuxdaq-labs.org> > > * src/idl-compiler/orbit-idl-c-headers.c > emit per interface enum for index of xyz_imethods[]. > > I don't recall approving that personally - but ... ;-) > Mea Culpa. KC posted the patch to the list where it went unanswered. I thought it looked usefull and tested with "make check" and evolution-brutus. Not haven found any errors I offered to commit on behalf of KC. Sorry about not getting a second oppinion :-( -- jules
I still see this with current CVS: gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -DORBIT2=1 -pthread -I/opt/gnome/include/libbonobo-2.0 -I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include -I/opt/gnome/include/orbit-2.0 -I/opt/gnome/include/bonobo-activation-2.0 -I/opt/gnome/include/atk-1.0 -I/opt/gnome/include/gtk-2.0 -I/opt/gnome/lib/gtk-2.0/include -I/opt/gnome/include/cairo -I/opt/gnome/include/pango-1.0 -I/opt/gnome/include/gail-1.0 -I/opt/gnome/include/libgnomecanvas-2.0 -I/opt/gnome/include/libart-2.0 -I/opt/gnome/include -I/usr/include/freetype2 -g -O2 -MT accessible.lo -MD -MP -MF .deps/accessible.Tpo -c accessible.c -fPIC -DPIC -o .libs/accessible.o In file included from ../libspi/libspi.h:27, from accessible.c:30: ../libspi/Accessibility.h:5665: error: conflicting types for 'Bonobo_Stream__imethods_index' /opt/gnome/include/libbonobo-2.0/bonobo/Bonobo.h:5790: error: previous declaration of 'Bonobo_Stream__imethods_index' was here ../libspi/Accessibility.h:5683: error: conflicting types for 'Bonobo_Storage__imethods_index' /opt/gnome/include/libbonobo-2.0/bonobo/Bonobo.h:5805: error: previous declaration of 'Bonobo_Storage__imethods_index' was here make[3]: *** [accessible.lo] Error 1 make[3]: Leaving directory `/home/kmaraas/cvs/gnome214/at-spi/libspi' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/kmaraas/cvs/gnome214/at-spi/libspi' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/kmaraas/cvs/gnome214/at-spi' I did make maintainer-clean in at-spi and retried without luck.
Hmm, if I had just read what I pasted here I'd see that I'd have to rebuild libbonobo as well as ORBit2 to get the thing working again :-) Can we close this report now?
Kjartan, Could you build at-spi now ? I check out both libbonobo-20060508 and at-spi-20060508, both can be built by the patched ORBit2 and pass "make check" under FC5. The only thing the patch did is emit enum for imethods[] which will used when ORBit_small_invoke_async() is used. For example, if you have a Foo.idl as below: interface Foo { void bar(); }; You will get extra code emitted in Foo.h: ... /** IMethods index */ #ifndef __Foo__imethods_index #define __Foo__imethods_index typedef enum { Foo_bar__imethods_index } Foo__imethods_index; #endif /* __Foo__imethods_index */ #ifndef __ORBIT_IMETHODS_INDEX #define __ORBIT_IMETHODS_INDEX #define ORBIT_IMETHODS_INDEX(m) (m ## __imethods_index) #endif /* __ORBIT_IMETHODS_INDEX */ ... As you can see, now everything related by new patch are protected by guarding macros. Unless the patch did introduce some namespace problem, it should be safe now. Sorry for cause you guys these problem. Regards KC
For some reason the problem is gone for me. I am closing this report now and believe it was somehow fixed. Otherwise feel free to reopen.