Deciding on supported glibc version(s) #89

Open
opened 2022-03-26 07:34:11 +00:00 by glyph · 3 comments
Owner

moid was testing the installation of peach-web and go-sbot yesterday and ran into a glibc compatibility issue with go-sbot. It is possible that he also had a glibc issue with the peach-web binary. The basic test went like so:

  1. Install using the install.sh script
  2. GUI not appearing at localhost:8000
  3. Compile the peach-web binary on the installation machine: GUI appears
  4. Sbot won't start (checks logs: glibc error)

Both the peach-web and go-sbot x86_64 binaries were compiled on my development machine (glibc 2.35). moid's machine (Linux Mint) is running glibc 2.27.

I think we should decide on a minimum supported glibc version and then we can check for that in the installation script and throw a useful error if it's not supported.

We can also document this clearly so there are no surprises.

moid was testing the installation of `peach-web` and `go-sbot` yesterday and ran into a `glibc` compatibility issue with `go-sbot`. It is possible that he also had a `glibc` issue with the `peach-web` binary. The basic test went like so: 1) Install using the `install.sh` script 2) GUI not appearing at `localhost:8000` 3) Compile the `peach-web` binary on the installation machine: GUI appears 4) Sbot won't start (checks logs: glibc error) Both the `peach-web` and `go-sbot` x86_64 binaries were compiled on my development machine (`glibc 2.35`). moid's machine (Linux Mint) is running `glibc 2.27`. I think we should decide on a minimum supported `glibc` version and then we can check for that in the installation script and throw a useful error if it's not supported. We can also document this clearly so there are no surprises.
Author
Owner

For reference, here's a similar discussion on the rust-lang Github:

Minimum Supported glibc version #1412

For reference, here's a similar discussion on the rust-lang Github: [Minimum Supported glibc version #1412](https://github.com/rust-lang/libc/issues/1412)
Author
Owner

It seems like compiling with cross might be the best way to do this (even though I had previously tried and failed to compile peach-web with it, prior to the Rouille refactor):

x86_64-linux: lower glibc version requirement to 2.17 (compatible with centos 7) #501

aarch64-linux: lower glibc version requirement to 2.17 (compatible with centos 7) #528

Here is a table including all the supported targets for cross (includes glibc version for each target).

It seems like compiling with [cross](https://github.com/cross-rs/cross) might be the best way to do this (even though I had previously tried and failed to compile `peach-web` with it, prior to the Rouille refactor): [x86_64-linux: lower glibc version requirement to 2.17 (compatible with centos 7) #501](https://github.com/cross-rs/cross/pull/501) [aarch64-linux: lower glibc version requirement to 2.17 (compatible with centos 7) #528](https://github.com/cross-rs/cross/issues/528) Here is [a table including all the supported targets for cross](https://github.com/cross-rs/cross#supported-targets) (includes `glibc` version for each target).
Author
Owner

After more failed attempts to cross-compile with cross (always running into linker errors involving rand or getrandom), I decided to try using a plain docker approach:

sudo docker create ubuntu:18.04
sudo docker run -it b67d6ac264e4

# you're now in a shell session with the docker container

# check the glic version
ldd --version

# ldd (Ubuntu GLIBC 2.27-3ubuntu1.5) 2.27

# install some requirements
apt update
apt install build-essential curl wget git gcc-aarch64-linux-gnu

# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

# install the arm64 toolchain
rustup target add aarch64-unknown-linux-gnu

# install go
wget https://go.dev/dl/go1.18.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.18.linux-amd64.tar.gz
source $HOME/.profile

# clone peach-workspace
git clone https://git.coopcloud.tech/PeachCloud/peach-workspace.git

# clone go-ssb
git clone https://github.com/cryptoscope/ssb.git

# build peach-web for x86_64
cd peach-workspace/peach-web
cargo build --release

# build peach-web for arm64
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc
cargo build --release --target=aarch64-unknown-linux-gnu

# build go-sbot for x86_64
cd /ssb/cmd/go-sbot
go build -v -i

Use docker cp to get the files out of the docker container, for example:

docker cp f3f2f934e9a3:/peach-workspace/target/release/peach-web ~/Documents/PeachCloud/Releases/
After more failed attempts to cross-compile with `cross` (always running into linker errors involving `rand` or `getrandom`), I decided to try using a plain docker approach: ```bash sudo docker create ubuntu:18.04 sudo docker run -it b67d6ac264e4 # you're now in a shell session with the docker container # check the glic version ldd --version # ldd (Ubuntu GLIBC 2.27-3ubuntu1.5) 2.27 # install some requirements apt update apt install build-essential curl wget git gcc-aarch64-linux-gnu # install rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env # install the arm64 toolchain rustup target add aarch64-unknown-linux-gnu # install go wget https://go.dev/dl/go1.18.linux-amd64.tar.gz tar -C /usr/local -xzf go1.18.linux-amd64.tar.gz source $HOME/.profile # clone peach-workspace git clone https://git.coopcloud.tech/PeachCloud/peach-workspace.git # clone go-ssb git clone https://github.com/cryptoscope/ssb.git # build peach-web for x86_64 cd peach-workspace/peach-web cargo build --release # build peach-web for arm64 export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo build --release --target=aarch64-unknown-linux-gnu # build go-sbot for x86_64 cd /ssb/cmd/go-sbot go build -v -i ``` Use `docker cp` to get the files out of the docker container, for example: ```bash docker cp f3f2f934e9a3:/peach-workspace/target/release/peach-web ~/Documents/PeachCloud/Releases/ ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: PeachCloud/peach-workspace#89
No description provided.