Skip to content
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

[REQUEST] Provide prebuilt static binaries on Linux #4555

Closed
omasanori opened this issue Feb 18, 2022 · 6 comments · Fixed by #4634
Closed

[REQUEST] Provide prebuilt static binaries on Linux #4555

omasanori opened this issue Feb 18, 2022 · 6 comments · Fixed by #4634

Comments

@omasanori
Copy link
Contributor

omasanori commented Feb 18, 2022

Feature

A tarball of statically linked Kakoune installation of each release, preferably built on Alpine Linux automatically by GitHub Action, would be great to have, as Kakoune requires modern C++ that may not be implemented in the distributions' default compiler.

Building the binary itself is trivial due to Kakoune's minimal library dependencies. My quick experiment with Alpine Linux 3.15 resulted in a 2.7 MB executable after strip-ing, and it runs on Ubuntu 20.04 and CentOS 7.

The phrase on Linux might be unnecessary, but I wonder if portable static builds across versions are that easy on other platforms.

Usecase

A pre-built binary for each release will help newcomers try Kakoune without building it. Preparing a recent toolchain on older platforms is sometimes difficult even for veterans.

@mjablecnik
Copy link

Yes, I would like to try Kakoune but I have some build error:
image

And I don't know how to solve it.. :/

g++  -O3 -pedantic -std=c++2a -g -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-init-list-lifetime -MD -MP -MF .alias_registry.opt.d -c -o .alias_registry.opt.o alias_registry.cc
g++: error: unrecognized command line option ‘-std=c++2a’; did you mean ‘-std=c++03’?
Makefile:104: recipe for target '.alias_registry.opt.o' failed
make: *** [.alias_registry.opt.o] Error 1

Prebuilt static binaries would be very useful..

@Screwtapello
Copy link
Contributor

g++: error: unrecognized command line option ‘-std=c++2a’; did you mean ‘-std=c++03’?

Your compiler is too old to build Kakoune. As described in the README, Kakoune requires GCC 10.3 or above, or Clang 11 or above.

If your Linux distro does not include a sufficiently new C++ compiler, I suspect (but would love to be proven wrong) that it also wouldn't be able to run statically-linked Kakoune binaries either.

@SolitudeSF
Copy link
Contributor

it also wouldn't be able to run statically-linked Kakoune binaries either.

why?

@omasanori
Copy link
Contributor Author

If your Linux distro does not include a sufficiently new C++ compiler, I suspect (but would love to be proven wrong) that it also wouldn't be able to run statically-linked Kakoune binaries either.

Yes you can. As mentioned in the description, a statically-linked Kakoune built with Alpine runs on CentOS 7.

@Screwtapello
Copy link
Contributor

Just as newer versions of libc add new and updated functions, so you can't reliably run software dynamically linked with a modern libc on an old libc, so newer versions of Linux add new syscalls for libc to use, so you can't reliably run a statically-linked modern libc on an old kernel.

However, musl libc in particular apparently promises compatibility with Linux 2.6.39 from 2011. I don't know how they picked that particular version or how likely they are to change, but apparently at least right now it's not too difficult to build a Kakoune binary on a modern system that stands a good chance of working on RHEL 6.

@SolitudeSF
Copy link
Contributor

thats very cool, but in my case, my distro packages gcc 10.2, so i am not very much behind in compiler version and naturally, i have no problems running statically linked kakoune built with another disto's toolchain.

@mawww mawww closed this as completed in 1d439f0 Jun 3, 2022
TeddyDD pushed a commit to TeddyDD/kakoune that referenced this issue Aug 19, 2022
Building static binaries with Alpine Linux's musl libc-based toolchain
should make them work on any distros with Linux kernel 2.6.39 and newer.

Fixes mawww#4555

References:

- https://wiki.musl-libc.org/supported-platforms.html

Signed-off-by: Masanori Ogino <masanori.ogino@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants