Skip to content

Build native kson-lib for amd64 and arm64 on Linux and macOS (does not require extra build jobs) #224

@aochagavia

Description

@aochagavia

With proper configuration, each of our build jobs can generate code for the CPU architectures we are interested in on that platform (e.g. a single Linux build could generate the amd64 and arm64 binaries). This is possible thanks to Kotlin's support for cross-compilation. See this recent SO answer for a possible set of Gradle incantations (it's surprisingly straightforward, but not "simple", because nothing that interacts with Gradle is simple 🥲).

Additional details:

  1. This issue does not mention compiling to Windows arm64, because that target is not supported yet by Kotlin Native (see related issue).
  2. In theory, it's even possible to cross-compile from one operating system to another, so we could (again, in theory) have a single build job for all platforms. In practice, however, cross compilation across operating systems is tricky (see e.g. this issue) and, what's worse, it's not properly documented (the docs mention in passing that cross compilation is possible, but don't provide any details whatsoever).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions