GNOME Bugzilla – Bug 678410
Missing compability for mozjs187-1.0.0 (mozjs187.pc) in configure.ac
Last modified: 2015-10-28 00:26:59 UTC
To reproduce: 1. Build and install spidermonkey (mozjs) 187-1.0.0. 2. Try to build gjs: checking for GJS... no configure: error: Package requirements (gmodule-2.0 gthread-2.0 gobject-introspection-1.0 >= 0.10.1 glib-2.0 >= 2.31.0 gobject-2.0 >= 2.18.0 mozjs185) were not met: No package 'mozjs185' found 3. Notice that the pkg-config file changed from mozjs185.pc to mozjs187.pc
4. After patching configure.ac from mozjs185 to mozjs187 the build fails with: /bin/sh ./libtool --silent --tag=CC --mode=compile x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gobject-introspection-1.0 -I/usr/lib64/libffi-3.0.11/include -I/usr/include/js -I/usr/include/nspr -DGJS_TOP_SRCDIR=\".\" -DGJS_JS_DIR=\"/usr/share/gjs-1.0\" -DGJS_NATIVE_DIR=\"/usr/lib64/gjs-1.0\" -DPKGLIBDIR=\"/usr/lib64/gjs\" -I./gi -DGJS_COMPILATION -Wnested-externs -Wmissing-prototypes -Wsign-compare -Wcast-align -Wpointer-arith -Wmissing-declarations -Wchar-subscripts -Wall -march=native -O2 -pipe -c -o libgjs_la-jsapi-util-error.lo `test -f 'gjs/jsapi-util-error.c' || echo './'`gjs/jsapi-util-error.c modules/console.c: In function 'gjs_console_interact': modules/console.c:201:9: warning: passing argument 2 of 'JS_BufferIsCompilableUnit' makes integer from pointer without a cast [enabled by default] /usr/include/js/jsapi.h:3797:1: note: expected 'JSBool' but argument is of type 'struct JSObject *' modules/console.c:201:9: warning: passing argument 3 of 'JS_BufferIsCompilableUnit' from incompatible pointer type [enabled by default] /usr/include/js/jsapi.h:3797:1: note: expected 'struct JSObject *' but argument is of type 'gchar *' modules/console.c:201:9: warning: passing argument 4 of 'JS_BufferIsCompilableUnit' makes pointer from integer without a cast [enabled by default] /usr/include/js/jsapi.h:3797:1: note: expected 'const char *' but argument is of type 'gsize' modules/console.c:201:9: error: too few arguments to function 'JS_BufferIsCompilableUnit' /usr/include/js/jsapi.h:3797:1: note: declared here modules/console.c:209:16: warning: assignment from incompatible pointer type [enabled by default] modules/console.c:214:13: warning: passing argument 3 of 'JS_ExecuteScript' from incompatible pointer type [enabled by default] /usr/include/js/jsapi.h:3942:1: note: expected 'struct JSScript *' but argument is of type 'struct JSObject *' modules/console.c: In function 'gjs_console_error_reporter': modules/console.c:93:15: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Wunused-result] make[1]: *** [console_la-console.lo] Error 1 make[1]: *** Waiting for unfinished jobs.... gjs/context.c: In function 'gjs_context_constructor': gjs/context.c:578:5: warning: implicit declaration of function 'JS_SetScriptStackQuota' [-Wimplicit-function-declaration] gjs/context.c:578:5: warning: nested extern declaration of 'JS_SetScriptStackQuota' [-Wnested-externs] gjs/byteArray.c: In function 'to_string_func': gjs/byteArray.c:543:14: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] In file included from /usr/include/js/jscntxt.h:50:0, from gjs/jsapi-private.cpp:35: /usr/include/js/jsatom.h:53:23: fatal error: vm/String.h: No such file or directory compilation terminated.
Right now we support the official SpiderMonkey release, 1.8.5. When mozjs187 is official released we will support that, and hopefully drop support for mozjs185.
The mozjs187 tarball does not install the proper headers. It's a broken tarball. https://bugzilla.mozilla.org/show_bug.cgi?id=735599
Created attachment 231320 [details] [review] remove obsolete TRACE_MARK API
Created attachment 231321 [details] [review] build fixes for mozjs187
Created attachment 231322 [details] [review] bump pkgkit version for mozjs
Created attachment 231415 [details] [review] Build fixes These are fixes required for building against js187 but that should also be safe with js185.
Created attachment 231416 [details] [review] js187 build fixes Fixes required for building against js187
Review of attachment 231415 [details] [review]: Most of these look fine to me. ::: gjs/compat.h @@ -33,3 @@ #pragma GCC diagnostic ignored "-Wstrict-prototypes" #pragma GCC diagnostic ignored "-Winvalid-offsetof" -#include <jsapi.h> Why?
with 187 i was getting double declaration issue, since its pulled in via jsdbgapi.h as well
Created attachment 231424 [details] [review] Build fixes These are fixes required for building against js187 but that should also be safe with js185.
Created attachment 231445 [details] [review] tests: Fix a few bad jsval compares
Created attachment 231446 [details] [review] tests: Don't use deprecated/removed API
Review of attachment 231445 [details] [review]: Ok.
Review of attachment 231446 [details] [review]: Makes sense.
Review of attachment 231416 [details] [review]: This patch changes the default version - not ready to do that yet. Patches to support both are more interesting.
Colin, that patch 231416 was not intended for merging, more just testing. I will update it to handle both cases, when js187 is officially released or atleast fixed (there are a couple of issues with the current tarball)
Review of attachment 231424 [details] [review]: OK.
Attachment 231445 [details] pushed as 8bb712b - tests: Fix a few bad jsval compares Attachment 231446 [details] pushed as 1c14de0 - tests: Don't use deprecated/removed API OK, these should not have any effect on the gjs build against mozjs187.
er, against mozjs185
(In reply to comment #4) > Created an attachment (id=231320) [details] [review] > remove obsolete TRACE_MARK API This should be reverted: the trace_mark API is obsolete in js 187, not js 185, and indeed removing the flag in js185 causes a segmentation fault at GC time.
I assume this is all set now.