[SERVER-2887] SpiderMonkey 1.8.5 support Created: 01/Apr/11  Updated: 29/Feb/12  Resolved: 29/Aug/11

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 1.8.0
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Per Øyvind Karlsen Assignee: Unassigned
Resolution: Won't Fix Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mandriva Linux


Participants:

 Description   

Here's a patch that adds SpiderMonkey 1.8.5 support for 1.8.0:
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/mongodb/current/SOURCES/mongodb-1.8.0-spidermonkey-1.8.5-support.patch?view=log



 Comments   
Comment by Eliot Horowitz (Inactive) [ 29/Aug/11 ]

As of 2.0.0-rc0 the mongo sources include spidermonkey 1.7.0 which is the version we want to use for now.
This should mean no patches are needed for any system.

In 2.2, we're likely moving to v8.

Comment by Chris Lalancette [ 29/Jul/11 ]

We are carrying a similar patch in Fedora to get MongoDB 1.8.2 to build there. It would be nice to get this fixed in the upstream sources.

Comment by Thomas Dziedzic [ 21/Jul/11 ]

another thing to point out:
https://bugzilla.mozilla.org/show_bug.cgi?id=628723#c48

latest js supports unicode, but the new way to support them is through a function call before initializing the api, see above link for details on how to turn on unicode for js strings.

Comment by Thomas Dziedzic [ 10/Jul/11 ]

also another side note, mozjs185 doesn't support utf8 so when starting mongo, it will give off a warning that spidermonkey doesn't support utf8

related BR for archlinux:
https://bugs.archlinux.org/task/25066
FS#25066 - js lib compiled without UTF8 support

Comment by Thomas Dziedzic [ 06/Jul/11 ]

Another side note, the output of "pkg-config --cflags --libs mozjs185" is:
-I/usr/include/js -I/usr/include/nspr -lmozjs185 -lplds4 -lplc4 -lnspr4 -lpthread -ldl

Comment by Thomas Dziedzic [ 05/Jul/11 ]

This is a more proper patch to include mozjs185 support.
https://gist.github.com/1064953 just apply it after applying mandriva's

Comment by Thomas Dziedzic [ 02/Jul/11 ]

archlinux maintainer here,
It would be nice to have this get more priority.

1.8.5 has been released more then a month ago, and we're currently looking into moving to (spidermonkey) js 1.8.5 soon

edit: Applying the above patch still fails for me:
g++ -o scripting/engine_spidermonkey.o -c -Wnon-virtual-dtor -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -fno-builtin-memcmp -O3 -D_SCONS -DMONGO_EXPOSE_MACROS -DXP_UNIX -DHAVE_COMPARTMENTS -DHAVE_JS_GET_STRING_CHARS_AND_LENGTH -DJS_NEW_REG_EXP_OBJECT_NO_STATISTICS -I. scripting/engine_spidermonkey.cpp
In file included from /usr/include/js/jsobj.h:63:0,
from scripting/engine_spidermonkey.h:55,
from scripting/engine_spidermonkey.cpp:19:
/usr/include/js/jslock.h:47:21: fatal error: pratom.h: No such file or directory

The patch is incomplete.

mandriva patches their mongodb sconstruct file to read CPPFLAGS from the environment and they add export CPPFLAGS="`pkg-config --cflags mozjs185`" to the spec file.
This needs to get fixed in the upstream mongodb sconstruct file!

Generated at Thu Feb 08 03:01:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.