Compiling custom Linux export templates without ruining compatibility?

Hey everyone, I’m trying to reduce my build size as much as possible in Godot 4.2.1 but I don’t fully understand how to compile Linux export templates without linking very new packages which could break compatibility on other devices.

I compiled an export template and apparently it linked the newest GLIBC package, making the program refuse to run on people with older versions: [Linux 1.0.0] GLIBC_2.38 not found · Issue #1 · popcar2/CleanDoom · GitHub

Has anyone tried exporting to Linux? How do I use the same packages/versions as the official build? Any help is really appreciated!

You need to compile on an old enough Linux distribution, as described in the documentation: Compiling for Linux, *BSD — Godot Engine (latest) documentation in English

The oldest still-supported Ubuntu LTS is a good baseline for doing this, as it covers nearly all Linux distributions currently in use. As of writing, this is Ubuntu 20.04, but starting from the end of April 2025, this will be Ubuntu 22.04.

To run this Linux distribution without affecting your current environment, you have several options:

  • On Linux, use a Docker container.
  • On Windows, use Windows Subsystem for Linux.
  • On any OS, use a virtual machine. This has higher CPU overhead (resulting in slower builds), but it’s a more universal approach.
  • Use continuous integration platforms such as GitHub Actions, which typically offer pre-built images with old Linux distributions.

The produced binary will be the exact same in the end, regardless of which approach you use to run the old Linux distribution in question.

1 Like

Got it, thank you!