Skip to content

Refactor native library compilation stack #4997

@PJB3005

Description

@PJB3005

The system we have for compiling native libraries for Robust is currently a mess. We need to clean this up so we can distribute natives to all platforms consistently (Fluidsynth/OpenAL Soft on macOS), distribute new libraries (SDL2) and be able to do updates to these more easily. This is currently blocking ARM support (#1443).

Background

Native libraries right now are shoddily cobbled together from a few sources. Some libraries we get from third-party NuGet packages1. The rest we distribute ourselves (via our own NuGet packages we publish to nuget.org), and they are put together with a combination of "compiled ourselves" and "downloaded from the project's website"2.

In the latter case, https://github.com/space-wizards/build-dependencies is responsible for both containing a record of these dlls and containing the NuGet packaging files used to produce the native libraries.

When we compile natives ourselves, the scripts for doing so are stored in https://github.com/space-wizards/native-build, but they're a complete unstandardized mess.

The problem

The native libraries we get from third-party NuGets are mostly fine (well, I haven't had any issues yet).

The native libraries we publish via NuGet are a pain in the ass. It's a ton of manual work that requires doing stuff on at least three operating systems. Bonus points we keep losing the PDB files so debugging is impossible.

I would like to see the following improvements made:

  • Probably merge native-build and build-dependencies so packaging of NuGets can be automated
  • Mostly-automated workflows for building new versions with GitHub Actions.
  • Standardize the way we compile stuff, probably with vcpkg.
  • All three platforms please.
  • Get rid of the "manually downloading GLFW binaries", everything from source.

Footnotes

  1. e.g. libsodium: https://www.nuget.org/packages/libsodium

  2. e.g. GLFW: https://github.com/space-wizards/build-dependencies/tree/343d4dee05495241c3e49bebc54ee6cc4383daf9/natives/glfw/3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    D1: HighExtensive codebase knowledge required.Platform: LinuxThings that relate to Linux explicitly.Platform: MacOSThings that relate to macOS explicitly.Platform: WindowsThings that relate to Windows explicitly.Priority: 2-ImportantT: RefactorType: Code refactor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions