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 694873 - Statically link in native modules
Statically link in native modules
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-28 15:02 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-03-07 22:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Statically link in native modules (2.90 KB, patch)
2013-02-28 15:02 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
native: Remove unused argument (2.97 KB, patch)
2013-02-28 15:02 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
importer: Remove support for loading external native modules (6.44 KB, patch)
2013-02-28 15:02 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
native: Pass the module name to the import call (2.68 KB, patch)
2013-02-28 15:02 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
native: Remove support for nested native modules (3.82 KB, patch)
2013-02-28 15:02 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Don't use constructors to register static modules (10.65 KB, patch)
2013-02-28 15:02 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-02-28 15:02:38 UTC
This is more of a proposal, but I wrote this while rewriting
the import system so I could give unique prefixes to GType names
so we wouldn't have extension conflicts in GType names anymore.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-02-28 15:02:42 UTC
Created attachment 237604 [details] [review]
Statically link in native modules

Now that we have significantly less of them, there's no real
reason to not link in the native implementations of this...
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-02-28 15:02:45 UTC
Created attachment 237605 [details] [review]
native: Remove unused argument
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-02-28 15:02:47 UTC
Created attachment 237606 [details] [review]
importer: Remove support for loading external native modules
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-02-28 15:02:50 UTC
Created attachment 237607 [details] [review]
native: Pass the module name to the import call

Rather than picking it up indirectly through meta properties.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-02-28 15:02:53 UTC
Created attachment 237608 [details] [review]
native: Remove support for nested native modules

Now that all modules are guaranteed to be inline, this
skips this step. With this gone, we can remove a large
set of code that's been around simply for support for this.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-02-28 15:02:56 UTC
Created attachment 237609 [details] [review]
Don't use constructors to register static modules
Comment 7 Colin Walters 2013-02-28 16:51:11 UTC
Review of attachment 237604 [details] [review]:

Hmm...true.  Involves less I/O too.
Comment 8 Colin Walters 2013-02-28 16:56:38 UTC
Review of attachment 237605 [details] [review]:

Hmmm...I'm kind of curious why this is unused, but OK.
Comment 9 Colin Walters 2013-02-28 16:59:44 UTC
Review of attachment 237606 [details] [review]:

One minor comment.

::: gjs/native.c
@@ -189,3 @@
- * If @filename is %NULL, do not dlopen, assume the library
- * is already loaded in the modules hash table
- */

Why entirely delete the docs when you could just change it to say that it loads a statically linked one?
Comment 10 Colin Walters 2013-02-28 17:00:24 UTC
Review of attachment 237607 [details] [review]:

Makes sense.
Comment 11 Colin Walters 2013-02-28 17:00:54 UTC
Review of attachment 237608 [details] [review]:

That is indeed a nice cleanup.
Comment 12 Colin Walters 2013-02-28 17:03:12 UTC
Review of attachment 237609 [details] [review]:

One build comment, otherwise looks nice.

::: configure.ac
@@ +111,3 @@
   ])
 AM_CONDITIONAL(ENABLE_CAIRO, test x$have_cairo = xyes)
+AC_DEFINE([ENABLE_CAIRO],[$have_cairo],[Define if you want to build with cairo support])

This isn't quite right, because in modules.c you just use #ifdef, but it'll always be defined.
You need to:

AS_IF([test x$have_cairo = xyes], [
  AC_DEFINE([ENABLE_CAIRO],[1],[Define if you want to build with cairo support])
])
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-03-07 21:59:06 UTC
Attachment 237604 [details] pushed as 65257a3 - Statically link in native modules
Attachment 237605 [details] pushed as ad376ca - native: Remove unused argument
Attachment 237606 [details] pushed as aa9fb97 - importer: Remove support for loading external native modules
Attachment 237607 [details] pushed as e01d8a1 - native: Pass the module name to the import call
Attachment 237608 [details] pushed as 9e91b85 - native: Remove support for nested native modules
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-03-07 22:07:59 UTC
Attachment 237609 [details] pushed as 72afb88 - Don't use constructors to register static modules


I think I got the autotools junk correct. Let's see...