# Static Builds Useful?

**URL:** <https://discuss.kakoune.com/t/static-builds-useful/27>\
**Category:** Meta\
**Created:** [September 13, 2018, 6:27am UTC](https://discuss.kakoune.com/t/static-builds-useful/27 "2018-09-13T06:27:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [September 13, 2018, 6:27am UTC](https://discuss.kakoune.com/t/static-builds-useful/27/1 "2018-09-13T06:27:23Z")

</div>

I am considering putting together a handful of static builds for popular platforms build daily and hosted here – is that something people would be interested in?

---

<div class="post-metadata">

**Author:** ![occivink](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/occivink/32/27_2.png) [@occivink](https://discuss.kakoune.com/u/occivink)\
**Post date:** [September 13, 2018, 1:54pm UTC](https://discuss.kakoune.com/t/static-builds-useful/27/2 "2018-09-13T13:54:21Z")

</div>

I considered static builds to work around the problem of debian shipping a castrated ncurses that doesn’t support mouse wheel up (3 years after ncurses6 was released, unbelievable), but as far as I remember it didn’t work out because ncurses has runtime dependencies or something.

Considering that ncurses is the only “real” dependency, I think it’s not as useful as with some other applications.

There is also the problem that you really want the bundled scripts too, so the best solution would be to lobby distros to package kakoune.

---

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [September 13, 2018, 4:27pm UTC](https://discuss.kakoune.com/t/static-builds-useful/27/3 "2018-09-13T16:27:47Z")

</div>

> I considered static builds to work around the problem of debian shipping a castrated ncurses that doesn’t support mouse wheel up

The whole ncurses gpm thing is a mess indeed, on Debian and Debian derivatives… additionally it can be annoying to get it building on older distros, which is exactly what bites me sometimes when support clients. Landing on Ubuntu 12.04 or 14.04 isn’t that unusual… even with 12.04 being EOL like last year.

> There is also the problem that you really want the bundled scripts too, so the best solution would be to lobby distros to package kakoune.

True about the bundled scripts. I think Kakoune is still moving quick enough getting packagers to support it is tough. But as I am writing this comment, I wonder how much headway we could make with just a snap and a flatpak… Snaps work back to 14.04 Ubuntu at this point.

---

<div class="post-metadata">

**Author:** ![mawww](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@mawww](https://discuss.kakoune.com/u/mawww)\
**Post date:** [October 3, 2018, 10:59pm UTC](https://discuss.kakoune.com/t/static-builds-useful/27/4 "2018-10-03T22:59:54Z")

</div>

Kakoune only cares about the relative path from binary to resource files, so it will run happily from a tar.gz expanded anywhere.

AFAIK, the main problem with static linking is that glibc way to get the user name is not compatible with static linking, and warns that it will only work if it can find libresolv.so or something like that.

---

<div class="post-metadata">

**Author:** ![Screwtapello](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/screwtapello/32/12_2.png) [@Screwtapello](https://discuss.kakoune.com/u/Screwtapello)\
**Post date:** [October 18, 2018, 11:29am UTC](https://discuss.kakoune.com/t/static-builds-useful/27/5 "2018-10-18T11:29:07Z")

</div>

I assumed static builds would _not_ be useful, until I tried to build Kakoune on a machine with 500MB of RAM.

Heck, since the only dependencies are ncurses and glibc, both of which have pretty solid ABI guarantees, even dynamically-linked builds would be useful. CentOS 7 only has ncurses 5.9, so a Kakoune built on a CentOS VM wouldn’t have mouse-wheel-up support, but for a lot of uses that’d be better than no Kakoune at all.

It might be useful to have a ‘portable’ makefile target that creates a temporary directory, installs Kakoune into it with “make install”, and tars it up.

---

<div class="post-metadata">

**Author:** ![mawww](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@mawww](https://discuss.kakoune.com/u/mawww)\
**Post date:** [October 21, 2018, 6:36am UTC](https://discuss.kakoune.com/t/static-builds-useful/27/6 "2018-10-21T06:36:02Z")

</div>

> [@Screwtapello](#):
>
> It might be useful to have a ‘portable’ makefile target that creates a temporary directory, installs Kakoune into it with “make install”, and tars it up.

`make PREFIX="" DESTDIR=/tmp/kakoune/ install` should do the trick. tar that directory and you will have something that should work everywhere, regardless of the path it gets untared in.

---

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [April 14, 2019, 5:48pm UTC](https://discuss.kakoune.com/t/static-builds-useful/27/7 "2019-04-14T17:48:46Z")

</div>

I had to add **-lgpm** to make the static build work, but even with that going to older Ubuntu distros I end up with issues like this.

 ![Screenshot%20from%202019-04-14%2013-41-05](https://discuss.kakoune.com/uploads/default/original/1X/b87fe4b68d743ea8fe42135ce46e76a31748c5ac.png)

I tried re-setting up the locale’s (where already working properly I think) confirmed with:

` perl -Mcharnames=:full -CS -wle 'print "\N{EURO SIGN}"'`

prints properly.

---

<div class="post-metadata">

**Author:** ![jthomas](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/jthomas/32/175_2.png) [@jthomas](https://discuss.kakoune.com/u/jthomas)\
**Post date:** [May 8, 2019, 5:31pm UTC](https://discuss.kakoune.com/t/static-builds-useful/27/8 "2019-05-08T17:31:56Z")

</div>

were you able to fix that issue? I’ve got the same thing on my static build working on these old ubuntu14.04 machines. I can cat a file with clippy’s unicode inside and it renders fine, but he doesn’t render in kakoune. I compiled with a static 6.1 ncursesw.

---

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [May 8, 2019, 5:39pm UTC](https://discuss.kakoune.com/t/static-builds-useful/27/9 "2019-05-08T17:39:00Z")

</div>

No, I am really stuck on that issue. 😐

---

<div class="post-metadata">

**Author:** ![Screwtapello](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/screwtapello/32/12_2.png) [@Screwtapello](https://discuss.kakoune.com/u/Screwtapello)\
**Post date:** [May 9, 2019, 1:25am UTC](https://discuss.kakoune.com/t/static-builds-useful/27/10 "2019-05-09T01:25:18Z")

</div>

Wasn’t there something about locale data being moved, or switching to an incompatible format, somewhere between Ubuntu 14.04 and modern times? So a binary statically linked against modern glibc wouldn’t be able to find locale data on an old system, even if locale data works fine for binaries linked with the correctly-archaic version of glibc.

It might be worth trying to statically link MUSL libc rather than glibc, in the hope it’s got a more portable locale-data story.

---

<div class="post-metadata">

**Author:** ![jthomas](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/jthomas/32/175_2.png) [@jthomas](https://discuss.kakoune.com/u/jthomas)\
**Post date:** [May 9, 2019, 6:09pm UTC](https://discuss.kakoune.com/t/static-builds-useful/27/11 "2019-05-09T18:09:17Z")

</div>

@Screwtapello confirmed, just as a test I copied my modern /usr/lib/locale/locale-archive to the old machine and it works. Not a real solution but confirms the issue. For now I’m just going to ignore the problem.

---

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [May 9, 2019, 9:31pm UTC](https://discuss.kakoune.com/t/static-builds-useful/27/12 "2019-05-09T21:31:33Z")

</div>

That is a great confirmation of the issue at least, thanks for doing the legwork.
