Building Oolite 4 Linux

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

Moderators: winston, another_commander, Getafix

User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Building Oolite 4 Linux

Post by hiran »

Looking at github commit https://github.com/OoliteProject/oolite ... 7fd736afa5
with message Fixed compile error on Fedora 36.

Can someone elaborate how Oolite got built? If the instructions can be run on Ubuntu as well, I could assist creating a CI/CD pipeline that ensures we always get the latest build automatically. Right now this only applies to the Windows version.
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6696
Joined: Wed Feb 28, 2007 7:54 am

Re: Building Oolite 4 Linux

Post by another_commander »

I think you may want to reach out to the reporter of issue #417. I am confident that the fix works because we've had similar reports in the past when compiling with recent gcc versions, but whether the issue reporter managed to successfully build a working executable or not at the end is not clear. I imagine they did because I had asked them to reopen the issue if the fix failed to work.
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Building Oolite 4 Linux

Post by tsoj »

hiran wrote: Mon Apr 10, 2023 8:46 pm
Can someone elaborate how Oolite got built? If the instructions can be run on Ubuntu as well, I could assist creating a CI/CD pipeline that ensures we always get the latest build automatically. Right now this only applies to the Windows version.
This script should build Oolite on a clean Ubuntu install:

Code: Select all

#!/bin/bash

# install all the necessary packages
sudo apt update
sudo apt -y install git gobjc gnustep-devel make libsdl1.2-dev libvorbis-dev libopenal-dev g++ libespeak-dev libnspr4-dev

# download source and dependencies
git clone https://github.com/OoliteProject/oolite.git
cd oolite
cp .absolute_gitmodules .gitmodules
git submodule update --init
git checkout -- .gitmodules

# this is necessary, as otherwise textures aren't loaded correctly
rm deps/Linux-deps/include/png.h
rm deps/Linux-deps/include/pngconf.h

# compiling
source /usr/share/GNUstep/Makefiles/GNUstep.sh
make -f Makefile release -j$(nproc)
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Building Oolite 4 Linux

Post by hiran »

tsoj wrote: Wed Apr 12, 2023 5:01 pm
This script should build Oolite on a clean Ubuntu install:
Nice!
I got it working in Github.

Now where in the filesystem would I find the files that need to be zipped up into a release?
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Building Oolite 4 Linux

Post by hiran »

I am still trying to assemble a build.

When I downloaded oolite-1.90.linux-x86_64.tgz I found that it contains one single file: A script to install the whole game.
This script is made by make_installer.sh - a nice wrapper that seems to be a one stop shopping.

But apparently I am not able to make it fly. Which directory do you run it from? What parameters should be used? Do you need to build Oolite before, or will that be taken care of?
Sunshine - Moonlight - Good Times - Oolite
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 678
Joined: Sat Aug 09, 2014 4:16 pm

Re: Building Oolite 4 Linux

Post by Commander_X »

I thought you've got it working earlier?

NB: don't forget a_c observation later in the thread about ". /usr/GNUstep/System/Library/Makefiles/GNUstep.sh " (dot space forward slash at the beginning, shortcut for "source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh").
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Building Oolite 4 Linux

Post by hiran »

Commander_X wrote: Thu Apr 13, 2023 9:54 pm
I thought you've got it working earlier?
That attempt never made it into the Oolite repository. But thank you for remembering. :-)
Commander_X wrote: Thu Apr 13, 2023 9:54 pm
NB: don't forget a_c observation later in the thread about ". /usr/GNUstep/System/Library/Makefiles/GNUstep.sh " (dot space forward slash at the beginning, shortcut for "source /usr/GNUstep/System/Library/Makefiles/GNUstep.sh").
I checked - it is contained in the above example.
Sunshine - Moonlight - Good Times - Oolite
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Building Oolite 4 Linux

Post by tsoj »

hiran wrote: Wed Apr 12, 2023 10:16 pm
Now where in the filesystem would I find the files that need to be zipped up into a release?
I played around a bit and managed to make it work (maybe?) with the following updated script:

Code: Select all

#!/bin/bash

# install all the necessary packages
sudo apt update
sudo apt -y install git gobjc gnustep-devel make libsdl1.2-dev libvorbis-dev libopenal-dev g++ libespeak-dev libnspr4-dev

# download source and dependencies
git clone https://github.com/OoliteProject/oolite.git
cd oolite
cp .absolute_gitmodules .gitmodules
git submodule update --init
git checkout -- .gitmodules

# compiling and creating the self-extracting installer
source /usr/share/GNUstep/Makefiles/GNUstep.sh
make -f Makefile pkg-posix-nightly HOST_ARCH=x86_64
Then the Linux install file should be (for example) at ./installers/posix/oolite-trunk-1.91.0.a911f5a-dev.linux-x86_64.run.

We need to set HOST_ARCH manually as the Makefile doesn't set it automatically (maybe we should update either the Makefile or at least the help command for the Makefile).
The removal of some png header files also had to go, as apparently they weren't there for no reason ... And the textures seem fine when installing from the resulting installer, so no problem here.

EDIT: I also see, I need to update my signature. I'm currently flying a Cobra Mark II-X ...

EDIT2: Nevermind, it doesn't work on another Linux install :(
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Building Oolite 4 Linux

Post by hiran »

tsoj wrote: Thu Apr 13, 2023 11:32 pm
I played around a bit and managed to make it work (maybe?) with the following updated script:
[...]

Then the Linux install file should be (for example) at ./installers/posix/oolite-trunk-1.91.0.a911f5a-dev.linux-x86_64.run.
Worked for me. Thank you, we have the installer back.
tsoj wrote: Thu Apr 13, 2023 11:32 pm
We need to set HOST_ARCH manually as the Makefile doesn't set it automatically (maybe we should update either the Makefile or at least the help command for the Makefile).
The removal of some png header files also had to go, as apparently they weren't there for no reason ... And the textures seem fine when installing from the resulting installer, so no problem here.
No problem. Although we should never see any 32 bit systems around any more, something can still change. I replaced it with

Code: Select all

$(uname -m)
.
tsoj wrote: Thu Apr 13, 2023 11:32 pm
EDIT: I also see, I need to update my signature. I'm currently flying a Cobra Mark II-X ...

EDIT2: Nevermind, it doesn't work on another Linux install :(
Do not worry. This is exactly the issue why I could not move on last time.
Now I would say: It is the best we have, let's preserve it.

So I have a running Github workflow that builds both Windows and Linux. For some reason the release is failing. I'd like to figure that out, then I will raise a PR.
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Building Oolite 4 Linux

Post by hiran »

hiran wrote: Fri Apr 14, 2023 2:35 pm
So I have a running Github workflow that builds both Windows and Linux. For some reason the release is failing. I'd like to figure that out, then I will raise a PR.
Fixed. It was just a permission issue.
So now I could see the release to get created, and I downloaded it and was able to run it on my Ubuntu 22.
Sunshine - Moonlight - Good Times - Oolite
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Building Oolite 4 Linux

Post by tsoj »

hiran wrote: Fri Apr 14, 2023 3:45 pm
Fixed. It was just a permission issue.
So now I could see the release to get created, and I downloaded it and was able to run it on my Ubuntu 22.
Nice!
hiran wrote: Fri Apr 14, 2023 2:35 pm
Do not worry. This is exactly the issue why I could not move on last time.
I think the issue is that the binary is compiled against different versions of libraries than what is here. So my idea is to just copy all the libraries that the final compiled binary uses from the OS that I've built on into this folder, so that in the self-extracting installer we have the right versions of libraries. Maybe that'll make it work.
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Building Oolite 4 Linux

Post by hiran »

tsoj wrote: Fri Apr 14, 2023 5:28 pm
hiran wrote: Fri Apr 14, 2023 2:35 pm
Do not worry. This is exactly the issue why I could not move on last time.
I think the issue is that the binary is compiled against different versions of libraries than what is here. So my idea is to just copy all the libraries that the final compiled binary uses from the OS that I've built on into this folder, so that in the self-extracting installer we have the right versions of libraries. Maybe that'll make it work.
Good idea, it might work. :D

I just created a pull request. However I won't merge - somehow I'd like a second pair of eyes on that change.
But once merged, we can work together on the details of the build. There is for sure room for improvements.
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2410
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Building Oolite 4 Linux

Post by hiran »

hiran wrote: Fri Apr 14, 2023 7:16 pm
I just created a pull request. However I won't merge - somehow I'd like a second pair of eyes on that change.
But once merged, we can work together on the details of the build. There is for sure room for improvements.
Thank you guys for the feedback, I tested the workflow some more and found some improvements.
When merging within my repo I accidentially changed the official one, and now the pull request is closed already - hence taking the discussion here.

From my experiments I found out we did some unusal practice of tagging the Oolite release with 'latest'. Instead, Github automatically keeps a 'latest' flag for the latest release while prereleases do not receive this status. So I thought a bit about the (pre)release naming/tagging.

Looking at previous releases it looks like the Oolite version number was used, plus maybe a letter to distinguish intermediate/unstable releases. Example: 1.80a

Therefore I used the version number found in file src/Cocoa/oolite-version.xcconfig in the workflow, too. But with just that it is possible to have multiple builds using the same version number. To preserve history and have something uniquely addressable, I thought of extending that with the commit hash. But that is barely readable for humans and cannot be sorted in a reasonable way. So I switched to the build number. Not the best, but currently releases are numberd like

Code: Select all

<Oolite version>-<build number>
which can result in something like

Code: Select all

1.91-15
As I want to see builds for feature branches so we can share intermediate development results, changes on branches other than master will result in prereleases numbered as

Code: Select all

<Oolite version>-<branch name>-<build number>
which can result in something like

Code: Select all

1.91-cursor_opacity-16
While mulling all over this, I came across Semantic Versioning which we might want to move into.

Please let me know what you think about it.
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6696
Joined: Wed Feb 28, 2007 7:54 am

Re: Building Oolite 4 Linux

Post by another_commander »

Looking at the commit history, I see this:
"I verified prereleases get created for branches but they do not modify the 'latest' tag, which will still point to the latest release."

The problem would most likely come not from the prereleases originating from branches, but from the actual release that would be published once a commit to master gets made. You need to verify that commits to master do not affect the 1.90 release tag.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6696
Joined: Wed Feb 28, 2007 7:54 am

Re: Building Oolite 4 Linux

Post by another_commander »

Also, regarding incremental build numbers, we already have this in our nightlies versioning (see Makefile):
VER_GITREV := $(shell git rev-list --count HEAD)

This appends the github incremental commit number to the version, producing something like OoliteInstall-1.91.0.7404-230311-b459e81 (that 7404 is the incremental commit number). We are not using it as part of the filename just yet (only embedded in the installer version string and the watermark appearing on screen when the game is run), but it is there and could easily be used.
Post Reply