textadept icon indicating copy to clipboard operation
textadept copied to clipboard

Getting Cpp17MoveInsertable error on OpenBSD

Open hellium6 opened this issue 3 years ago • 2 comments

I'm not good with c++. I tried to build Textadept 11.1 from source on OpenBSD amd64 and I got this when running gmake GTK3=1:

c++ -c -Os -std=c++17 -pedantic -DGTK -DSCI_LEXER -DSCI_EMPTYCATALOGUE -DNDEBUG -Iscintilla/include -Iscintilla/src -Iscintilla/lexlib -Wall scintilla/src/PerLine.cxx -o PerLine.o
c++ -c -Os -std=c++17 -pedantic -DGTK -DSCI_LEXER -DSCI_EMPTYCATALOGUE -DNDEBUG -Iscintilla/include -Iscintilla/src -Iscintilla/lexlib -Wall scintilla/src/PositionCache.cxx -o PositionCache.o
In file included from scintilla/src/PositionCache.cxx:14:
In file included from /usr/include/c++/v1/string:504:
In file included from /usr/include/c++/v1/string_view:175:
In file included from /usr/include/c++/v1/__string:57:
In file included from /usr/include/c++/v1/algorithm:643:
/usr/include/c++/v1/memory:1720:13: error: static_assert failed due to requirement
      '__is_cpp17_move_insertable<std::__1::allocator<Scintilla::FontAlias>, false>::value' "The specified
      type does not meet the requirements of Cpp17MoveInsertable"
            static_assert(__is_cpp17_move_insertable<allocator_type>::value,
            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/vector:952:21: note: in instantiation of function template specialization
      'std::__1::allocator_traits<std::__1::allocator<Scintilla::FontAlias>
      >::__construct_backward_with_exception_guarantees<Scintilla::FontAlias *>' requested here
    __alloc_traits::__construct_backward_with_exception_guarantees(
                    ^
/usr/include/c++/v1/vector:1094:9: note: in instantiation of member function
      'std::__1::vector<Scintilla::FontAlias, std::__1::allocator<Scintilla::FontAlias>
      >::__swap_out_circular_buffer' requested here
        __swap_out_circular_buffer(__v);
        ^
/usr/include/c++/v1/vector:2022:15: note: in instantiation of member function
      'std::__1::vector<Scintilla::FontAlias, std::__1::allocator<Scintilla::FontAlias> >::__append' requested
      here
        this->__append(__sz - __cs);
              ^
scintilla/src/PositionCache.cxx:52:14: note: in instantiation of member function
      'std::__1::vector<Scintilla::FontAlias, std::__1::allocator<Scintilla::FontAlias> >::resize' requested
      here
        stylesFonts.resize(maxLineLength_ + 1);
                    ^
In file included from scintilla/src/PositionCache.cxx:14:
In file included from /usr/include/c++/v1/string:504:
In file included from /usr/include/c++/v1/string_view:175:
In file included from /usr/include/c++/v1/__string:57:
In file included from /usr/include/c++/v1/algorithm:643:
/usr/include/c++/v1/memory:1720:13: error: static_assert failed due to requirement
      '__is_cpp17_move_insertable<std::__1::allocator<Scintilla::PositionCacheEntry>, false>::value' "The
      specified type does not meet the requirements of Cpp17MoveInsertable"
            static_assert(__is_cpp17_move_insertable<allocator_type>::value,
            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/vector:952:21: note: in instantiation of function template specialization
      'std::__1::allocator_traits<std::__1::allocator<Scintilla::PositionCacheEntry>
      >::__construct_backward_with_exception_guarantees<Scintilla::PositionCacheEntry *>' requested here
    __alloc_traits::__construct_backward_with_exception_guarantees(
                    ^
/usr/include/c++/v1/vector:1094:9: note: in instantiation of member function
      'std::__1::vector<Scintilla::PositionCacheEntry, std::__1::allocator<Scintilla::PositionCacheEntry>
      >::__swap_out_circular_buffer' requested here
        __swap_out_circular_buffer(__v);
        ^
/usr/include/c++/v1/vector:2022:15: note: in instantiation of member function
      'std::__1::vector<Scintilla::PositionCacheEntry, std::__1::allocator<Scintilla::PositionCacheEntry>
      >::__append' requested here
        this->__append(__sz - __cs);
              ^
scintilla/src/PositionCache.cxx:750:7: note: in instantiation of member function
      'std::__1::vector<Scintilla::PositionCacheEntry, std::__1::allocator<Scintilla::PositionCacheEntry>
      >::resize' requested here
        pces.resize(0x400);
             ^
2 errors generated.
gmake: *** [Makefile:175: PositionCache.o] Error 1

I'm at clang 10.0.1

$ clang --version
OpenBSD clang version 10.0.1 
Target: amd64-unknown-openbsd6.9
Thread model: posix
InstalledDir: /usr/bin

hellium6 avatar Jul 31 '21 20:07 hellium6

Just also tried Textadept 11.2 beta 3 (12 Jun 2021)

gmake deps gave me a slight hiccup:

  inflating: scintilla/curses/scinterm-f8980f045c16b79b6d7b83c06db2c6195e89e3e6/jinx/jinx.c  
   creating: scintilla/curses/scinterm-f8980f045c16b79b6d7b83c06db2c6195e89e3e6/patches/
  inflating: scintilla/curses/scinterm-f8980f045c16b79b6d7b83c06db2c6195e89e3e6/patches/02-caretstyle_curses.patch  
make -C scintilla/curses patch
*** Parse error in /home/user/Downloads/textadept-textadept_11.2_beta_3/src/scintilla/curses: Need an operator in 'DEBUG' (Makefile:10)
*** Parse error: Need an operator in 'else' (Makefile:12)
*** Parse error: Need an operator in 'endif' (Makefile:14)
*** Parse error: Need an operator in '../include' (Makefile:24)
*** Parse error: Need an operator in '../src' (Makefile:25)
gmake: *** [Makefile:381: scintilla/curses] Error 1

So I had to run gmake deps DEBUG=0 to make it work.

Then running gmake GTK3=1 showed me:

cc -c -Os -DLUA_USE_LINUX -Ilua/src -std=c99 -pedantic -DGTK -Iscintilla/include -Igtdialog -Wall -I/usr/local/include/gtk-3.0 -I/usr/local/include/at-spi2-atk/2.0 -I/usr/local/include/at-spi-2.0 -I/usr/X11R6/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -I/usr/local/include/gio-unix-2.0 -I/usr/local/include/cairo -I/usr/X11R6/include/libdrm -I/usr/local/include/pango-1.0 -I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/local/include -I/usr/local/include/atk-1.0 -I/usr/X11R6/include/pixman-1 -I/usr/X11R6/include/freetype2 -I/usr/local/include/libpng16 -I/usr/local/include/gdk-pixbuf-2.0 -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -Wno-deprecated-declarations textadept.c -o textadept.o
textadept.c:2447:37: error: use of undeclared identifier 'KERN_PROC_PATHNAME'
  int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
                                    ^
1 error generated.
gmake: *** [Makefile:171: textadept.o] Error 1

hellium6 avatar Jul 31 '21 20:07 hellium6

Sorry for the late response :( GitHub did not e-mail me this issue.

Unfortunately I do not have a BSD box to try and build Textadept with. If you manage to get it working, please let me know so I can apply any necessary patches.

orbitalquark avatar Sep 01 '21 23:09 orbitalquark

In case anyone happens to run into this, I've committed an attempted fix for BSDs here: https://github.com/orbitalquark/textadept/commit/29844846ae445a69d71480608d9e6df1c02940a7

For anyone who tries this, please let me know if it works or doesn't work. Thanks.

orbitalquark avatar Oct 13 '22 04:10 orbitalquark

@orbitalquark got a bit further with your fix on OpenBSD 7.1 with the following changes:

  • Added /usr/local/include to CFLAGS so iconv.h is found
  • <unistd.h> also had to be included in textadept.c (and <sys/sysctl.h> removed)

But linking fails:

ld: error: duplicate symbol: focused_view
>>> defined at textadept.c
>>>            textadept.o:(focused_view)
>>> defined at textadept_gtk.c
>>>            textadept_gtk.o:(.bss+0x20)

(+ many more similar duplicates)

Using GTK2=1.

kiwec avatar Oct 14 '22 07:10 kiwec

Thanks for your help. I'm afraid at this point I'm just going to have to drop BSD support. I simply don't have the capacity to support it :(

orbitalquark avatar Oct 17 '22 16:10 orbitalquark

Seems like most of the issues come from gcc dependency, not OpenBSD itself. Building with clang fails on Linux too.

"Builds" with these changes: https://github.com/kiwec/textadept/commit/4caa4928e2bab6a97de808e86d18dfdbe1c71fd3

However it crashes on startup because of linking errors :/

kiwec avatar Oct 18 '22 09:10 kiwec