GNOME Bugzilla – Bug 773129
Invalid C code generated by Vala.CCodeGGnucSection
Last modified: 2016-10-18 19:56:36 UTC
Fails to build from git master using Jhbuild Relevant part from the build log: Vala compiler required for non-release builds; requiring Vala... Vala source needs to be re-compiled; requiring Vala... checking for valac... (cached) /home/sadiq/jhbuild/install/bin/valac checking whether /home/sadiq/jhbuild/install/bin/valac is at least version 0.22.0.28-9090... yes checking for vapigen... /home/sadiq/jhbuild/install/bin/vapigen checking for gio-2.0 gee-0.8 vala bindings... configure: error: Package requirements were not met: gio-2.0 gee-0.8 gee-0.8.vapi:278.3-278.31: error: overriding method `Gee.HashSet.foreach' is incompatible with base method `Gee.AbstractCollection.foreach': incompatible type of parameter 1. gee-0.8.vapi:278.3-278.31: error: Gee.HashSet.foreach: no suitable method found to override gee-0.8.vapi:368.3-368.31: error: overriding method `Gee.PriorityQueue.foreach' is incompatible with base method `Gee.AbstractCollection.foreach': incompatible type of parameter 1. gee-0.8.vapi:368.3-368.31: error: Gee.PriorityQueue.foreach: no suitable method found to override Consider adjusting the XDG_DATA_DIRS environment variable if you installed bindings in a non-standard prefix. *** Error during phase configure of folks: ########## Error running ./autogen.sh --prefix /home/sadiq/jhbuild/install --disable-Werror --enable-eds-backend --disable-libsocialweb-backend --disable-fatal-warnings --disable-static --disable-gtk-doc *** [1/1] Thanks.
valadoc also fails to build for the same reason
My git repo was unclean. Sorry for the noise. folks now fails for a different reason though.
(In reply to Mohammed Sadiq from comment #2) > My git repo was unclean. Sorry for the noise. folks now fails for a > different reason though. How does folks fail now?
/home/sadiq/jhbuild/checkout/folks/folks/postal-address-details.vala:296:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] this.value.notify["uid"].connect ((s, p) => ^ Makefile:1014: recipe for target 'libfolks_la-postal-address-details.lo' failed make[2]: *** [libfolks_la-postal-address-details.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala: In function ‘_vala_folks_note_field_details_get_property’: /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala:35:2: error: stray ‘#’ in program { ^ /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala:35:3: error: ‘line’ undeclared (first use in this function) { ^ /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala:35:3: note: each undeclared identifier is reported only once for each function it appears in /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala:35:8: error: expected ‘;’ before numeric constant { ^ /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala: In function ‘_vala_folks_note_field_details_set_property’: /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala:35:2: error: stray ‘#’ in program { ^ /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala:35:3: error: ‘line’ undeclared (first use in this function) { ^ /home/sadiq/jhbuild/checkout/folks/folks/note-details.vala:35:8: error: expected ‘;’ before numeric constant { ^ Makefile:1000: recipe for target 'libfolks_la-note-details.lo' failed make[2]: *** [libfolks_la-note-details.lo] Error 1 /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala: In function ‘_vala_folks_role_get_property’: /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:36:2: error: stray ‘#’ in program { ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:36:3: error: ‘line’ undeclared (first use in this function) { ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:36:3: note: each undeclared identifier is reported only once for each function it appears in /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:36:8: error: expected ‘;’ before numeric constant { ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala: In function ‘_vala_folks_role_set_property’: /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:36:2: error: stray ‘#’ in program { ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:36:3: error: ‘line’ undeclared (first use in this function) { ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:36:8: error: expected ‘;’ before numeric constant { ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala: In function ‘folks_role_field_details_real_equal’: /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:233:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] return Role.equal (this.value, that_fd.value); ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:233:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] return Role.equal (this.value, that_fd.value); ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala: In function ‘folks_role_field_details_real_hash’: /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:243:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] return str_hash (this.value.to_string ()); ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala: In function ‘folks_role_field_details_real_set_id’: /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:177:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] if (this._id != this.value.uid) ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:178:11: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] this.value.uid = this._id; ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala: In function ‘_folks_role_field_details___lambda5_’: /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:213:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] if (this.id != this.value.uid) ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:214:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] this.id = this.value.uid; ^ /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala: In function ‘folks_role_field_details_constructor’: /home/sadiq/jhbuild/checkout/folks/folks/role-details.vala:211:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] this.value.notify["uid"].connect ((s, p) => ^ Makefile:1028: recipe for target 'libfolks_la-role-details.lo' failed make[2]: *** [libfolks_la-role-details.lo] Error 1 /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala: In function ‘_vala_folks_persona_store_get_property’: /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala:334:2: error: stray ‘#’ in program { ^ /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala:334:3: error: ‘line’ undeclared (first use in this function) { ^ /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala:334:3: note: each undeclared identifier is reported only once for each function it appears in /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala:334:8: error: expected ‘;’ before numeric constant { ^ /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala: In function ‘_vala_folks_persona_store_set_property’: /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala:334:2: error: stray ‘#’ in program { ^ /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala:334:3: error: ‘line’ undeclared (first use in this function) { ^ /home/sadiq/jhbuild/checkout/folks/folks/persona-store.vala:334:8: error: expected ‘;’ before numeric constant { ^ Makefile:1063: recipe for target 'libfolks_la-persona-store.lo' failed make[2]: *** [libfolks_la-persona-store.lo] Error 1 make[2]: Leaving directory '/media/sadiq/Main/Software/src/gnome/folks/folks' Makefile:554: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/media/sadiq/Main/Software/src/gnome/folks' Makefile:485: recipe for target 'all' failed make: *** [all] Error 2 *** Error during phase build of folks: ########## Error running make -j 5 *** [1/1]
(In reply to Mohammed Sadiq from comment #4) > /home/sadiq/jhbuild/checkout/folks/folks/postal-address-details.vala:296:9: > warning: assignment discards ‘const’ qualifier from pointer target type > [-Wdiscarded-qualifiers] > this.value.notify["uid"].connect ((s, p) => > ^ > Makefile:1014: recipe for target 'libfolks_la-postal-address-details.lo' > failed > make[2]: *** [libfolks_la-postal-address-details.lo] Error 1 That doesn’t look like the full set of errors for `postal-address-details.[vala|c]`. Were there some more, earlier errors? Can you run `git clean -fxd && git clean -fXd` and try building again please?
Created attachment 337951 [details] folks build log Sure. log is attached.
Hmm, odd. Can you please attach `/home/sadiq/jhbuild/checkout/folks/folks/note-details.c` and `/home/sadiq/jhbuild/checkout/folks/folks/postal-address-details.c`?
Created attachment 337956 [details] note-details.c
Created attachment 337957 [details] postal-address-details.c
By the way, I'm on Debian testing. But I don't think that could be an issue.
Looks like the problem is this generated code (from `note-details.c`): > #line 34 "/home/sadiq/jhbuild/checkout/folks/folks/note-details.vala" > case FOLKS_NOTE_FIELD_DETAILS_UID: > G_GNUC_BEGIN_IGNORE_DEPRECATIONS#line 447 "note-details.c" > g_value_set_string (value, folks_note_field_details_get_uid (self)); > G_GNUC_END_IGNORE_DEPRECATIONS The problem is the lack of line feed after `G_GNUC_BEGIN_IGNORE_DEPRECATIONS`. This is a bug in valac. Patch coming shortly.
Created attachment 337960 [details] [review] ccode: Add missing newline after gnuc deprecations attribute In generated C code, code wrapped by G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS was missing a newline after the BEGIN attribute, which was causing compilation failures. Fix that by adding the missing newline.
(The G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS stuff was added in bug #732449.)
Attachment 337960 [details] pushed as 88e5aab - ccode: Add missing newline after gnuc deprecations attribute