Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change build image to debian:oldoldstable to lower GLIBC requierment #14

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Th3Dilli
Copy link
Contributor

@Th3Dilli Th3Dilli commented Dec 27, 2023

Some users of your game using OpenTK 4 had issues on older distributions running the game since the libglfw.so is build using ubuntu:latest (github action) which as of writing is 22.04 and uses GLIBC 2.34 which causes issues (won't create a window and crash) when used on systems that ship older versions of GLIBC.

So to future proof this and cause less issues with linux distributions that ship older versions of GLIBC we can now use the second last major version of debian (and the shipped GLIBC with it) to build libglfw.so for linux.

Using strings libglfw.so.3.3 | grep GLIBC one can see which GLIBC is that max requiert for libglfw
and using ldd --version one can check the currently installed version of GLIBC

and here is the tested build script on my fork
https://github.com/Th3Dilli/glfw-redist/actions/runs/7576529979/job/20635553545

Copy link
Member

@NogginBops NogginBops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not use ubuntu-latest like we have, but I'm not sold on oldoldstable either. I would rather we have a fixed version that we are compiling against, this way we don't get any unexpected breakages when new versions come out.

Also the whitespace should be fixed.

Comment on lines 28 to 31
wget -q https://packages.microsoft.com/config/debian/$VERSION_ID/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get update
apt-get install -y powershell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it suddenly necessary to install powershell manually? Does it not come with the container?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub actions are a bit weird, basically GitHub installs all one could need into the ubuntu image they provide

when using a container it runs that container next to the ubuntu image and then the commands inside the container which is just the bare bones debian docker container from https://hub.docker.com/_/debian (~50MB compressed)
so we need to install everything we need in there

https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container

runs-on: ${{ matrix.os }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
runs-on: ubuntu-latest
container: debian:oldoldstable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be more stable to just fix the version in place so that we manually control which debian/ubuntu version we are compiling against?

Copy link
Contributor Author

@Th3Dilli Th3Dilli Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do that too, my general idea was that debian:oldoldstable is the oldest still supported version many other distos depend upon, so that way we stay on a version that is still generally used by some linux distos while not yet being too old.

Further this kinda auto updates which has pros and cons since well it auto updates so it stays updated / patched but also may break when a new version gets released and some one did not directly update their system and the newer glibc is not working anymore since OpenTK requires the newer one already

@Th3Dilli
Copy link
Contributor Author

Another option would be to not change anything and add a step to OpenTK to try and load a system installed version of glfw first before trying to load the one shipped with the OpenTK package (This can be done currently only by deleting the glfw.so from the build package - https://github.com/opentk/opentk/blob/master/src/OpenTK.Windowing.GraphicsLibraryFramework/GLFWNative.cs#L79).
So the distro takes care of building glfw (glibc) and should just work when installing it using the systems package manager.

That would mean it should work for most ppl without install ing glfw as it does currently while also providing the option to load one supplied with the systems package manager if installed.

Probably same should be done then with other libs eg. libopenal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants