swiftlang / swift-docker

Docker Official Image packaging for Swift
https://swift.org
Apache License 2.0
1.36k stars 182 forks source link

`swift repl` broken on Ubuntu images, appears to require libpython-dev #331

Closed heckj closed 1 year ago

heckj commented 1 year ago

Following up from a thread on the swift forums, using swift run with the current 22.04 Ubuntu image for Swift 5.7.3 is failing.

The commands the resolved it within the image where:

apt install python3-lldb
ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/
futurejones commented 1 year ago

Looking at the Dockerfile the problem is that it is trying to install the wrong version of libpython3.

RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true && apt-get -q update && \
    apt-get -q install -y \
    binutils \
    git \
    unzip \
    gnupg2 \
    libc6-dev \
    libcurl4-openssl-dev \
    libedit2 \
    libgcc-9-dev \
    libpython3.8 \ # <---------- should be libpython3.10 
    libsqlite3-0 \
    libstdc++-9-dev \
    libxml2-dev \
    libz3-dev \
    pkg-config \
    python3-lldb-13 \
    tzdata \
    zlib1g-dev \
    && rm -r /var/lib/apt/lists/*

which results in no libpython3 being installed in the docker image.

The dependencies need to be updated to libpython3.10 for ubuntu / jammy / 22.04

Using libpython-dev would be a better option as it automatically installs the correct version libpython3 for whatever Debian/Ubuntu version is being used.