Open shahmishal opened 1 year ago
In that list zlib1g-dev and libz3-dev seem to be duplicates to me. From what I've been able to find, they seem to be ABI/API-compatible, so I hope we'd be able to use one and not the other.
As for the rest, I think we can separate these into a few categories:
🤔️The Windows port managed to reduce dependencies by statically linking Foundation/SwiftPM dependencies. I’m not sure if upstream Linux software repositories allow static linking, but it is a tempting way for reducing the number of dependencies, at least for Swift.org tarballs, despite the risk of increasing the toolchain size.
The Windows guide also declares LLDB dependencies (Python) and SwiftPM external dependencies (Git) as recommended instead of required. On Linux where package management is more mature, I feel it’s reasonable to split the compiler, debugger and developer tools into different packages, to allow user skip some dependency if they really don’t need it.
unzip
may be unnecessary if we implement the functionality in Swift…?
@MaxDesiatov can you expand on your information about
zlib1g-dev and libz3-dev seem to be duplicates
From my research they seem to have very different purposes. https://packages.debian.org/bookworm/zlib1g-dev https://packages.debian.org/bookworm/libz3-dev
@shahmishal what is the reason for trying to reduce the dependencies?
Are we just trying to shorten the list and make the swift
installation seem simpler?
Most of these dependencies are not for swift
but are needed by clang
that is now included in the swift toolchain package.
@futurejones The goal is to understand the dependencies, and see if we can lower it. I wanted to explore an option in the future to limit OS and version specific distribution if possible.
@shahmishal the simplest way to do that on ubuntu / debian OS's would be to use the build-essential
package.
This will install 90% of the depends list and correctly select all the version specific of packages such as libgcc-*-dev
, libstdc++-*-dev
, etc.
The new depends list would be something like -
build-essential
git
unzip
libcurl4-openssl-dev
libxml2-dev
libz3-dev
pkg-config
python3-lldb
tzdata
zlib1g-dev
This will install the correct version of all the required dependencies on any ubuntu / debian distribution.
The goal is not to reduce the number of lines in a Dockerfile
and it isn't specific to Debian or Ubuntu. We want to reduce the amount and the disk space taken of dependencies for all Linux distributions, as much as possible, for both the toolchain and Swift applications and libraries built by users of the Swift toolchain.
@shahmishal @MaxDesiatov Are we discussing the installation of the swift toolchain on linux or the creation of docker images? They have very different end goals and requirements.
Document why each of these libraries are required on Linux, and also figure out alternative solution to reduce the dependences.
@MaxDesiatov has a pull request to reduce some of the dependences. https://github.com/apple/swift/pull/61530