Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the required dependencies on Linux #64147

Open
shahmishal opened this issue Mar 6, 2023 · 8 comments
Open

Document the required dependencies on Linux #64147

shahmishal opened this issue Mar 6, 2023 · 8 comments
Labels
Linux Platform: Linux toolchain

Comments

@shahmishal
Copy link
Member

shahmishal commented Mar 6, 2023

Document why each of these libraries are required on Linux, and also figure out alternative solution to reduce the dependences.

    binutils 
    git 
    unzip 
    gnupg2 
    libc6-dev 
    libcurl4-openssl-dev 
    libedit2 
    libgcc-9-dev 
    libpython3-dev 
    libsqlite3-0 
    libstdc++-9-dev 
    libxml2-dev 
    libz3-dev 
    pkg-config 
    python3-lldb-13 
    tzdata 
    zlib1g-dev 

@MaxDesiatov has a pull request to reduce some of the dependences.
#61530

@MaxDesiatov MaxDesiatov added the Linux Platform: Linux label Mar 7, 2023
@MaxDesiatov
Copy link
Member

MaxDesiatov commented Jun 12, 2023

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:

Toolchain build time dependencies:

  1. binutils
  2. git
  3. libc6-dev
  4. libgcc-9-dev
  5. libpython3-dev <- LLDB build-time dependency
  6. libstdc++-9-dev
  7. tzdata <- Foundation dependency

Foundation build dependencies

  1. libcurl4-openssl-dev
  2. libxml2-dev
  3. libz3-dev <- Deflate support for URLSession/curl?
  4. zlib1g-dev <- not needed if above is available?

SwiftPM build dependency

  1. pkg-config

SwiftPM/llbuild runtime dependencies

  1. libsqlite3-0
  2. git
  3. unzip

Swift runtime dependencies

  1. libc6
  2. libstdc++9

Toolchain installation dependencies

  1. gnupg2

LLDB runtime dependencies

  1. python3-lldb-13
  2. libedit2

@stevapple
Copy link
Contributor

stevapple commented Jun 13, 2023

🤔️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 MaxDesiatov changed the title Document the required dependences (libs) on Linux Document the required dependencies (libs) on Linux Jun 13, 2023
@MaxDesiatov MaxDesiatov changed the title Document the required dependencies (libs) on Linux Document the required dependencies on Linux Jun 13, 2023
@futurejones
Copy link
Contributor

@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

@futurejones
Copy link
Contributor

@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.

@shahmishal
Copy link
Member Author

@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.

@futurejones
Copy link
Contributor

@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.

@MaxDesiatov
Copy link
Member

MaxDesiatov commented Jun 14, 2023

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.

@futurejones
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux Platform: Linux toolchain
Projects
None yet
Development

No branches or pull requests

4 participants