Packaging Swift Apps for Alpine Linux
1–10 of 45 posts
Re: Packaging Swift Apps for Alpine Linux
#2Re: Packaging Swift Apps for Alpine Linux
#3Re: Packaging Swift Apps for Alpine Linux
#4Re: Packaging Swift Apps for Alpine Linux
#5Re: Packaging Swift Apps for Alpine Linux
#6Hmm, so it includes the entirety of Swift's standard library? Isn't there an option to tree shake/trim it? That's what .NET AOT compilation does (standard library is always included, sans the dependency on glibc or musl, which you can statically link into the binary as well should you need that)
But I think for a distribution it makes more sense to link swift programs dynamically against the runtime libraries, like it's the case for e.g. the C standard library, OpenSSL etc., as you can assume they all work with the same version and are ABI-compatible.
I tested it with a nearly static build (Still links against glibc and friends): 55MB get stripped to 44MB, so not that much. 27MB of that is icudt_swift65_dat, so I guess you would have to optimise that first
Re: Packaging Swift Apps for Alpine Linux
#7Hmm, so it includes the entirety of Swift's standard library? Isn't there an option to tree shake/trim it? That's what .NET AOT compilation does (standard library is always included, sans the dependency on glibc or musl, which you can statically link into the binary as well should you need that)
The biggest symbol of a statically linked swift binary that I have, is icudt_swift65_dat with 27.98MB, so I think that's not so easy to remove (nm v3.1.2 --size-sort --radix=d|swift demangle) And I think if you strip debuginfo it will be smaller (For a statically linked program of mine: 98MB -> 56MB) But I think for a distribution it makes more sense to link swift programs dynamically against the runtime libraries, l…
Re: Packaging Swift Apps for Alpine Linux
#8Hmm, so it includes the entirety of Swift's standard library? Isn't there an option to tree shake/trim it? That's what .NET AOT compilation does (standard library is always included, sans the dependency on glibc or musl, which you can statically link into the binary as well should you need that)
The biggest symbol of a statically linked swift binary that I have, is icudt_swift65_dat with 27.98MB, so I think that's not so easy to remove (nm v3.1.2 --size-sort --radix=d|swift demangle) And I think if you strip debuginfo it will be smaller (For a statically linked program of mine: 98MB -> 56MB) But I think for a distribution it makes more sense to link swift programs dynamically against the runtime libraries, l…
Re: Packaging Swift Apps for Alpine Linux
#9I was curious how large these static binaries would be since the last announcement. Being honest, 100MB is quite a bit larger than I was expecting. Probably fine for CI business apps and such, but kinda rules out a lot of linux util type things.
Re: Packaging Swift Apps for Alpine Linux
#10Similar to chroot, I wonder if flatpak is a good option? Obviously native is better but I know that that works because that's how I've run Steam on Alpine