Rev 1167 fails to start under linux
Moderators: winston, another_commander, Getafix
Rev 1167 fails to start under linux
Rev 1167 fails to start under linux, after building the debian (For Unstable) packages. It seems to be an assert in the Javascript engine. The console tells me:
oolite: src/Core/Scripting/OOJavaScriptEngine.m:565: -[OOJavaScriptEngine init]: Assertion `JS_CStringsAreUTF8()' failed.
oolite: src/Core/Scripting/OOJavaScriptEngine.m:565: -[OOJavaScriptEngine init]: Assertion `JS_CStringsAreUTF8()' failed.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
New code for JavaScript has been incorporated by Ahruman very recently. The requirement to run this new code is to utilize the SpiderMonkey JavaScript library version 1.70, compiled with the JS_C_STRINGS_ARE_UTF8 macro defined.
This means, that you will have to rebuild libjs (I don't remember exactly how it is called in Linux). The 1.70 JavaScript source code is already inserted in the SVN main tree, but as far as I know there is no Linux binary version available yet. Any versions older than 1.70 will most likely fail to work.
This means, that you will have to rebuild libjs (I don't remember exactly how it is called in Linux). The 1.70 JavaScript source code is already inserted in the SVN main tree, but as far as I know there is no Linux binary version available yet. Any versions older than 1.70 will most likely fail to work.
I have version 1.8.1-- It must not have that macro defined. I suppose I could rebuild that .deb from source...another_commander wrote:New code for JavaScript has been incorporated by Ahruman very recently. The requirement to run this new code is to utilize the SpiderMonkey JavaScript library version 1.70, compiled with the JS_C_STRINGS_ARE_UTF8 macro defined.
This means, that you will have to rebuild libjs (I don't remember exactly how it is called in Linux). The 1.70 JavaScript source code is already inserted in the SVN main tree, but as far as I know there is no Linux binary version available yet. Any versions older than 1.70 will most likely fail to work.
It seems to be a little bit more complicated than this. The Debian maintainers have done something to the code. Frankly it's a little (lottle?) bit over my head:
http://groups.google.com/group/mozilla. ... f7a0999b12
I'm going to try and uninstall the Debian version and get the "official" version from Sourceforge.
http://groups.google.com/group/mozilla. ... f7a0999b12
I'm going to try and uninstall the Debian version and get the "official" version from Sourceforge.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
That message refers to another issue, which is caused by a change in the data layout used by SpiderMonkey. It is important to build against the same headers used to build the SpiderMonkey library, in particular the same jsautocfg.h. I’d suggest building it as a static library using the source in {oolite-src}/deps/Cross-platform-deps/SpiderMonkey/js. (Sorry, should’ve mentioned that earlier.)
E-mail: [email protected]
Thanks. However Please, I need some more help.
I ran make in that directory, seems to have gone OK. I then ran
dpkg-buildpackage in the oolite trunk directory and installed the debs. I still got the same error.
Having run make on the js, is there something else I need to do? I'm sure there is but don't know/cannot remember what.
I ran make in that directory, seems to have gone OK. I then ran
dpkg-buildpackage in the oolite trunk directory and installed the debs. I still got the same error.
Having run make on the js, is there something else I need to do? I'm sure there is but don't know/cannot remember what.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
I do not know how exactly you have built it, so I will try to give some basic guidance. Please forgive me if instructions below sound too simplistic or self evident.
As a first step, I would recommend doing a full rebuild of Oolite. This way, no previously compiled object files can possibly cause problems.
Then, ensure that somewhere in your makefile, where you set the compiler options, you add this definition:
-DJS_C_STRINGS_ARE_UTF8
This is necessary, because the macro is not defined anywhere, although there are plenty of places where #ifdefs containing it exist. Also note, that the file called makefile that resides in deps/Cross-platform-deps/SpiderMonkey/js/src is made for Windows and certain defines in it will need to be changed accordingly for Linux. If you just used that, without any modification, then complications are very likely. But you can use it to see how things have to be set. Remember that before building the js shared library, you must build fdlibm.
If you were using a different makefile, please post it here. Maybe we can find out what could be wrong with it.
As a first step, I would recommend doing a full rebuild of Oolite. This way, no previously compiled object files can possibly cause problems.
Then, ensure that somewhere in your makefile, where you set the compiler options, you add this definition:
-DJS_C_STRINGS_ARE_UTF8
This is necessary, because the macro is not defined anywhere, although there are plenty of places where #ifdefs containing it exist. Also note, that the file called makefile that resides in deps/Cross-platform-deps/SpiderMonkey/js/src is made for Windows and certain defines in it will need to be changed accordingly for Linux. If you just used that, without any modification, then complications are very likely. But you can use it to see how things have to be set. Remember that before building the js shared library, you must build fdlibm.
If you were using a different makefile, please post it here. Maybe we can find out what could be wrong with it.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
You’re probably still linking against the shared-library version of libjs installed on your system. You will probably need to modify the makefile for libjs to produce a static library, and modify the Oolite makefile to use it. Since I don’t use makefiles, I can’t really offer any more specific advice.
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
I knew there was something I’d forgotten to say… the issue mentioned in the Usenet post you linked to is controlled by the macro MOZILLA_1_8_BRANCH, which should be defined when building both libjs and Oolite, or not defined when building either, but definitely must not be defined when building one but not when building the other. I recommend defining it, although I think it will work without.
E-mail: [email protected]
I'm lost in witch space and need a Leviathan to rescue me!
Despite having time on my hands (enforced "take it easy" after a minor procedure) I have not been able to get anywhere with this problem.
My present situation: Any version after 1155 exits on startup because of this issue.
My question: Could somebody please expand on the info above to enable me to run the later builds of Oolite.
Despite having time on my hands (enforced "take it easy" after a minor procedure) I have not been able to get anywhere with this problem.
My present situation: Any version after 1155 exits on startup because of this issue.
My question: Could somebody please expand on the info above to enable me to run the later builds of Oolite.
This is in the makefile.Then, ensure that somewhere in your makefile, where you set the compiler options, you add this definition:
-DJS_C_STRINGS_ARE_UTF8
What's this please and how do I do it?Remember that before building the js shared library, you must build fdlibm.
I assume that this means that I need to do more than run Make.It is important to build against the same headers used to build the SpiderMonkey library, in particular the same jsautocfg.h. I’d suggest building it as a static library using the source in {oolite-src}/deps/Cross-platform-deps/SpiderMonkey/js.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
fdlibm is a math library for machines that support IEEE 754 floating point arithmetic. libjs is using it as a dependency and therefore requires it in order to build. I am actually a bit surprised that you got to build libjs without building fdlibm first. As Ahruman has already pointed out earlier, are you absolutely sure that you are not linking against any previously installed libraries? The source of this library is included in the trunk under deps/Cross-platform-deps/SpiderMonkey/js/src/fdlibm. You build this, then you point the libjs makefile to where the library has been created in order for libjs to use it to link. Have a look at the makefile in the above folder, but be aware that it contains Windows specific defines.davcefai wrote:What's this please and how do I do it?Remember that before building the js shared library, you must build fdlibm.
In addition, be sure that all headers and libraries from the SVN version of libjs are visible to the compiler before any other, previously installed version equivalents.
I am sorry I cannot be more specific, I am afraid I don't know that much about Linux. If you can, please post the makefile you are using, just in case there is something very obviously strange with it.