I spent a little bit of time this weekend looking into how to reduce the size of an installed swift toolchain, and I thought it'd be worth starting a discussion here to see what ideas people have for improvements in this area. While I don't think shrinking the toolchain is necessarily a top priority, it does substantially benefit anyone who has a slow internet connection or is managing multiple installs.
Some ideas I've thought of so far:
- Eliminate the duplicated SwiftPM subcommands:
swift-package, etc. are 5 single-file executables that all statically link the same libraries. It looks like we should be able to cut ~12% of the OSS toolchain size on some platforms by combining them into a single binary.
- Similarly, I think it should be possible to fold
swift-frontendalongside the modulewrap and symbolgraph tools to save another 10% or so. I haven't tried this yet though.