-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] glibc version compatibility & statically linked builds #808
Comments
It was documented in the README
It won't work even for MUSL build. Otherwise it has been done years ago. |
If you don't trust me, you may try it yourself. |
Okay, that's fair. Would it be possible to change the build target to lower glibc versions? (e.g. 2.12)? Afaik the latest glibc should be compatible with any version after 2.0. |
Fastfetch uses Github Action to build binaries, which supports only ubuntu 20.04 and newer. The binaries released by fastfetch were built with 22.04. If you need old glibc version support, you may download the artifacts named fastfetch-linux-old-amd64 |
Thanks! Do you want to maybe publish the linux-old build on GitHub releases as well? Or change the default to Ubuntu 20.04? It's a little bit strange to abandon support for 20.04 LTS since it's still being supported by Ubuntu and hasn't reached EOL yet. |
Even 14.4 is still supported by Ubuntu, but they will only get security fixes, which is so called "stable". Fastfetch targets people who want to try new things. If one stucks at an ancient distro, he may not want to try fastfetch. |
Actually, it is possible to build statically linked musl binaries by changing a few cmake flags.
---snip---
git clone --filter "blob:none" --quiet "https://github.com/fastfetch-cli/fastfetch" && cd "./fastfetch"
mkdir -p "./STATIC_BUILD"
cmake -DCMAKE_C_FLAGS="-O2 -flto=auto -static -w -pipe" \
-DCMAKE_EXE_LINKER_FLAGS="-static -s -Wl,-S -Wl,--build-id=none" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DIS_MUSL="ON" \
-DBUILD_SHARED_LIBS="Off" \
-DBUILD_TESTS="Off" \
-DSET_TWEAK="Off" \
-GNinja \
-B "./STATIC_BUILD"
cmake --build "./STATIC_BUILD" --target package -j"$(($(nproc)+1))"
---snip---
!# Verify
# You can run the binary in a minimal alpne docker image and it works perfectly
# The (ldd | file | du -sh) output are:
./fastfetch: not a dynamic executable | ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped | 1.5M
./flashfetch: not a dynamic executable | ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped | 1.3M
!# Features
❯ fastfetch --list-features
Proprietary GPU driver API
chafa
dbus
dconf
drm
egl
gio
imagemagick7
libddcutil
libnm
libpulse
linux/videodev2
linux/wireless
opencl
osmesa
sqlite3
threads
vulkan
wayland
x11
xcb
xcb-randr
xfconf
xrandr
zlib You can test the binaries yourself: |
Oh great! This helps a lot in terms of building compatible binaries. Thanks! |
This doesn't actually work. Fastfetch makes heavy uses of Take A program runs doesn't mean it works. I'm the project author, trust me. |
Ah I see. ❯ ./fastfetch-dynamic -s packages -l none
Packages: 1681 (dpkg), 48 (nix-default), 8 (snap)
❯ ./fastfetch -s packages -l none
Packages: 1681 (dpkg), 48 (nix-default), 8 (snap) So it's less of a # Try the binary yourself: https://bin.ajam.dev/x86_64_Linux/fastfetch-staticx
❯ staticx --loglevel DEBUG "./fastfetch-dynamic" --strip "./fastfetch-staticx"
❯ ldd "./fastfetch-staticx" ; file "./fastfetch-staticx" ; du -sh "./fastfetch-staticx"
not a dynamic executable
./fastfetch-staticx: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
1.6M ./fastfetch-staticx
❯ ./fastfetch-staticx --list-features
Directx Headers
Proprietary GPU driver API
dbus
dconf
drm
egl
gio
glx
imagemagick6
imagemagick7
libddcutil
libnm
libpulse
opencl
osmesa
rpm
sqlite3
threads
videodev2
vulkan
wayland
x11
xcb
xcb-randr
xfconf
xrandr
zlib |
It crashes. It's easy to check whether the binary work or not. You should try |
That's because I used the precompiled binary that are released here (https://github.com/fastfetch-cli/fastfetch/releases/download/2.10.2/fastfetch-linux-amd64.tar.gz) , which also crashes If you have |
Hmm, interesting. |
If we are talking in terms of regular distros and "real-systems" instead of containers, the very same container GH Actions uses to release the binaries of fastfetch, then sure. |
A container doesn't have a display or opengl, vulkan, media, song, doesn't mean it can't build a binary that uses so libs that connect a display or opengl, vulkan, media, song in compile time. |
Ah yes, my bad. !# Install : https://staticx.readthedocs.io/en/latest/installation.html
# Make sure you also have: ldd , readelf, objcopy, patchelf (https://github.com/NixOS/patchelf) & scons
!# After you have installed those, you can create a staticx binary using:
staticx --loglevel DEBUG "./fastfetch-dynamic" --strip "./fastfetch-staticx"
!# Try the staticx build now it should mostly work |
So I have to build in my machine? Then what's the point of static link? Talk is cheap. Unless you show me the binary, your words are meaningless. |
Once you build the binary from a machine where staticx can find and pack as much features/runtime deps as possible, you can then release those binaries here on your repo. |
Talk is cheap. |
Wanted features:
Add some statically linked builds on github release.
Motivation:
The github release for linux amd64 is not runnable on older versions of ubuntu 20 LTS.
The text was updated successfully, but these errors were encountered: