[SOLVED] Help building / obtaining latest release on debian 10.3

[UPDATE]

I am now running Kakoune v2020.01.16 and thank everyone involved in helping me solve this technical issue. I solved it by installing Manjaro however I would like to note to anyone reading this in the future that it is probably a much wiser idea to try g++7 as pointed out by @Screwtapello. I could have also switched to testing and this may have also solved the problem. I don’t want people to think switching distros is the solution, it was just a hasty choice I made with a system I am more experienced with. But going the route of testing or g++7 is probably the wiser choice.

[/UPDATE]

Unfortunately, it seems that on my MX-19 Linux (Debian 10.3) I am running an old version Kakoune 2019.01.20 and my attempts to build from source

   git clone https://github.com/mawww/kakoune.git && cd kakoune/src
   make
   PREFIX=$HOME/.local make install

as per the readme on github. I encounter an error preventing make from continuing

    /usr/include/c++/8/bits/alloc_traits.h:343:26: error: no matching function for call to ‘std::allocator_traits<Kakoune::Allocator<Kakoune::String, (Kakoune::MemoryDomain)0> >::_S_construct(Kakoune::Allocator<Kakoune::String, (Kakoune::MemoryDomain)0>&, Kakoune::String*&, Kakoune::InplaceString<15>)’
      -> decltype(_S_construct(__a, __p, std::forward<_Args>(__args)...))
                  ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Unfortunately I have not touched C or C++ since 2004 and lack the knowledge to resolve this. I know what a header file is, and can understand that it cannot locate a function but beyond that I do not know where to start debugging this. Due to the version of kakoune I am running some plugins like plug.kak and fzf.kak which I would so much love to use are not functioning. I was able to fork and patch plug.kak to work with my build but it seems now that I would have to do the same with fzf. If I were to write my own plugins I would likely be using things that may be removed from the latest or later releases.

I hope that someone here might know where I can start looking for a solution to this problem.

Do you have a recent c++ compiler? Check the dependencies here: https://github.com/mawww/kakoune/blob/master/README.asciidoc#21-building

1 Like

Thank you @JJK96 I think that you are onto the source of my problem. I did

[I] ➜ gcc  --version
gcc (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

While it reports 8.3.0 and requirements (silly me for not checking) state gcc >= 7, (checking other requirements now) I did notice in the error message /usr/include/c++/8/bits/alloc_traits.h does this mean its using C++ 8? In either case I am investigating my options now for getting the latest gcc and compiler tools. It seems the package build-essential is what gives me gcc, the latest version I can find is 12.6

It seems just like python that I should not mess with the system’s version of gcc and instead one possible route I could take is to make a chroot environment and install the latest in there. Doing some research now. Thank you for pointing this out as a possibility.

I am on Debian too, and I have met with similar problems. I have only limited knowledge about these compiler issues, so in the absence of expert advice I too am extremely reluctant to install a newer version of gcc along the current one. As an alternative, did you think of moving from stable to testing? This is what I did about 1 year ago – just to get a version of Kakoune more recent than the prehistoric (2016) one I had! – and I never ran into trouble. Now that the previous testing is again stable, I plan to move permanently to testing, again to get a newer version of Kakoune.

1 Like

That is an option, I have MX-19 Linux which runs on Debian 10.3 so debian stuff should all be compatible. It is sad because I just made the switch from Manjaro where I could have any of the latest versions of software that I wanted. Ill look into switching to testing though I noted on the MX Linux forums a warning to not keep the testing repo active as to not break the system or something. Seriously contemplating my return to Manjaro at this moment because I can have whatever version of anything. And I have experience in that system. Whereas Debian is completely new to me.

I am glad that you had simular problems, not because its good to have problems but because it means that it is not just me. It does very much seem to be either a compiler issue or I am thinking now the version of Stdc++ libraries being used. Ill prob end up just going back to Manjaro. Will update here with what I do.

So the way Debian works is:

  • new versions of packages get uploaded to the unstable repository
  • if the new version doesn’t have any bugs filed against it for 5 days (and it’s not part of a shared-library transition, or a few other technical reasons) it is automatically migrated to the testing repository
  • once every two years or so, stable is renamed to oldstable, testing is copied to stable, and that makes a new release

In general, Debian Testing is about as up-to-date as any other rolling release like Arch or Manjaro, except in the six months leading up to a stable release when Debian developers are focussed on fixing bugs rather than updating packages. When the MX-19 docs say “don’t keep the testing repo active, so as not to break the system”, that’s good advice for people who want to stay on Stable and don’t want to accidentally upgrade their entire system to Testing, but if you’re OK with the instability of Arch or Manjaro, then the instability of Testing isn’t any worse than that.

That said, it surprises me that Kakoune would fail to build on g++ 8 — as you point out, the docs say “g++ 7” and I feel like Debian Testing only transitioned to g++ 9 a little while ago, so there shouldn’t have been enough time for incompatibilities to creep in. Nevertheless, I can reproduce the above build failure on Debian Testing with:

$ sudo apt install g++-8
$ cd kakoune/src
$ git clean -dxf
$ make CXX=g++-8

However, every commit for Kakoune is automatically built on g++7, the build is currently passing and Debian Stable still includes g+±7 so I recommend trying that instead:

$ sudo apt install g++-7
$ cd kakoune/src
$ git clean -dxf
$ make CXX=g++-7

…and see if that helps.

1 Like

Thank you for explaining this to me and also testing the build with g+±8. I belive had I not been in such a haste and seen this reply earlier I would have probably had success with your method of installing g+±7 and building with the CXX flag set. I ended up installing Manjaro because I knew I could imediately have the current version of Kakoune without hastle. Though it seems now that it was probably an easy fix as you pointed out trying to build with version 7. I am now on “Kakoune v2020.01.16” and can happily enjoy learning the kakoune editor.

Thank you everyone for your help and patience. I very much apreciate the usefull information and I belive that I have learned from this experience. Much respect and Thanks.