anza-xyz / platform-tools

Apache License 2.0
45 stars 32 forks source link

Add to README that platform-tools is built against Ubuntu 20.04 #73

Open maxims94 opened 8 months ago

maxims94 commented 8 months ago

I recently wanted to run platform-tools on my Linux machine (Arch Linux, x86_64). Unfortunately, this didn't work as there were shared libraries missing:

./lldb: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory

I couldn't find the right library anywhere and ran into errors when trying to compile it myself.

After a while, I realized that platform-tools is compiled in a Ubuntu 20.04 environment.

When I tried to run it inside a Docker container, it finally worked!

Here's the Dockerfile (it might help someone):

FROM ubuntu:20.04

RUN apt-get update && \
    apt-get install -y \
                    wget \
                    python3-dev \
                    libxml2

RUN cd /root && \
    mkdir -p .cache/solana/v1.37/platform-tools && \
    wget "https://github.com/solana-labs/platform-tools/releases/download/v1.37/platform-tools-linux-x86_64.tar.bz2" && \
    tar jxf platform-tools-linux-x86_64.tar.bz2 -C /root/.cache/solana/v1.37/platform-tools

To help other developers who might also run into this, we could add a note to the README saying that the Linux release is compiled in Ubuntu 20.04 and thus expects the (somewhat older) libraries that it ships with.

I'm aware that the workflow already contains os: ubuntu-20.04, but it may take a while to actually notice that.