Oolite 1.90 manual build produces incorrect binary or config

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: winston, another_commander, Getafix

Post Reply
hooky-mars
Average
Average
Posts: 9
Joined: Sun Mar 05, 2023 3:11 pm

Oolite 1.90 manual build produces incorrect binary or config

Post 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!
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: Oolite 1.90 manual build produces incorrect binary or config

Post 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).
hooky-mars
Average
Average
Posts: 9
Joined: Sun Mar 05, 2023 3:11 pm

Re: Oolite 1.90 manual build produces incorrect binary or config

Post 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
Last edited by hooky-mars on Mon Mar 06, 2023 3:34 pm, edited 1 time in total.
hooky-mars
Average
Average
Posts: 9
Joined: Sun Mar 05, 2023 3:11 pm

Re: Oolite 1.90 manual build produces incorrect binary or config

Post by hooky-mars »

may be I need to build mozjs in some special way? I've used already existen js libs in system
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Oolite 1.90 manual build produces incorrect binary or config

Post 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.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Oolite 1.90 manual build produces incorrect binary or config

Post by Cody »

And welcome aboard, Commander!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: Oolite 1.90 manual build produces incorrect binary or config

Post 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".
hooky-mars
Average
Average
Posts: 9
Joined: Sun Mar 05, 2023 3:11 pm

Re: Oolite 1.90 manual build produces incorrect binary or config

Post 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
hooky-mars
Average
Average
Posts: 9
Joined: Sun Mar 05, 2023 3:11 pm

Re: Oolite 1.90 manual build produces incorrect binary or config

Post 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!
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Oolite 1.90 manual build produces incorrect binary or config

Post 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.
Sunshine - Moonlight - Good Times - Oolite
Post Reply