Compiling on Snow Leopard
Reported by Sam Barnes | November 25th, 2009 @ 06:48 AM
Build fails ending with:
./spidermonkey/libjs/jsapi.c: In function
‘JS_ConvertArgumentsVA’:
./spidermonkey/libjs/jsapi.c:267: warning: passing argument 5 of
‘TryArgumentFormatter’ from incompatible pointer type
./spidermonkey/libjs/jsapi.c: In function
‘JS_PushArgumentsVA’: ./spidermonkey/libjs/jsapi.c:370:
warning: passing argument 5 of ‘TryArgumentFormatter’
from incompatible pointer type gcc-4.2 -fno-strict-aliasing
-fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall
-Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch
x86_64 -pipe -Ispidermonkey/libjs -Ispidermonkey/Darwin-i386
-I/opt/local/include/nspr
-I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
-c ./spidermonkey/libjs/jsarena.c -o
/Users/sam/temp/./spidermonkey/libjs/jsarena.o -DJS_THREADSAFE
-DPOSIX_SOURCE -D_BSD_SOURCE -Wno-strict-prototypes -DXP_UNIX
In file included from ./spidermonkey/libjs/jsarena.c:49:
./spidermonkey/libjs/jsbit.h:169: error: size of array
‘js_static_assert_line_169’ i
Paul has suggested its an arch issue.
Comments and changes to this ticket
-
Sandman March 17th, 2010 @ 12:42 PM
FWIW, I was able to build successfully on Snow Leopard. Here is what I did:
1) If you build spidermonkey (not python-spidermonkey) from source, copy the jsautocfg.h file it generates over to spidermonkey/Darwin-i386/ (I have attached my copy which you can try out).
2) Edit line 173 of spidermonkey/libjs/jsbit.h to make it as follows: (remove one "long")
JS_STATIC_ASSERT(sizeof(unsigned long) == sizeof(JSUword));
3) Patch jsprf.c per
http://github.com/janl/couchdbx-core/blob/ff47372552d10df00d74cb7989dfed4a19a6040d/patches/js/patch-jsprf.c
That should do it. All the tests seem to run fine. Hope this helps....
-
ilya May 26th, 2010 @ 05:33 AM
- Assigned user cleared.
Thanks, Sandman, for posting your solution -- using your changes I too was able to build successfully on Snow Leopard.
However, when I ran
python setup.py test
I got a mysterious (to me) error:@@@ running test running egg_info
writing python_spidermonkey.egg-info/PKG-INFO
writing top-level names to python_spidermonkey.egg-info/top_level.txt
writing dependency_links to python_spidermonkey.egg-info/dependency_links.txt
reading manifest file 'python_spidermonkey.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README'
writing manifest file 'python_spidermonkey.egg-info/SOURCES.txt'
running build_ext
copying build/lib.macosx-10.5-fat3-2.7/spidermonkey.so ->
Traceback (most recent call last):
File "setup.py", line 190, intest_suite = 'nose.collector',
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.macosx-10.5-fat3/egg/setuptools/command/test.py", line 121, in run File "build/bdist.macosx-10.5-fat3/egg/setuptools/command/test.py", line 101, in with_project_on_sys_path File "build/bdist.macosx-10.5-fat3/egg/setuptools/command/test.py", line 130, in run_tests File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 96, in init
self.runTests()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 228, in runTests
self.result = testRunner.run(self.test)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/runner.py", line 151, in run
test(result)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/suite.py", line 65, in call
return self.run(*args, **kwds)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/suite.py", line 85, in run
self._wrapped_run(result)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/suite.py", line 97, in _wrapped_run
if _isnotsuite(test):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/suite.py", line 259, in _isnotsuite
iter(test)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/suite.py", line 33, in iter
return iter(self._tests)
AttributeError: 'FinalizingSuiteWrapper' object has no attribute '_tests' @@@
Not sure if this is because I'm using Python 2.7 (beta 2), or for some other reason. But, at least, running
python setup.py install
seems to succeed and subsequently the python-spidermonkey examples seem to work =) -
ilya May 26th, 2010 @ 05:35 AM
- Assigned user set to Paul J. Davis
Oops, didn't really mean to clear the assigned user. Also meant to have the error message show up as inline code -- is there a way to edit my post?
-
Paul J. Davis May 26th, 2010 @ 11:50 AM
@ilya
That looks like something related to nosetests. I'm not doing anything weird there. Does nosetests work with 2.7?
-
ilya May 26th, 2010 @ 05:04 PM
@Paul
nosetests
seems to work:> nosetests ........................................................................................................... ---------------------------------------------------------------------- Ran 107 tests in 6.047s OK
(ran this in the
python-spidermonkey
directory) -
Paul J. Davis May 26th, 2010 @ 06:44 PM
I reckon it's just a version inconsistency with the between nose and setuptools or what not then.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Python/JavaScript bridge module, making use of Mozilla's spidermonkey JavaScript implementation. Allows implementation of JavaScript classes, objects and functions in Python, and evaluation and calling of JavaScript scripts and functions respectively. Borrows heavily from Claes Jacobssen's Javascript Perl module, in turn based on Mozilla's 'PerlConnect' Perl binding.