Packaging divisions

Discussion of the System pitch as well as pondering over my latest endeavors raises the question: while Swift is distributed officially as a large binary package with the standard library, compiler, all libraries with all the tooling trimmings, this may not be an idiomatic means of distributions on other platforms, so where do the dividing lines lie?

One might expect to have a libraries package distinct from the compiler, so that someone interested in a Swift application can install the libraries but not the compiler, but a Swift developer might expect the toolchain to have Testing (or System) without having to explicitly install it.

I know this discussion has happened before. Were any conclusions reached? Does this actually matter, or should platform packagers just use best judgement on this?

2 Likes

There is no official recommendation to my knowledge but this was extensively discussed by the official Debian/Ubuntu packager, @SteveM, on a GitHub issue: you could probably mostly follow his lead with the Ubuntu packages he created, further elaborating as needed.

You could also look at the division I've been using for years with Android in the Termux app, in particular the subpackages that split off files from the standard install.

1 Like

I don't think there was a formal conclusion establishing a single required package split. The general guidance seems to be that platform packagers can use their best judgement.

There was an earlier discussion that broke the Swift distribution into the toolchain, Swift-based development tools, compile-time dependencies, and runtime dependencies, which seems like a useful model for distro packaging.

The recent System discussion also reinforces that some libraries make more sense as part of the toolchain because their APIs/types need to stay version-aligned with Swift itself.

So I'd probably treat the existing Debian/Ubuntu and Termux packaging as examples rather than a strict standard, and choose the split that fits the conventions and dependency model of the target distribution.

Windows has a strongly split model. We split along the following lines:

  • BLD: compiler and binary (build tools)
  • CLI: command line tools (CI/extra command line tools + SPM)
  • DBG: debugger and ancillary debugging tools
  • IDE: IDE integration tooling (e.g. LSP)
  • PRT: private runtime for the compiler
  • RTL: the runtime library
  • SDK: the various SDKs
    • Windows: Windows platform support
      • X86: i686 slice
        • redistributable
      • AMD64: x64 slice
        • redistributable
      • ARM64: arm64 slice
        • redistributable
    • Android: Android platform support
      • ARMv7: armv7 (32-bit slice)
      • ARM64: armv8 (64-bit slice)
      • x86: i686 slice for 32-bit testing
      • x64: x86_64 slice for 64-bit testing
2 Likes