Page 1 of 1

Oolite 1.90 manual build produces incorrect binary or config

Posted: Mon Mar 06, 2023 7:07 am
by hooky-mars
Hi Everyone!

I'm trying to build Oolite manualy it success but when I try to start it it crashes with an exception:

Code: Select all

20:50:56.275 [gnustep]: 2023-03-05 20:50:56.275 oolite[161474:161474] src/Core/Scripting/OOJavaScriptEngine.h:121  Assertion failed in OOJSAcquireContext.  Attempt to use JavaScript context before JavaScript engine is initialized.

20:50:56.275 [startup.exception]: ***** Unhandled exception during startup: NSInternalInconsistencyException (src/Core/Scripting/OOJavaScriptEngine.h:121  Assertion failed in OOJSAcquireContext.  Attempt to use JavaScript context before JavaScript engine is initialized.).
Should I build it with some special flags or macroses or whatever?
Thanks!

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Mon Mar 06, 2023 2:42 pm
by Commander_X
As a result of your compilation you should have an "oolite.app" folder under your build folder, which should contain "oolite" (the "exe" file), and a "Resources" folder.
For running, you'd have to use the same libraries the compiler used when created the executable "oolite". Some of these libraries should be part of your OS (i.e. /usr/lib[64], and/or /usr/local/lib[64]) some will come from the dependencies recommended to use (those under "deps/Linux-deps" in the source tree). Also a necessity might be to run the GNUstep's initialization script before starting Oolite.
It could be interesting to know if the errors you show from the Latest.log file were accompanied by other errors that in the terminal/console window (i.e. try to start the game from a terminal and check if there are any complaints there, too).

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Mon Mar 06, 2023 3:26 pm
by hooky-mars
I do not see any errors in terminal if I start pipeware services before oolite

I've tried different libs from linux-deps from system with GNUstep env and not
folder structure looks OK.

Nothing changed. The same issue for all cases

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Mon Mar 06, 2023 3:33 pm
by hooky-mars
may be I need to build mozjs in some special way? I've used already existen js libs in system

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Mon Mar 06, 2023 4:35 pm
by another_commander
Can you please provide some information about what exact steps you follow to compile?

The Linux build was switched to statically linking with the mozilla spidermonkey some time ago because at some point all the compile error reports we were getting for Linux had to do with libjs and its different incarnations accross distros and local setups. The static link with the library we are providing ensures that the actual libjs that we want is going to be linked and embedded in the executable.

Without claiming to have any Linux knowledge, my recommendation would be to ensure that you are linking with the static library in oolite-linux-dependencies/x86_64/mozilla/. The headers corresponding to that library are also included in that same folder. Building your own libjs should not be required anymore.

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Mon Mar 06, 2023 5:07 pm
by Cody
And welcome aboard, Commander!

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Tue Mar 07, 2023 2:09 am
by Commander_X
Yes, what another_commander stated above seems about right. If you compiled with the static version of mozjs, having the javascript engine initialized would be your last concern :)
For the record, following most of the instructions in the README.md file of the source code, 2 options I usually pass to make at compilation time are "debug=no use_deps=yes".

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Tue Mar 07, 2023 7:30 am
by hooky-mars
Thanks Commanders! )))

I still cannot fix the issue ((
Builds steps are:
  • apply a patch:

Code: Select all

diff --git a/GNUmakefile b/GNUmakefile
index 280e371..50ff41d 100755
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -70,7 +70,7 @@ else
 
     ADDITIONAL_INCLUDE_DIRS      = -I$(LIBJS_INC_DIR) -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables -Isrc/Core/MiniZip -Ideps/Linux-deps/include 
     ADDITIONAL_OBJC_LIBS         = $(OOLITE_SHARED_LIBS) -lGLU -lGL -lX11 -lSDL -lgnustep-base -L$(LIBJS_DIR) -l$(LIBJS) -lopenal -lz -lvorbisfile -lpng `nspr-config --libs` -lstdc++ 
-    ADDITIONAL_OBJCFLAGS         = -Wall -std=gnu99 -DLOADSAVEGUI -DLINUX -DXP_UNIX -Wno-import `sdl-config --cflags` `nspr-config --cflags`
+    ADDITIONAL_OBJCFLAGS         = -Wall -std=gnu99 -DLOADSAVEGUI -DLINUX -DXP_UNIX -Wno-import `sdl-config --cflags` `nspr-config --cflags` -fobjc-exceptions
     ADDITIONAL_CFLAGS            = -Wall -DLINUX -DNEED_STRLCPY `sdl-config --cflags` `nspr-config --cflags`
 
     ifeq ($(ESPEAK),yes)
  • change objc/ to objc2/

Code: Select all

for i in $(find ./ -type f -name "*.m"); do
	sed -i 's|objc/|objc2/|g' $i ||:
done
  • build

Code: Select all

. /usr/share/GNUstep/Makefiles/GNUstep.sh

make -e debug=no messages=yes use_deps=yes -f Makefile release -j$(nproc)
  • run

Code: Select all

. /usr/share/GNUstep/Makefiles/GNUstep.sh
cd to oolite path
./oolite
oolite.app structure:

Code: Select all

./Resources
./Resources/Scripts
./Resources/Scripts/<big list of js scripts>
./Resources/InfoPlist.strings
./Resources/Music
./Resources/Music/OoliteTheme.ogg
./Resources/Music/BlueDanube.ogg
./Resources/README.TXT
./Resources/oolite-icon.icns
./Resources/Textures
./Resources/Textures/<big list of textures>
./Resources/Shaders
./Resources/Shaders/<list of shaders>
./Resources/Images
./Resources/Images/<list of images>
./Resources/Models
./Resources/Models/<big list of models>
./Resources/Info-gnustep.plist
./Resources/AIs
./Resources/AIs/<big list of AIs>
./Resources/oolite-document.icns
./Resources/AIReference.html
./Resources/Scenarios
./Resources/Scenarios/<list of scenarios>
./Resources/Sounds
./Resources/Sounds/<big list of sounds>
./Resources/oolite-expansion-document.icns
./Resources/Config
./Resources/Config/<big list of configs>
./oolite
./Contents

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Tue Mar 07, 2023 8:06 am
by hooky-mars
Hi Commaders!

I think I found the issue. I deleted gpu-settings.plist in the oolite.app folder. When I've restored it oolite starts without any crash.

I deleted the file because it do not allow to start oolite on PC with some nvidia video cards....

Thanks for your help!

Re: Oolite 1.90 manual build produces incorrect binary or config

Posted: Mon Mar 13, 2023 6:46 am
by hiran
If this experience could be collected into a Github Workflow at https://github.com/OoliteProject/oolite ... /workflows it would be a real asset. Github would then automatically build the Linux version upon each an every change.