SideStore / omnisette-server

An HTTP server wrapper for omnisette. Supports both V1 (Provision) and V3 of anisette servers.
67 stars 94 forks source link

Link GLIBC statically #1

Closed ghost closed 1 year ago

ghost commented 1 year ago

Reference: https://rust-lang.github.io/rfcs/1721-crt-static.html

amsam0 commented 1 year ago

why is this needed?

ghost commented 1 year ago

@naturecodevoid If you try to run the binary that is currently published with each release on the latest version of Debian, Ubuntu or CentOS, you'll receive the following error message because the GLIBC version on these systems is too old.

whalehub@bvm:~# ./omnisette-server-linux-x86_64
./omnisette-server-linux-x86_64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./omnisette-server-linux-x86_64)
./omnisette-server-linux-x86_64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./omnisette-server-linux-x86_64)
./omnisette-server-linux-x86_64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./omnisette-server-linux-x86_64)

If you link GLIBC statically, the omnisette-server binary can be run on these systems without any issues. I tested this myself on Debian 11 and was able to install and refresh a couple apps in SideStore while using my own Omnisette Server in the settings.

amsam0 commented 1 year ago

I've tested the aarch64 build personally with Ubuntu and the instance running on ani.sidestore.io is running Void Linux. Are you sure it's not caused by something else, such as wrong arch?

ghost commented 1 year ago

@naturecodevoid Yes, I'm sure. I included Ubuntu in my list by mistake, the current stable release ships with GLIBC v2.37 while Void Linux ships with v2.36, so naturally this issue would not occur on these distributions. You can verify this yourself by simply running the binary in a Docker container with Debian 11.

amsam0 commented 1 year ago

In that case, you can just run omnisette-server in a docker container. We are planning to have it running in alpine linux (if it doesn't already, we haven't done proper testing) for small container size

You may also be able to manually install a newer version of glibc

ghost commented 1 year ago

@naturecodevoid Unfortunately, installing a newer version of GLIBC is not trivial because almost all software depends on it. I honestly don't understand why you don't simply merge these changes, but I'd rather keep my own fork with them than install Docker just for one application.

amsam0 commented 1 year ago

...you can just build from source with that flag if you really need to use one of those distros, you don't need a fork. Actually, you may not even need that flag, building from source should be enough. This doesn't seem like a very widespread issue since I don't believe any other rust cli programs need to do this.

I'm not going to argue with your unwillingness to use docker, but there are much better alternatives such as podman. Containers can be very lightweight and very useful.

v3 is also made to solve the centralized server issue, so if you're self hosting, you might as well just use Dadoum's anisette-server. there's also a memory leak in omnisette-server.