Page 1 of 1

spring 0.82.7.1 on Mac OS

Posted: 03 Feb 2011, 16:43
by daftalx
Since I'm having only very little time to work on the project these days, I'll be creating a thread like this one for each new source release to help spring devs work out cross-platform issues (and let them know that spring on Mac still lives :-) )

So as usual, all depending libraries have been installed via MacPorts, as seen on this tutorial. Project is then ccmaked "as is" and maked with -j option.

The good news is there's only one error left:
[code]Building CXX object AI/Skirmish/KAIK/CMakeFiles/KAIK.dir/__/__/__/rts/lib/lua/src/lapi.cpp.o
In file included from .../spring_0.82.7.1/rts/lib/lua/src/lapi.h:11,
from .../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:19:
.../spring_0.82.7.1/rts/lib/lua/src/lobject.h:204: error: ÔÇÿlua_HashÔÇÖ does not name a type
In file included from .../spring_0.82.7.1/rts/lib/lua/src/ldebug.h:11,
from .../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:20:
.../spring_0.82.7.1/rts/lib/lua/src/lstate.h:96: error: ÔÇÿlua_Func_fopenÔÇÖ does not name a type
.../spring_0.82.7.1/rts/lib/lua/src/lstate.h:97: error: ÔÇÿlua_Func_popenÔÇÖ does not name a type
.../spring_0.82.7.1/rts/lib/lua/src/lstate.h:98: error: ÔÇÿlua_Func_pcloseÔÇÖ does not name a type
.../spring_0.82.7.1/rts/lib/lua/src/lstate.h:99: error: ÔÇÿlua_Func_systemÔÇÖ does not name a type
..../spring_0.82.7.1/rts/lib/lua/src/lstate.h:100: error: ÔÇÿlua_Func_removeÔÇÖ does not name a type
.../spring_0.82.7.1/rts/lib/lua/src/lstate.h:101: error: ÔÇÿlua_Func_renameÔÇÖ does not name a type
In file included from .../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:27:
.../spring_0.82.7.1/rts/lib/lua/src/lstring.h:30: error: ÔÇÿlua_HashÔÇÖ has not been declared
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: In function ÔÇÿbool lua_toboolean(lua_State*, int)ÔÇÖ:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:338: error: new declaration ÔÇÿbool lua_toboolean(lua_State*, int)ÔÇÖ
/opt/local/include/lua.h:148: error: ambiguates old declaration ÔÇÿint lua_toboolean(lua_State*, int)ÔÇÖ
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: At global scope:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:466: error: ÔÇÿlua_HashÔÇÖ has not been declared
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1111: error: ÔÇÿlua_Func_fopenÔÇÖ has not been declared
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: In function ÔÇÿvoid lua_set_fopen(lua_State*, int)ÔÇÖ:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1112: error: ÔÇÿstruct global_StateÔÇÖ has no member named ÔÇÿfopen_funcÔÇÖ
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: At global scope:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1116: error: ÔÇÿlua_Func_popenÔÇÖ has not been declared
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1117: error: ÔÇÿlua_Func_pcloseÔÇÖ has not been declared
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: In function ÔÇÿvoid lua_set_popen(lua_State*, int, int)ÔÇÖ:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1119: error: ÔÇÿstruct global_StateÔÇÖ has no member named ÔÇÿpopen_funcÔÇÖ
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1120: error: ÔÇÿstruct global_StateÔÇÖ has no member named ÔÇÿpclose_funcÔÇÖ
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1122: error: ÔÇÿstruct global_StateÔÇÖ has no member named ÔÇÿpopen_funcÔÇÖ
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1123: error: ÔÇÿstruct global_StateÔÇÖ has no member named ÔÇÿpclose_funcÔÇÖ
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: At global scope:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1128: error: ÔÇÿlua_Func_systemÔÇÖ has not been declared
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: In function ÔÇÿvoid lua_set_system(lua_State*, int)ÔÇÖ:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1129: error: ÔÇÿstruct global_StateÔÇÖ has no member named ÔÇÿsystem_funcÔÇÖ
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: At global scope:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1133: error: ÔÇÿlua_Func_removeÔÇÖ has not been declared
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: In function ÔÇÿvoid lua_set_remove(lua_State*, int)ÔÇÖ:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1134: error: ÔÇÿstruct global_StateÔÇÖ has no member named ÔÇÿremove_funcÔÇÖ
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: At global scope:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1138: error: ÔÇÿlua_Func_renameÔÇÖ has not been declared
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp: In function ÔÇÿvoid lua_set_rename(lua_State*, int)ÔÇÖ:
.../spring_0.82.7.1/rts/lib/lua/src/lapi.cpp:1139: error: ÔÇÿstruct global_StateÔÇÖ has no member named ÔÇÿrename_funcÔÇÖ
make[2]: *** [AI/Skirmish/KAIK/CMakeFiles/KAIK.dir/__/__/__/rts/lib/lua/src/lapi.cpp.o] Error 1
make[1]: *** [AI/Skirmish/KAIK/CMakeFiles/KAIK.dir/all] Error 2
[/code]
Strangely, lobject.h does have an 'include "lua.h"' line where lua_Hash and lua_Func_* are defined.

The bad news is that now spring crashes at startup, before the window opens (I'm not "make install"ing, but launching spring from the build folder right away). gdb / bt give:
[code]#0 0x00007fff8709ed55 in __cxxabiv1::__pbase_type_info::__do_catch ()
#1 0x00007fff8709d16e in get_adjusted_ptr ()
#2 0x00007fff8709d8de in __gxx_personality_v0 ()
#3 0x00007fff832a11f1 in _Unwind_RaiseException ()
#4 0x00007fff8709dbef in __cxa_throw ()
#5 0x00007fff885ab192 in objc_exception_throw ()
#6 0x00007fff8739a969 in -[NSException raise] ()
#7 0x00007fff844264b5 in -[NSWindow _commonAwake] ()
#8 0x00007fff8442316e in -[NSWindow _commonInitFrame:styleMask:backing:defer:] ()
#9 0x00007fff84421dfa in -[NSWindow _initContent:styleMask:backing:defer:contentView:] ()
#10 0x00007fff84421883 in -[NSWindow initWithContentRect:styleMask:backing:defer:] ()
#11 0x00000001011dec0d in -[SDL_QuartzWindow initWithContentRect:styleMask:backing:defer:] ()
#12 0x00000001011dc0e4 in QZ_SetVideoMode ()
#13 0x00000001011d325f in SDL_SetVideoMode ()
#14 0x000000010050e55e in SpringApp::SetSDLVideoMode (this=0x7fff5fbff860) at .../spring_0.82.7.1/rts/System/SpringApp.cpp:396
#15 0x000000010050edc1 in SpringApp::InitWindow (this=0x7fff5fbff860, title=0x102e49c58 "Spring 0.82.7") at .../spring_0.82.7.1/rts/System/SpringApp.cpp:355
#16 0x000000010051442b in SpringApp::Initialize (this=0x7fff5fbff860) at .../spring_0.82.7.1/rts/System/SpringApp.cpp:173
#17 0x0000000100514a11 in SpringApp::Run (this=0x7fff5fbff860, argc=1, argv=0x7fff5fbff988) at .../spring_0.82.7.1/rts/System/SpringApp.cpp:1153
#18 0x00000001005049e2 in Run (argc=1, argv=0x7fff5fbff988) at .../spring_0.82.7.1/rts/System/Main.cpp:55
#19 0x000000010003eac8 in start () at iostream:77
[/code]
Apparently it still is a SDL-related issue... (sigh)
Well, that's it for now. Your turn :wink:

Re: spring 0.82.7.1 on Mac OS

Posted: 08 Feb 2011, 01:58
by phas
abma found that you can solve the crash adding

include "SDL_main.h"

to

rts/System/Main.cpp

and recompiling

Re: spring 0.82.7.1 on Mac OS

Posted: 08 Feb 2011, 09:20
by daftalx
(partial) success !
Adding the include indeed solves the crash, yet now the headless builds fail to link as they don't use SDL_main.

At least for the general player, spring now works.
Cheers !

daft

Re: spring 0.82.7.1 on Mac OS

Posted: 08 Feb 2011, 12:07
by phas
Well, abma and me had a game and there were sync problems. Apart from that mac ports springlobby has really a lot of issues and qtlobby doesn't compile. So, in my opinion we're still far to be really playable.

Still, this is a giant leap forward. I'm going to try to produce a binary installer or an app bundle, do you want to help me?

Re: spring 0.82.7.1 on Mac OS

Posted: 08 Feb 2011, 17:18
by daftalx
phas wrote:Well, abma and me had a game and there were sync problems. Apart from that mac ports springlobby has really a lot of issues and qtlobby doesn't compile. So, in my opinion we're still far to be really playable.
Hmm, I'd say it's all about each and everyone's perspective, but the 0.81.2.1 + SL0.95 couple have been working decently for some time (until major MacPorts upgrades), and were definitely playable (never had any sync issues even on large battles). QtLobby hasn't been maintained for months, and compatibility died with the latest qt-mac upgrade. There's nothing else to do other than taking over the source code and reviving the project (if you care).
phas wrote:Still, this is a giant leap forward. I'm going to try to produce a binary installer or an app bundle, do you want to help me?
Help is always appreciated. Though since I don't know you're background on the "Spring on Mac" affair (you seem new to the forum), I'm just not quite sure who needs help in what here...
  • Did you know that SpringLobby already comes as a .app bundle for Mac when you build them (both sl and settings) ?
  • If you already know how to make a .app bundle and wish to try it your way, I'm afraid I don't really see where I can help. You'll have anyway to recompile stuff on your side and get dependent libraries altogether (which will most probably push you through MacPorts anyway)
Up to now the MacPorts solution has been the most efficient way to get recent builds to the users (at the expense of a few terminal commands) due to the huge number of libraries needed to build/run. In my opinion the port isn't stable enough to move the .app bundle. I do know however that the MacPorts system lets you create .app bundles... which is where you might want to have a look if you don't know where to start :wink:

Re: spring 0.82.7.1 on Mac OS

Posted: 21 Jun 2011, 01:31
by Guillaume Outters
I have managed to create an all-self-contained Mac app, which is a SpringLobby.app that includes SpringLobby (0.131), spring (0.82.7.1) and all their required libraries; it embeds one mod (XTA) and two maps (Tropical and Levels v2) as a proof-of-concept of embedding minimal contents (so that the user can single-play as soon as the app is there).

It is fully user oriented (that is, the user just has to double-click on it, no Terminal required: springlobby launches prewired to its libunitsync and spring, the "proof-of-concept" mods and maps are already available without configuration (although adding more via ~/.spring works); it works on both Leopard and Snow Leopard, and is a 32 and 64 bits build). When running a TASServer (not included!), I could play a game on LAN between a 10.6 iMac and a 10.5 MacBook. I played as well (well, spectated) to games on the official server.

It is fully buildbot oriented too (see compilation details below).

I would be glad to know if people are interested in this kind of end-user packaging, and in integrating it to a buildbot.

The generated downloadable is here:
http://ks31107.kimsufi.com/gui/spring/S ... by.app.zip
(note: the only problem is that Safari seems to garble the Zip while expanding it; curling the URL and then opening it in the Finder works great, though)

Compilation details:
The compilation / packaging environment is a suite of shell scripts I have been writing and enhancing for years, a bit similar to what MacPorts does (except mine only rely on whatever resides on my dev computer, but I think Apple's Dev Tools, Java, and some basic GNU tools are the only requirement; no root needed.
Specifically, those scripts download, patch, configure, compile and install to a centralized directory, then package, with no human interaction (except launching them from a simple export INSTALLS=/tmp/build SANSSU=1 ; ./springapp, after having possibly cleant /tmp from preceding builds).
Patches consist of some modifications to the software (first to make it compile, then to add features like automagical sibling libraries and data discovery, and so on).
Main entry point is a script called springapp that calls the other ones required, then creates the application; each package script is independant. All rely on a util.sh (and sometimes util.bash) for common functions; util.sh defines three variables that control where everything will go (downloaded source packages cache, compilation directory, and installation directory).
Oh, and every comment and function name is in french. Damn crazy french programmers (hey, doesn't everybody love to include some litterature of its own language in his source code?)
Here is the whole thing:
http://ks31107.kimsufi.com/gui/spring/installs.tar.gz

I am not willing to install MacPorts on my computer, but, if anyone is interested in porting my packaging script to create a MacPorts-generated spring and springlobby application, I will gladly help. Hmm, by the way, does MacPorts produces cross-OS-version executables and libraries?

--
Guillaume

Re: spring 0.82.7.1 on Mac OS

Posted: 21 Jun 2011, 02:23
by aegis
launching the whole app is an instant segfault in lion, though opening it and running spring manually works perfectly

Re: spring 0.82.7.1 on Mac OS

Posted: 21 Jun 2011, 10:56
by Guillaume Outters
OK, thanks.

So, good news is, there seems to be a lot of ways to get a working spring (MacPorts or no MacPorts, it seems that everybody finds a way) even working on Lion (that's a new news for me). Bad news is, SpringLobby fails (the enclosing bundle is SpringLobby). In my scripts, the SpringLobby part had to be i386-only (I think wx didn't like x86_64, or something like that).

Could you please try to run it from Terminal (something like ~/Downloads/SpringLobby.app/Contents/MacOS/springlobby) to get an idea of the problem (it may tell that "symbol xxxx could not be found in library xxxx as expected")?

Re: spring 0.82.7.1 on Mac OS

Posted: 21 Jun 2011, 13:04
by hoijui
wow.. nice! :-)
i do not know the mac world, but i always imagined that an .app bundle is the easiest way to install something, and knowing a few non-tech-safe mac users myself, this is the absolute maximum they are able to do for installing an application.

it would be best if you could join the spring dev channel (#sy) on the lobby (#taspring on irc.freenode.net is linked to it), so we could discuss things further. best time is evening time in Europe.

we would have to port your stuff to the current development version, and it would have to be done with git, eventually.
in my experience, french coders are the single most successful in writing source in their native language. ;-)
i hate it!

Re: spring 0.82.7.1 on Mac OS

Posted: 21 Jun 2011, 15:40
by aegis
console output: http://pastebin.com/CBViMRmF
crash report: http://pastebin.com/yp02Bi86

Code: Select all

$ uname -a
Darwin nightshade 11.0.0 Darwin Kernel Version 11.0.0: Mon Jun 13 11:33:28 PDT 2011; root:xnu-1699.22.70~3/RELEASE_X86_64 x86_64

Re: spring 0.82.7.1 on Mac OS

Posted: 21 Jun 2011, 15:57
by Guillaume Outters
Thank you, aegis. So, a wx problem, with a bit of carbon in it; we're working on integrating the whole process to the official Spring source, and it involves upgrading wx, so hopefully this could make the crash go away ( or later. Or sooner. Who knows).

Re: spring 0.82.7.1 on Mac OS

Posted: 21 Jun 2011, 16:05
by aegis
it doesn't run well enough to warrant a full setup, nice for now having a self-contained spring for widget dev :)

Re: spring 0.82.7.1 on Mac OS

Posted: 21 Jun 2011, 16:20
by Guillaume Outters
Hem, not sure I used the right words I meant, using a more recent version of wx to compile SpringLobby not upgrading wx internally to make it usable. Sorry for the false hope! ;-)

Re: spring 0.82.7.1 on Mac OS

Posted: 25 Jun 2011, 23:11
by AF
This coupled with an OS X version of archive mover would be perfect!