Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Using all deps from external_deps in release builds whatever the platform

Open illwieckz opened this issue 1 year ago • 3 comments

Right now when producing Unvanquished release builds and then Dæmon release builds, we use our own builds of deps from external_deps for building macOS and Windows release builds.

For Linux we relied on system's libraries. Since we use an old distribution (currently Debian Buster) to build against old libc to remain compatible with some old distributions, we faced some problems:

  • Some system libraries were not compatible with cross-compiling (no ability to install multiple versions of the same library but with different platform) so we had to build them ourselves anyway.
  • System libraries may likely have very older versions, missing bugfixes or optimizations, or just behaving differently.

For example libjpeg-turbo added support for NEON-based SIMD on arm64, it would be nice if our release builds can benefit from SIMD jpeg decoding on arm too.

The mouse behavior discrepancies between SDL versions and platforms (#628) is part of why I want all the release builds to use deps from external_deps instead of system ones, in order to reduce the scope of investigation when a bug or regression occurs. I want all our release builds use the latest versions from external_deps, whatever the platform.

So I'm planning to update the release scripts to build all the Linux deps from external_deps.

On that purpose, while I'm updating deps (#857), I verify if those deps can be cross-compiled. For example I added to #857 a very small patch to allow libjpeg-turbo to be cross-compiled (I may extend it and submit it upstream at some point).

illwieckz avatar May 15 '23 12:05 illwieckz

Not arguing against this, but to give a little context of why it was not done in the past, it is somewhat difficult to ensure a decent-quality build. For example last time I prepared a deps release, I found that many libraries were actually being built with compiler optimizations disabled. Beyond optimizations, there are a lot of issues with configure scripts that try to enable as many optional features as they can find on the system like optional CPU instructions or linking against optional libraries. In practice the builds from Debian repositories seemed more likely to be high quality than the ones made with our script.

slipher avatar May 15 '23 13:05 slipher

Yeah, clearly, we needed to improve the build script first. With current build script in master this is not doable

But with those PRs things start to look really good to enable us to do it:

  • https://github.com/DaemonEngine/Daemon/pull/857
  • https://github.com/DaemonEngine/Daemon/pull/861
  • https://github.com/DaemonEngine/Daemon/pull/863

illwieckz avatar May 15 '23 14:05 illwieckz

Things we can exclude from rebuilding on Linux are things like nasm and pkg-config, those things are only used at build time and using a different version of them very likely do not contribute any difference into the produced binaries.

illwieckz avatar May 15 '23 14:05 illwieckz