Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

ci: use submodules for freetype

Open illwieckz opened this issue 1 year ago • 3 comments

Our submodules may provide symbols not provided by system libraries.

Makes sure libraries that may be used by both the engine and the game are built once.

See on game side:

  • https://github.com/Unvanquished/Unvanquished/pull/3331

illwieckz avatar Mar 08 '25 12:03 illwieckz

What's the motivation for the change though? It makes builds longer

The motivation is that we better better strictly control what we build against when doing our own official release builds. We already rebuild every deps using the external_deps script in the docker release build. So this changes nothing for the release build, either rebuilding the external_deps or rebuilding the submodule is the same (though submodule is less cumbersome).

And when a library is used in both game and engine, like freetype, we better use the exact same freetype library in engine so we don't deal with different bugs and have consistent version to track down.

Then we better build stuff in our CI the closest way we build the release, building the submodule in both cases is the easiest way to achieve that.

Note that for non-Linux systems where we usually ship many prebuilt libraries in external deps archives, we may modify the external_deps script to build from submodule so we ensure prebuilt libraries are exactly the same as submodule ones. This can be implemented above #1433:

  • https://github.com/DaemonEngine/Daemon/pull/1433

and people building Daemon themselves can no longer benefit from distro security updates.

This is not true at all. The whole reason why PREFER_EXTERNAL_LIBS exists and it is actually implemented at first and all the extra code was written by myself is to keep the possibility for distro packages to build engines fully relying on system libraries, and to allow people to link against their system libraries for whatever reason (binary size, updates…).

If this prevent to benefit from distro security updates or just simply rely on system libraries, the whole PREFER_EXTERNAL_LIBS mechanism could be entirely NUKEd and would have not been implemented to begin with.

illwieckz avatar Mar 24 '25 15:03 illwieckz

SGTM to use the submodule in the release script and to make the CI match what is done with the release. I'm just disputing what should be the default value. To benefit players who build their own engine from source, the default should be to use the system libs. Release and CI can customize everything so the default doesn't matter for them.

slipher avatar Mar 24 '25 15:03 slipher

I extracted the non “default switching” changes there and there:

  • https://github.com/DaemonEngine/Daemon/pull/1617
  • https://github.com/Unvanquished/Unvanquished/pull/3353

We better merge them in all case. I'm myself not entirely convinced about what's the best to do for the default, but we can already fix the existing bugs without deciding on the default.

illwieckz avatar Mar 24 '25 15:03 illwieckz