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 773129 - Invalid C code generated by Vala.CCodeGGnucSection
Invalid C code generated by Vala.CCodeGGnucSection
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.34.x
Other Linux
: Normal normal
: ---
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2016-10-18 02:41 UTC by Mohammed Sadiq
Modified: 2016-10-18 19:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
folks build log (20.21 KB, text/plain)
2016-10-18 17:02 UTC, Mohammed Sadiq
  Details
note-details.c (32.48 KB, text/plain)
2016-10-18 17:34 UTC, Mohammed Sadiq
  Details
postal-address-details.c (105.24 KB, text/plain)
2016-10-18 17:34 UTC, Mohammed Sadiq
  Details
ccode: Add missing newline after gnuc deprecations attribute (1.08 KB, patch)
2016-10-18 18:03 UTC, Philip Withnall
committed Details | Review

Description Mohammed Sadiq 2016-10-18 02:41:12 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.
Comment 1 Mohammed Sadiq 2016-10-18 10:54:48 UTC
valadoc also fails to build for the same reason
Comment 2 Mohammed Sadiq 2016-10-18 11:09:19 UTC
My git repo was unclean. Sorry for the noise. folks now fails for a different reason though.
Comment 3 Philip Withnall 2016-10-18 16:21:46 UTC
(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?
Comment 4 Mohammed Sadiq 2016-10-18 16:30:35 UTC
/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]
Comment 5 Philip Withnall 2016-10-18 16:49:39 UTC
(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?
Comment 6 Mohammed Sadiq 2016-10-18 17:02:01 UTC
Created attachment 337951 [details]
folks build log

Sure. log is attached.
Comment 7 Philip Withnall 2016-10-18 17:27:53 UTC
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`?
Comment 8 Mohammed Sadiq 2016-10-18 17:34:09 UTC
Created attachment 337956 [details]
note-details.c
Comment 9 Mohammed Sadiq 2016-10-18 17:34:42 UTC
Created attachment 337957 [details]
postal-address-details.c
Comment 10 Mohammed Sadiq 2016-10-18 17:36:30 UTC
By the way, I'm on Debian testing. But I don't think that could be an issue.
Comment 11 Philip Withnall 2016-10-18 18:03:00 UTC
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.
Comment 12 Philip Withnall 2016-10-18 18:03:14 UTC
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.
Comment 13 Philip Withnall 2016-10-18 18:10:06 UTC
(The G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS stuff was added in bug #732449.)
Comment 14 Rico Tzschichholz 2016-10-18 19:56:32 UTC
Attachment 337960 [details] pushed as 88e5aab - ccode: Add missing newline after gnuc deprecations attribute