swiftlang / swift-docker

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

Swift LLDB cannot launch application in 5.6-centos7 docker image #280

Closed adam-fowler closed 2 years ago

adam-fowler commented 2 years ago

Swift LLDB fails to launch application in 5.6-centos7 docker image.

It prints

error: 'A' packet returned an error: 8

I found this while running inside a devcontainer in Visual Studio Code. The lldb extension in VSCode returns a slightly different error message

/root/.vscode-server/extensions/vadimcn.vscode-lldb-1.7.0/adapter/codelldb: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /root/.vscode-server/extensions/vadimcn.vscode-lldb-1.7.0/adapter/codelldb)
Debug adapter exit code=1, signal=null.
stevapple commented 2 years ago

You're actually raising two different problems here.

The Swift LLDB failure is caused by missing capability in Docker environment. The guidance on https://hub.docker.com/_/swift?tab=tags is out of date, and you should refer to the README from this repo:

If you want to run the Swift REPL you will need to run the container with additional privileges:

# If running Docker on Linux:
docker run --security-opt seccomp=unconfined -it swift

# If running Docker on macOS:
docker run --privileged -it swift
stevapple commented 2 years ago

The CodeLLDB failure is another one: that plugin is incompatible with CentOS 7 itself, because Glibc 2.16/2.17 shipped by CentOS 7 doesn't meet its requirement of Glibc 2.18.

There's no officially prebuilt Glibc 2.18 for CentOS 7, and I think shipping a custom Glibc causes more trouble than benefits.

adam-fowler commented 2 years ago

Going to close this as a we don't support Centos7

EDIT: Too quick there, I thought this was the vscode-swift repo, but I'll leave this closed anyway