OpenLightingProject / ola

The Open Lighting Architecture - The Travel Adaptor for the Lighting Industry
https://www.openlighting.org/ola/
Other
644 stars 204 forks source link

Newer protobuf requires at least C++14, abseil may need C++17 #1879

Open peternewman opened 1 year ago

peternewman commented 1 year ago
          Additionally. unfortunately, protobuf also requires at least C++14 but the configure only set `-std=gnu++11`, making the compilation of the test programs, which check for the protobuf headers, fail.

(This is after applying the fix for the protobuf version check in #1875.)

configure:25968: checking for google/protobuf/compiler/command_line_interface.h
configure:25968: g++ -c -g -O2 -std=gnu++11   conftest.cpp >&5
In file included from /usr/include/absl/base/config.h:86,
                 from /usr/include/absl/base/attributes.h:37,
                 from /usr/include/absl/base/internal/raw_logging.h:24,
                 from /usr/include/absl/container/internal/btree.h:61,
                 from /usr/include/absl/container/btree_map.h:56,
                 from /usr/include/google/protobuf/compiler/command_line_interface.h:48,
                 from conftest.cpp:178:
/usr/include/absl/base/policy_checks.h:79:2: error: #error "C++ versions less than C++14 are not supported."
   79 | #error "C++ versions less than C++14 are not supported."
      |  ^~~~~

Originally posted by @SpotlightKid in https://github.com/OpenLightingProject/ola/issues/1867#issuecomment-1630487399

          This says that protobuf supported C++11 until just before version 22.0:

https://protobuf.dev/news/2022-08-03/ Likewise this release of Abseil should work with C++11: https://github.com/abseil/abseil-cpp/tree/20220623.1

Originally posted by @peternewman in https://github.com/OpenLightingProject/ola/issues/1867#issuecomment-1631621302

          Alas, that doesn't help when compiling ola for packages of Linux distributions, which ship newer protobuf versions.

Originally posted by @SpotlightKid in https://github.com/OpenLightingProject/ola/issues/1867#issuecomment-1631625825

          You can also try this branch where I've made some very rudimentary attempts:

https://github.com/peternewman/ola/tree/0.10-c14-compat

More generally if someone can either do us a GitHub Action which compiles against Arch or can run a Buildbot or something we should catch these issues a lot sooner and be able to react to them better. Otherwise it's likely to be a case of pull requests welcome unfortunately...

Originally posted by @peternewman in https://github.com/OpenLightingProject/ola/issues/1867#issuecomment-1631629938

peternewman commented 1 year ago
          I'm trying to build this and I'm getting issue ~~#1867~~ #1864 .

Does anyone know a way around that issue here? I don't want to cross compile, just x86_64. I use this arch pkgbuild and change it's source to this branch.

Originally posted by @topas-rec in https://github.com/OpenLightingProject/ola/issues/1875#issuecomment-1631477421

          > I'm trying to build this and I'm getting issue ~#1867~ #1864 .

Can you share your config.log please?

Alternatively have a look here for something else to test that might help...: https://github.com/OpenLightingProject/ola/issues/1867#issuecomment-1631629938

Originally posted by @peternewman in https://github.com/OpenLightingProject/ola/issues/1875#issuecomment-1631656384

          > Can you share your config.log please?

Sure

ola-git configuration log ``` ==> Making package: ola-git 0.10.6.r1355.g671e66b85-1 (Wed 12 Jul 2023 07:26:36 CEST) ==> Retrieving sources... -> Cloning ola git repo... Cloning into bare repository '/home/tobiasb/.cache/yay/ola-git/ola'... remote: Enumerating objects: 87035, done. remote: Counting objects: 100% (1199/1199), done. remote: Compressing objects: 100% (470/470), done. remote: Total 87035 (delta 766), reused 1094 (delta 727), pack-reused 85836 Receiving objects: 100% (87035/87035), 24.32 MiB | 6.77 MiB/s, done. Resolving deltas: 100% (65913/65913), done. ==> Validating source files with sha256sums... ola ... Skipped :: (1/1) Parsing SRCINFO: ola-git ==> Making package: ola-git 0.10.6.r1355.g671e66b85-1 (Wed 12 Jul 2023 07:26:42 CEST) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Retrieving sources... -> Updating ola git repo... ==> Validating source files with sha256sums... ola ... Skipped ==> Removing existing $srcdir/ directory... ==> Extracting sources... -> Creating working copy of ola git repo... Cloning into 'ola'... done. Switched to a new branch 'makepkg' ==> Starting pkgver()... ==> Updated version: ola-git 0.9.4.r3324.g35c035ed9-1 ==> Sources are ready. ==> Making package: ola-git 0.9.4.r3324.g35c035ed9-1 (Wed 12 Jul 2023 07:26:45 CEST) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> WARNING: Using existing $srcdir/ tree ==> Starting pkgver()... ==> Starting build()... libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'config'. libtoolize: copying file 'config/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'config'. libtoolize: copying file 'config/libtool.m4' libtoolize: copying file 'config/ltoptions.m4' libtoolize: copying file 'config/ltsugar.m4' libtoolize: copying file 'config/ltversion.m4' libtoolize: copying file 'config/lt~obsolete.m4' configure.ac:140: warning: The macro `AC_HEADER_STDC' is obsolete. configure.ac:140: You should run autoupdate. ./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from... configure.ac:140: the top level configure.ac:381: warning: AC_PROG_LEX without either yywrap or noyywrap is obsolete ./lib/autoconf/programs.m4:716: _AC_PROG_LEX is expanded from... ./lib/autoconf/programs.m4:709: AC_PROG_LEX is expanded from... configure.ac:381: the top level configure.ac:30: installing 'config/compile' configure.ac:226: installing 'config/config.guess' configure.ac:226: installing 'config/config.sub' configure.ac:13: installing 'config/install-sh' configure.ac:13: installing 'config/missing' Makefile.am:199: warning: .PHONY was already defined in condition DX_COND_doc, which is included in condition TRUE ... aminclude.am:161: ... '.PHONY' previously defined here Makefile.am:15: 'aminclude.am' included from here Makefile.am:236: warning: .PHONY was already defined in condition DX_COND_doc, which is included in condition TRUE ... aminclude.am:161: ... '.PHONY' previously defined here Makefile.am:15: 'aminclude.am' included from here Makefile.am:240: warning: .PHONY was already defined in condition DX_COND_doc, which is included in condition TRUE ... aminclude.am:161: ... '.PHONY' previously defined here Makefile.am:15: 'aminclude.am' included from here Makefile.am:245: warning: error flake8 not found. Install flake8 and re-run configure.: non-POSIX variable name Makefile.am:245: (probably a GNU make extension) Makefile.am:250: warning: shell find . \( -name "*.h" -or -name "*.cpp" \: non-POSIX variable name Makefile.am:250: (probably a GNU make extension) Makefile.am:259: warning: .PHONY was already defined in condition DX_COND_doc, which is included in condition TRUE ... aminclude.am:161: ... '.PHONY' previously defined here Makefile.am:15: 'aminclude.am' included from here Makefile.am:264: warning: error cpplint not found. Install the forked cpplint (e.g. via pip for the latest version: non-POSIX variable name Makefile.am:264: (probably a GNU make extension) Makefile.am:283: warning: .PHONY was already defined in condition DX_COND_doc, which is included in condition TRUE ... aminclude.am:161: ... '.PHONY' previously defined here Makefile.am:15: 'aminclude.am' included from here Makefile.am:286: warning: error Generating coverage requires configuring with --enable-gcov: non-POSIX variable name Makefile.am:286: (probably a GNU make extension) Makefile.am:292: warning: error gcovr not found. Install gcovr (e.g. via pip for the latest version: non-POSIX variable name Makefile.am:292: (probably a GNU make extension) Makefile.am: installing './INSTALL' Makefile.am: installing 'config/depcomp' python/ola/Makefile.mk:17: installing 'config/py-compile' Makefile.am:177: 'python/Makefile.mk' included from here python/Makefile.mk:2: 'python/ola/Makefile.mk' included from here parallel-tests: installing 'config/test-driver' checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a race-free mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for g++... g++ checking whether the C++ compiler works... yes checking for C++ compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C++... yes checking whether g++ accepts -g... yes checking for g++ option to enable C++11 features... none needed checking whether make supports the include directive... yes (GNU style) checking dependency style of g++... gcc3 checking for gawk... (cached) gawk checking for gcc... gcc checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking how to run the C preprocessor... gcc -E checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for -std=gnu++98 support... yes checking for -std=gnu++11 support... yes configure: checking for random gnu++98 compatibility checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for vfork.h... no checking for sys/select.h... yes checking for sys/socket.h... yes checking for random... no configure: checking for random gnu++11 compatibility checking for random... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for dirent.h that defines DIR... yes checking for library containing opendir... none required checking for sys/types.h... (cached) yes checking for netinet/in.h... yes checking for arpa/nameser.h... yes checking for netdb.h... yes checking for resolv.h... yes checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for errno.h... yes checking for arpa/inet.h... yes checking for bits/sockaddr.h... yes checking for fcntl.h... yes checking for float.h... yes checking for limits.h... yes checking for malloc.h... yes checking for netinet/in.h... (cached) yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking for sys/file.h... yes checking for sys/ioctl.h... yes checking for sys/socket.h... (cached) yes checking for sys/time.h... yes checking for sys/timeb.h... yes checking for syslog.h... yes checking for termios.h... yes checking for unistd.h... (cached) yes checking for asm/termbits.h... yes checking for asm/termios.h... yes checking for assert.h... yes checking for dlfcn.h... yes checking for endian.h... yes checking for execinfo.h... yes checking for linux/if_packet.h... yes checking for math.h... yes checking for net/ethernet.h... yes checking for stropts.h... no checking for sys/ioctl.h... (cached) yes checking for sys/param.h... yes checking for sys/types.h... (cached) yes checking for sys/uio.h... yes checking for sysexits.h... yes checking for winsock2.h... no checking for winerror.h... no checking for random... yes checking for sys/sysctl.h... no checking for net/if.h... yes checking for net/if_arp.h... yes checking for net/route.h... yes checking for net/if_ether.h... no checking for netinet/if_ether.h... yes checking for linux/netlink.h... yes checking for linux/rtnetlink.h... yes checking for _Bool... no checking for stdbool.h that conforms to C99... yes checking how to run the C++ preprocessor... g++ -E checking for uid_t in sys/types.h... yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for int8_t... yes checking for pid_t... yes checking for C/C++ restrict keyword... no checking for size_t... yes checking for ssize_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking the location of hash_map... checking for fork... yes checking for vfork... yes checking for vprintf... yes checking for working fork... yes checking for working vfork... (cached) yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for GNU libc compatible malloc... yes checking for GNU libc compatible realloc... yes checking for working memcmp... yes checking types of arguments for select... int,fd_set *,struct timeval * checking whether lstat correctly handles trailing slash... yes checking whether stat accepts an empty string... no checking whether closedir returns void... no checking for bzero... yes checking for gettimeofday... yes checking for memmove... yes checking for memset... yes checking for mkdir... yes checking for strdup... yes checking for strrchr... yes checking for if_nametoindex... yes checking for inet_ntoa... yes checking for inet_ntop... yes checking for inet_aton... yes checking for inet_pton... yes checking for select... yes checking for socket... yes checking for strerror... yes checking for getifaddrs... yes checking for getloadavg... yes checking for getpwnam_r... yes checking for getpwuid_r... yes checking for getgrnam_r... yes checking for getgrgid_r... yes checking for secure_getenv... yes checking for clock_gettime... yes checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for fgrep... /usr/bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for file... file checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /usr/bin/dd checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 checking for mt... no checking if : is a manifest tool... no checking for dlfcn.h... (cached) yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for linux/version.h... yes checking for Linux epoll(7) interface... yes checking for kqueue... no checking for -rdynamic support... yes checking for IPv6 support... no checking for struct sockaddr.sa_len... no checking for struct sockaddr_dl.sdl_family... no checking for time_t... yes checking for suseconds_t... yes checking for g++ options needed to detect all undeclared functions... none needed checking whether MSG_NOSIGNAL is declared... yes checking whether SO_NOSIGPIPE is declared... no checking whether PF_ROUTE is declared... yes checking whether NET_RT_DUMP is declared... no checking whether RLIMIT_RTPRIO is declared... yes checking whether RLIMIT_RTTIME is declared... yes checking whether SO_REUSEADDR is declared... yes checking whether SO_REUSEPORT is declared... yes checking for termios2... yes checking for linux/spi/spidev.h... yes checking for bison... bison checking for flex... flex checking for lex output file root... lex.yy checking for lex library... none needed checking for library containing yywrap... no checking whether yytext is a pointer... yes checking for pkg-config... (cached) /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for library containing dlopen... none required checking for DMXdev in -ldmx4linux... no checking for dmx/dmxioctl.h... no checking for library containing clock_gettime... none required checking for backtrace in -lexecinfo... no checking for curses.h... yes checking for ncurses/curses.h... no checking for initscr in -lncurses... yes checking for libncurses... yes checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... no checking for pthread_np.h... no checking for 2-arg pthread_setname_np... yes checking for resolv.h... (cached) yes checking for res_init() in -lresolv... yes checking whether res_ninit is declared... yes checking for base_uuid... yes checking for uuid/uuid.h... yes checking for uuid_generate in -luuid... yes checking for dns_sd.h... yes checking for library containing DNSServiceRegister... -ldns_sd checking for avahi... yes checking for SaleaeDeviceApi.h... no configure: WARNING: SaleaeDevice library is not usable. checking for libmicrohttpd... yes checking for MHD_create_response_from_buffer... yes checking for libftdi0... yes checking for libftdi1... yes checking for libusb... yes checking for libusb_error_name... yes checking for libusb_hotplug_api... yes checking for libusb_set_option... yes checking for asm/termios.h... (cached) yes checking for liblo... yes checking for serial port lock directory... /var/lock checking whether python version is >= 2.6... yes checking for python version... 3.11 checking for python platform... linux checking for GNU default python prefix... ${prefix} checking for GNU default python exec_prefix... ${exec_prefix} checking for python script directory (pythondir)... ${PYTHON_PREFIX}/lib/python3.11/site-packages checking for python extension module directory (pyexecdir)... ${PYTHON_EXEC_PREFIX}/lib/python3.11/site-packages checking for python module: google.protobuf... yes checking for flake8... no checking for libprotobuf... yes checking for protoc... /usr/bin/protoc checking protoc version... 23.4.0 checking for google/protobuf/compiler/command_line_interface.h... no configure: error: Cannot find the protoc header files ==> ERROR: A failure occurred in build(). Aborting... -> error making: ola-git-exit status 4 -> Failed to install the following packages. Manual intervention is required: ola-git - exit status 4 ```

Alternatively have a look here for something else to test that might help...: https://github.com/OpenLightingProject/ola/issues/1867#issuecomment-1631629938

I'll try that when I'm back at that machine. Thanks.

Originally posted by @topas-rec in https://github.com/OpenLightingProject/ola/issues/1875#issuecomment-1631931543

          > > Can you share your config.log please?

Sure ola-git configuration log

That's not quite what I'm looking for unfortunately. When it runs ./configure within that process, that should generate a file called config.log with a more verbose view of the configuration stage (and the failure).

I'll try that when I'm back at that machine. Thanks.

Thanks.

Originally posted by @peternewman in https://github.com/OpenLightingProject/ola/issues/1875#issuecomment-1632245126

          [config.log](https://github.com/OpenLightingProject/ola/files/12031126/config.log)

I cannot put this in here as text and even pastebin doesn't accept that size.

Most likely this is the problem: error: static assertion failed: Protobuf only supports C++14 and newer.

Originally posted by @topas-rec in https://github.com/OpenLightingProject/ola/issues/1875#issuecomment-1633021183

          >Alternatively have a look here for something else to test that might help...:

https://github.com/OpenLightingProject/ola/issues/1867#issuecomment-1631629938

I picked the two commits with the version check into my C14 branch and added --with-protoc=/usr/bin/protoc (from https://github.com/OpenLightingProject/ola/issues/1864#issue-1762515033) to the build command and I get this far in configuration:

[...]
checking for python extension module directory (pyexecdir)... ${PYTHON_EXEC_PREFIX}/lib/python3.11/site-packages
checking for python module: google.protobuf... yes
checking for flake8... no
checking for libprotobuf... yes
set protoc to /usr/bin/protoc
checking protoc version... 23.4.0
checking for google/protobuf/compiler/command_line_interface.h... no
configure: error: Cannot find the protoc header files

Originally posted by @topas-rec in https://github.com/OpenLightingProject/ola/issues/1875#issuecomment-1633083063

          > I picked the two commits with the version check into [my C14 branch](https://github.com/topas-rec/ola/tree/0.10-c14-compat)

That looks fine.

and added --with-protoc=/usr/bin/protoc (from #1864 (comment)) to the build command

You don't need that bit unless you're trying to cross-compile, which I suspect you aren't.

and I get this far in configuration:

[...]
checking for python extension module directory (pyexecdir)... ${PYTHON_EXEC_PREFIX}/lib/python3.11/site-packages
checking for python module: google.protobuf... yes
checking for flake8... no
checking for libprotobuf... yes
set protoc to /usr/bin/protoc
checking protoc version... 23.4.0
checking for google/protobuf/compiler/command_line_interface.h... no
configure: error: Cannot find the protoc header files

Again this doesn't tell us enough and we need the config.log which will have a more informative error like you found above, but also some key info in the lines above the error, like did my gnu++11 flagging get correctly through to that code...

Originally posted by @peternewman in https://github.com/OpenLightingProject/ola/issues/1875#issuecomment-1633274565

          This is the config.log from my c14 branch mentioned above:

config.log

Originally posted by @topas-rec in https://github.com/OpenLightingProject/ola/issues/1875#issuecomment-1633557951

peternewman commented 1 year ago

So @topas-rec the underlying error in those seems to be:

configure:25981: checking for google/protobuf/compiler/command_line_interface.h
configure:25981: g++ -c -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -std=gnu++14   conftest.cpp >&5
In file included from /usr/include/absl/types/optional.h:39,
                 from /usr/include/absl/container/internal/common.h:22,
                 from /usr/include/absl/container/internal/btree.h:63,
                 from /usr/include/absl/container/btree_map.h:56,
                 from /usr/include/google/protobuf/compiler/command_line_interface.h:48,
                 from conftest.cpp:178:
/usr/include/absl/utility/utility.h:164:12: error: 'in_place_t' has not been declared in 'std'
  164 | using std::in_place_t;
      |            ^~~~~~~~~~

This tells us that std::in_place_t is only since C++17 https://en.cppreference.com/w/cpp/utility/in_place

Which I think is down to the slightly daft live at head nonsense from the absl library. Which "version"/LTS of abseil are you using, or is it just pulling down the git head each time?

If you try and change all the 14s to 17s in the branch I pointed to or your clone, does that allow it to build, and if so do all the tests still pass? I fear unfortunately it's going to fail and you'll be stuck, becuase we're still using auto_ptr which is removed in C++17: https://en.cppreference.com/w/cpp/memory/auto_ptr

I think that's going to be a 0.12 release feature for us I'd imagine (with 500+ of them in the codebase), so you might have to live with a slightly older abseil for now if you want to build OLA, but as always PRs welcome!

topas-rec commented 1 year ago

Thanks for your help so far.

If you try and change all the 14s to 17s in the branch I pointed to or your clone, does that allow it to build

Sadly (but obviously) this is not enough. (There are many 14s in that code and comments. I replaced all ++14 with ++17 only. Occurrances were found only in configure.ac.

I'll check if I can downgrade abseil (I use abseil-cpp 20230125.3-1 currently.

config.log

peternewman commented 1 year ago

Thanks for your help so far.

No worries, thanks for reporting the error, it would get to the more stable releases in due course.

If you try and change all the 14s to 17s in the branch I pointed to or your clone, does that allow it to build

Sadly (but obviously) this is not enough. (There are many 14s in that code and comments. I replaced all ++14 with ++17 only. Occurrances were found only in configure.ac. config.log

Erm configure succeeded in that config.log, what's the error you actually had with building with that change in place?

I'll check if I can downgrade abseil (I use abseil-cpp 20230125.3-1 currently.

Cool, hopefully that might be an option in the interim.

topas-rec commented 1 year ago

Yeah, the build started. Output was:

Build output ``` ------------------------------------------------------- OLA Version 0.10.9 Prefix: '/usr' Compiler: 'g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -std=gnu++17 ' Linker: '/usr/bin/ld -m elf_x86_64 -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -ldns_sd ' Python: python Python API: yes Java API: no Enable HTTP Server: yes RDM Responder Tests: no Ja Rule: no Enabled Plugins: artnet dummy e131 espnet ftdidmx gpio karate kinet milinst opendmx openpixelcontrol osc pathport renard sandnet shownet spi stageprofi uartdmx usbdmx usbpro UUCP Lock Directory: /var/lock Now type 'make []' where the optional is: all - build everything check - run the tests coverage - build tests and generate coverage doxygen-doc - generate the HTML documentation lint - run the linters ------------------------------------------------------- /usr/bin/protoc --cpp_out ./common/protocol --proto_path ./common/protocol ./common/protocol/Ola.proto /usr/bin/protoc --cpp_out ./common/protocol --proto_path ./common/protocol ./common/protocol/Ola.proto /usr/bin/protoc --cpp_out ./common/rdm --proto_path ./common/rdm ./common/rdm/Pids.proto /usr/bin/protoc --cpp_out ./common/rdm --proto_path ./common/rdm ./common/rdm/Pids.proto /usr/bin/protoc --cpp_out ./common/rpc --proto_path ./common/rpc ./common/rpc/Rpc.proto /usr/bin/protoc --cpp_out ./common/rpc --proto_path ./common/rpc ./common/rpc/Rpc.proto /usr/bin/protoc --cpp_out ./common/rpc --proto_path ./common/rpc ./common/rpc/TestService.proto /usr/bin/protoc --cpp_out ./common/rpc --proto_path ./common/rpc ./common/rpc/TestService.proto mkdir -p ./include/ola/rdm mkdir -p ./include/ola/timecode sh ./include/ola/rdm/make_rdm_codes.sh ./common/protocol/Ola.proto > ./include/ola/rdm/RDMResponseCodes.h sh ./include/ola/timecode/make_timecode.sh ./common/protocol/Ola.proto > ./include/ola/timecode/TimeCodeEnums.h mkdir -p ./include/ola sh ./include/ola/make_plugin_id.sh ./common/protocol/Ola.proto > ./include/ola/plugin_id.h /usr/bin/protoc --cpp_out ./plugins/artnet/messages/ --proto_path ./plugins/artnet/messages ./plugins/artnet/messages/ArtNetConfigMessages.proto /usr/bin/protoc --cpp_out ./plugins/artnet/messages/ --proto_path ./plugins/artnet/messages ./plugins/artnet/messages/ArtNetConfigMessages.proto /usr/bin/protoc --cpp_out ./plugins/usbpro/messages/ --proto_path ./plugins/usbpro/messages/ ./plugins/usbpro/messages/UsbProConfigMessages.proto /usr/bin/protoc --cpp_out ./plugins/usbpro/messages/ --proto_path ./plugins/usbpro/messages/ ./plugins/usbpro/messages/UsbProConfigMessages.proto /usr/bin/protoc --cpp_out ./plugins/e131/messages/ --proto_path ./plugins/e131/messages/ ./plugins/e131/messages/E131ConfigMessages.proto /usr/bin/protoc --cpp_out ./plugins/e131/messages/ --proto_path ./plugins/e131/messages/ ./plugins/e131/messages/E131ConfigMessages.proto mkdir -p ./python/ola/rpc /usr/bin/protoc --python_out ./python/ola/rpc -I ./common/rpc/ ./common/rpc/Rpc.proto /usr/bin/protoc --python_out ./python/ola/ -I ./plugins/artnet/messages ./plugins/artnet/messages/ArtNetConfigMessages.proto /usr/bin/protoc --python_out ./python/ola/ -I ./common/protocol ./common/protocol/Ola.proto /usr/bin/protoc --python_out ./python/ola/ -I ./plugins/usbpro/messages ./plugins/usbpro/messages/UsbProConfigMessages.proto /usr/bin/protoc --python_out ./python/ola/ -I ./common/rdm ./common/rdm/Pids.proto echo "location = '/usr/share/ola/pids'" > ./python/ola/PidStoreLocation.py echo "version = '0.10.9'" > ./python/ola/Version.py flex -o./tools/ola_trigger/lex.yy.cpp ./tools/ola_trigger/config.lex bison --defines=./tools/ola_trigger/config.tab.h --output-file=./tools/ola_trigger/config.tab.cpp ./tools/ola_trigger/config.ypp bison --defines=./tools/ola_trigger/config.tab.h --output-file=./tools/ola_trigger/config.tab.cpp ./tools/ola_trigger/config.ypp ./tools/ola_trigger/config.ypp: warning: 2 shift/reduce conflicts [-Wconflicts-sr] ./tools/ola_trigger/config.ypp: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples ./tools/ola_trigger/config.ypp: warning: 2 shift/reduce conflicts [-Wconflicts-sr] ./tools/ola_trigger/config.ypp: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples g++ -DHAVE_CONFIG_H -I. -I./include -I./include -Wall -Wformat -W -fvisibility-inlines-hidden -DPROTOBUF_USE_DLLS -DNOMINMAX -Werror -Wno-error=deprecated-declarations -Werror -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=sign-compare -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -std=gnu++17 -MT protoc/ola_protoc_plugin-CppFileGenerator.o -MD -MP -MF protoc/.deps/ola_protoc_plugin-CppFileGenerator.Tpo -c -o protoc/ola_protoc_plugin-CppFileGenerator.o `test -f 'protoc/CppFileGenerator.cpp' || echo './'`protoc/CppFileGenerator.cpp g++ -DHAVE_CONFIG_H -I. -I./include -I./include -Wall -Wformat -W -fvisibility-inlines-hidden -DPROTOBUF_USE_DLLS -DNOMINMAX -Werror -Wno-error=deprecated-declarations -Werror -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=sign-compare -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -std=gnu++17 -MT protoc/ola_protoc_plugin-CppGenerator.o -MD -MP -MF protoc/.deps/ola_protoc_plugin-CppGenerator.Tpo -c -o protoc/ola_protoc_plugin-CppGenerator.o `test -f 'protoc/CppGenerator.cpp' || echo './'`protoc/CppGenerator.cpp g++ -DHAVE_CONFIG_H -I. -I./include -I./include -Wall -Wformat -W -fvisibility-inlines-hidden -DPROTOBUF_USE_DLLS -DNOMINMAX -Werror -Wno-error=deprecated-declarations -Werror -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=sign-compare -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -std=gnu++17 -MT protoc/ola_protoc_plugin-GeneratorHelpers.o -MD -MP -MF protoc/.deps/ola_protoc_plugin-GeneratorHelpers.Tpo -c -o protoc/ola_protoc_plugin-GeneratorHelpers.o `test -f 'protoc/GeneratorHelpers.cpp' || echo './'`protoc/GeneratorHelpers.cpp g++ -DHAVE_CONFIG_H -I. -I./include -I./include -Wall -Wformat -W -fvisibility-inlines-hidden -DPROTOBUF_USE_DLLS -DNOMINMAX -Werror -Wno-error=deprecated-declarations -Werror -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=sign-compare -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -std=gnu++17 -MT protoc/ola_protoc_plugin-ServiceGenerator.o -MD -MP -MF protoc/.deps/ola_protoc_plugin-ServiceGenerator.Tpo -c -o protoc/ola_protoc_plugin-ServiceGenerator.o `test -f 'protoc/ServiceGenerator.cpp' || echo './'`protoc/ServiceGenerator.cpp In file included from ./protoc/CppFileGenerator.h:45, from protoc/CppFileGenerator.cpp:44: ./protoc/ServiceGenerator.h:117:3: error: ISO C++ forbids declaration of ‘GOOGLE_DISALLOW_EVIL_CONSTRUCTORS’ with no type [-fpermissive] 117 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./protoc/CppFileGenerator.h:45, from protoc/CppGenerator.cpp:28: ./protoc/ServiceGenerator.h:117:3: error: ISO C++ forbids declaration of ‘GOOGLE_DISALLOW_EVIL_CONSTRUCTORS’ with no type [-fpermissive] 117 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ protoc/CppGenerator.cpp: In member function ‘virtual bool ola::CppGenerator::Generate(const google::protobuf::FileDescriptor*, const std::string&, google::protobuf::compiler::OutputDirectory*, std::string*) const’: protoc/CppGenerator.cpp:52:3: warning: ‘template class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 52 | auto_ptr header_output( | ^~~~~~~~ In file included from /usr/include/c++/13.1.1/memory:78, from /usr/include/google/protobuf/descriptor.h:60, from protoc/CppGenerator.cpp:20: /usr/include/c++/13.1.1/bits/unique_ptr.h:65:28: note: declared here 65 | template class auto_ptr; | ^~~~~~~~ protoc/CppGenerator.cpp:57:3: warning: ‘template class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations] 57 | auto_ptr code_output( | ^~~~~~~~ /usr/include/c++/13.1.1/bits/unique_ptr.h:65:28: note: declared here 65 | template class auto_ptr; | ^~~~~~~~ In file included from protoc/ServiceGenerator.cpp:43: ./protoc/ServiceGenerator.h:117:3: error: ISO C++ forbids declaration of ‘GOOGLE_DISALLOW_EVIL_CONSTRUCTORS’ with no type [-fpermissive] 117 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mv -f protoc/.deps/ola_protoc_plugin-GeneratorHelpers.Tpo protoc/.deps/ola_protoc_plugin-GeneratorHelpers.Po g++ -DHAVE_CONFIG_H -I. -I./include -I./include -Wall -Wformat -W -fvisibility-inlines-hidden -DPROTOBUF_USE_DLLS -DNOMINMAX -Werror -Wno-error=deprecated-declarations -Werror -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=sign-compare -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -std=gnu++17 -MT protoc/ola_protoc_plugin-StrUtil.o -MD -MP -MF protoc/.deps/ola_protoc_plugin-StrUtil.Tpo -c -o protoc/ola_protoc_plugin-StrUtil.o `test -f 'protoc/StrUtil.cpp' || echo './'`protoc/StrUtil.cpp make: *** [Makefile:14826: protoc/ola_protoc_plugin-CppGenerator.o] Error 1 make: *** Waiting for unfinished jobs.... protoc/StrUtil.cpp: In function ‘char* ola::FastHexToBuffer(int, char*)’: protoc/StrUtil.cpp:271:3: error: ‘GOOGLE_CHECK’ was not declared in this scope 271 | GOOGLE_CHECK(i >= 0) | ^~~~~~~~~~~~ protoc/StrUtil.cpp: In function ‘char* ola::FastUInt64ToBufferLeft(uint64_t, char*)’: protoc/StrUtil.cpp:451:3: error: ‘GOOGLE_DCHECK_LT’ was not declared in this scope 451 | GOOGLE_DCHECK_LT(digits, 100); | ^~~~~~~~~~~~~~~~ make: *** [Makefile:14868: protoc/ola_protoc_plugin-StrUtil.o] Error 1 make: *** [Makefile:14812: protoc/ola_protoc_plugin-CppFileGenerator.o] Error 1 make: *** [Makefile:14854: protoc/ola_protoc_plugin-ServiceGenerator.o] Error 1 ==> ERROR: A failure occurred in build(). Aborting... -> error making: ola-git-exit status 4 ```

I didn't look into it, because I can imagine how much there is to do and I guess that exceeds my time for that. Maybe I will try that some day.

topas-rec commented 1 year ago

I'll check if I can downgrade abseil (I use abseil-cpp 20230125.3-1 currently.

Cool, hopefully that might be an option in the interim.

For everyone on arch:

warning: downgrading package protobuf (23.4-1 => 21.12-2)

makes ola-git run again.

peternewman commented 1 year ago

For everyone on arch:

warning: downgrading package protobuf (23.4-1 => 21.12-2)

makes ola-git run again.

Excellent, I'm glad you've got an interim solution sorted.

Hopefully it's already obvious to arch users, but would you mind sharing the command to run to downgrade protobuf for the future selves who find themselves at this issue?

peternewman commented 1 year ago

Yeah, the build started.

Well that's progress at least! :smile:

So there are three core classes of issue in that so far:

./protoc/ServiceGenerator.h:117:3: error: ISO C++ forbids declaration of ‘GOOGLE_DISALLOW_EVIL_CONSTRUCTORS’ with no type [-fpermissive]
  117 |   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator);

This seems to be fixed by dropping the old macro and replacing it with some delete commands: From: https://github.com/protocolbuffers/protobuf/pull/5368/files#diff-9ed8738d1449f4760c3f4865d147678a024a6d73d35ed94999db2d74b4bfa2edL65-L66

To: https://github.com/protocolbuffers/protobuf/pull/5368/files#diff-9ed8738d1449f4760c3f4865d147678a024a6d73d35ed94999db2d74b4bfa2edR50-R52

protoc/StrUtil.cpp: In function ‘char* ola::FastHexToBuffer(int, char*)’:
protoc/StrUtil.cpp:271:3: error: ‘GOOGLE_CHECK’ was not declared in this scope
  271 |   GOOGLE_CHECK(i >= 0)

This are just doing some compilation checks, so you could just delete/comment them out as a test.

protoc/StrUtil.cpp: In function ‘char* ola::FastUInt64ToBufferLeft(uint64_t, char*)’:
protoc/StrUtil.cpp:451:3: error: ‘GOOGLE_DCHECK_LT’ was not declared in this scope
  451 |   GOOGLE_DCHECK_LT(digits, 100);

Likewise again.

That ought to prove fairly quickly whether it will just work after that, or there will be a never ending list of further issues.

I'll also flag again, if someone either wants to volunteer a machine for us to test with via Buildbot, or better yet an Arch docker image or something we can run continuous integration against, we'd hopefully catch these issues sooner and maybe even before you notice as an end user...

topas-rec commented 1 year ago

My command is not everyone elses command because it depends on the installed packages (and arch users should know where to find such information ;-)).

One has to downgrade all packages that have unmet dependencies if protobufwould be downgraded until the transaction is valid for pacman.

The arch wiki: Downgrading packages holds all necessary information about this. Including warnings, that partially upgrades are not supported. So this should be a temporary solution. A better temporary solution would be to create a compat package (from the arch FAQ).

Start with sudo pacman --upgrade /var/cache/pacman/pkg/protobuf-21.12-2-x86_64.pkg.tar.zst (use packages from the cache on the hard drive or from the arch linux archive - see link to arch wiki: Downgrading packages above)

Then read the problems that pacman prints about packages that would have unmet dependencies if protobuf would be downgraded. Then downgrade those packages, too.

My specific command was sudo pacman --upgrade /var/cache/pacman/pkg/protobuf-21.12-2-x86_64.pkg.tar.zst /var/cache/pacman/pkg/libphonenumber-1:8.13.14-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/mumble-1.5.517-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/mumble-server-1.5.517-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/python-protobuf-21.12-2-x86_64.pkg.tar.zst

Then pacmanneeds to ignore those packages on updates (see wiki link).

topas-rec commented 1 year ago

For everyone on arch:

warning: downgrading package protobuf (23.4-1 => 21.12-2)

makes ola-git run again.

This (holding back protobuf and the dependencies listed above) doesn't work for me anymore. Other tools (Evolution in this case) need the updated libs.

I derived a "compat" package (see above) from the protobuf PKGBUILD. It provides just the missing protobufc.so.32 library. This works for me and is the better temporary solution.

I'll try to get this package into the AUR and link it here.

topas-rec commented 1 year ago

compat package for arch created at: https://aur.archlinux.org/packages/libprotobuf-compat-32

cbix commented 10 months ago

@topas-rec did you also manage to build ola on Arch? I believe for that we'll also need an older abseil-cpp.

Update: legacy protobuf + abseil versions + fixed ola are now in proaudio + AUR.

vermaete commented 10 months ago

The current Yocto version if failing due to the version of protoc is now 23.4.0 In the previous release of Yocto (Mickeldore) is was 3.21.12. Is there already a solution (at branch or patch) for the fix of the checking for google/protobuf/compiler/command_line_interface.h... no issue?

| checking for libprotobuf... yes
| set protoc to /home/jan/projects/meta-dmx512/build/tmp/work/x86_64-linux/ola-native/0.10.9/recipe-sysroot-native/usr/bin/protoc
| checking protoc version... 23.4.0
| checking for google/protobuf/compiler/command_line_interface.h... no
| configure: error: Cannot find the protoc header files
| NOTE: The following config.log files may provide further information.
| NOTE: /home/jan/projects/meta-dmx512/build/tmp/work/x86_64-linux/ola-native/0.10.9/ola-0.10.9/config.log
| ERROR: configure failed

The patch Fix protoc version checking, since v20.x did help to detect the protoc.

br

kripton commented 7 months ago

In the Gentoo Linux world, it's not yet a problem for stable amd64 systems (since other packages suffer the same pain as we do, see tracker bug at https://bugs.gentoo.org/912819). However, for unstable ~amd64 systems, protobuf might already be at 23.3. Ola's reference to the TRACKER bug is https://bugs.gentoo.org/923757