stuntrally / stuntrally3

3D racing game with own Track Editor. The main repository with Stunt Rally 3 sources and data. Continuation of Stunt Rally 2.x using Ogre-Next 3.0.
https://stuntrally.tuxfamily.org/
GNU General Public License v3.0
103 stars 7 forks source link

Making Linux binary or AppImage #25

Closed cryham closed 4 months ago

cryham commented 5 months ago

I already wrote info on Ogre forum. Some links are there too and 1 suggestion. So far whatever I do I end up with just segfault at start, with no real info what's wrong. The issue is not with AppImage but because my binary isn't portable and it can't start.

Seems copying all needed .so files from ldd output, from my system to new lib/ dir isn't good. I looked already at SuperTuxKart, Xonotic, RigsOfRods, speed-dreams*.AppImage, these all work. But I still don't get which libs should I provide and which not, also should I build on old VM, or build as static, IDK what to do yet. I'm guessing I need to read and consider all that. We also had a VM setup for old SR binary builds, maybe worth trying again: https://github.com/stuntrally/stuntrally/tree/master/dist/linux-archive

I'm also trying with my smaller project cAmp2, also no luck: ./cAmp2: ./libc.so.6: version `GLIBC_2.38' not found (required by /usr/lib/libX11.so.6

So anyone having some experience or hints?

Calinou commented 5 months ago

I'm also trying with my smaller project cAmp2, also no luck: ./cAmp2: ./libc.so.6: version `GLIBC_2.38' not found (required by /usr/lib/libX11.so.6

This is likely because the binary was built on a Linux distribution that is too new compared to your current distribution. This is why you need to build on an old Linux distribution for the binary to be portable. Typically, the oldest still-supported Ubuntu LTS version is a good baseline for this (currently 20.04).

cryham commented 5 months ago

Ah okay, thank you. So I need that VM for building set up.

cryham commented 5 months ago

Ok I made a VM from Kubuntu-20.04.6.iso Followed newly updated Building.md which now uses this nice python script I wrote to build SR3 with deps. SR3 did build fine there. I can start it, but yeah it's a VM so somewhat starts even, got Gui, don't see map, 10 Fps, whatever.

Then I did this, which copies all needed .so: ldd stuntrally3 | awk 'NF == 4 { system("cp " $3 " .") }' Got all files back and I'm trying to start on my Debian 12 now: Got this now, ugh what would that mean?

Inconsistency detected by ld.so: dl-call-libc-early-init.c: 37: _dl_call_libc_early_init: Assertion `sym != NULL' failed!

I guess I copied too many .so? It's like 95 new lib* files from that VM system. How do I know which should I use from that VM and which should not be here?

cryham commented 5 months ago

Ok I'm studying our old linux-archive scripts. Probably most important here is copy-libs-linux.sh Though IDK how those libs and filters for them were picked. I'll try using that. Wonder if other games have any info how to make their linux binary releases.

cryham commented 5 months ago

Okay I think I got it running well now. Tested build from Kubuntu 22.04 on Manjaro kde 23.1.4 in VM I'll test a couple more distros in VM, and we should have a 3.1 release very soon with Linux binary. Just need to add some more challenges for new vehicles probably.

21_16-52-29`s

cryham commented 5 months ago

Allright it worked also on clean Ubuntu 23.10, Linux Mint-21.3 and MX Linux 23.2. With lowest settings I get 10 Fps, kind of possible to drive.

That old script wasn't too useful. I ended just with minimal libs and starting sr3 again and again looking at which .so is missing and copying it back from my older Kubuntu 20.04 VM where I previously built using new .py script.

cryham commented 4 months ago

SR 3.1 released with Linux binary here.