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 688617 - #error "Only <gjs/gjs-module.h> can be included directly."
#error "Only <gjs/gjs-module.h> can be included directly."
Status: RESOLVED FIXED
Product: libpeas
Classification: Platform
Component: general
unspecified
Other All
: Normal major
: ---
Assigned To: libpeas-maint
libpeas-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-19 06:44 UTC by Allison Karlitskaya (desrt)
Modified: 2012-11-25 05:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Workaround gjs single-include issue (1.09 KB, patch)
2012-11-22 03:31 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2012-11-19 06:44:00 UTC
quoth jhbuild:

make[3]: Entering directory `/home/desrt/jhbuild/checkout/libpeas/loaders/gjs'
  CC     peas-plugin-loader-gjs.lo
  CC     peas-extension-gjs.lo
In file included from /opt/ca/desrt/gnome-3.8/include/gjs-1.0/gi/arg.h:29:0,
                 from peas-extension-gjs.c:29:
/opt/ca/desrt/gnome-3.8/include/gjs-1.0/gjs/jsapi-util.h:28:2: error: #error "Only <gjs/gjs-module.h> can be included directly."
In file included from /opt/ca/desrt/gnome-3.8/include/gjs-1.0/gjs/jsapi-util.h:31:0,
                 from /opt/ca/desrt/gnome-3.8/include/gjs-1.0/gi/arg.h:29,
                 from peas-extension-gjs.c:29:
/opt/ca/desrt/gnome-3.8/include/gjs-1.0/gjs/compat.h:26:2: error: #error "Only <gjs/gjs-module.h> can be included directly."
make[3]: *** [peas-extension-gjs.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/desrt/jhbuild/checkout/libpeas/loaders/gjs'
make[2]: Leaving directory `/home/desrt/jhbuild/checkout/libpeas/loaders'
make[1]: Leaving directory `/home/desrt/jhbuild/checkout/libpeas'
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Comment 1 Allison Karlitskaya (desrt) 2012-11-22 03:27:52 UTC
This was caused by bug 688289.

A workaround appears to be #include <gjs/gjs-module.h> before any of the <gi/*> includes...
Comment 2 Allison Karlitskaya (desrt) 2012-11-22 03:31:21 UTC
Created attachment 229616 [details] [review]
Workaround gjs single-include issue

gjs features single-include guards for the headers in gjs/ with
gjs/gjs-module.h being the only header you are supposed to include.

Unfortunately, the headers in gi/ (which do not appear to have their own
master include file) individually include files from gjs/.

We can workaround the issue by first #include <gjs/gjs-module.h> which
will skip the single-include guard on the files the second time they get
included (from the headers in gi/).
Comment 3 Allison Karlitskaya (desrt) 2012-11-22 03:31:40 UTC
Attachment 229616 [details] pushed as 2307c53 - Workaround gjs single-include issue
Comment 4 Colin Walters 2012-11-22 09:35:02 UTC
(In reply to comment #1)
> This was caused by bug 688289.
> 
> A workaround appears to be #include <gjs/gjs-module.h> before any of the <gi/*>
> includes...

I think that's the right thing to do regardless.  Now unfortunately this is hard to fix due to the historical mess that makes up the gjs headers...

Thanks for the libpeas-side fix!
Comment 5 Allison Karlitskaya (desrt) 2012-11-25 05:29:35 UTC
Would there be any harm in creating a <gi/gi.h> or something and having people use that?