hbriese/fancon

Failed build due protoc version

artemklevtsov opened this issue · 8 comments

Describe the bug

I tried to wwrite PKGBUILD for the Arch Linux distribution. But I faced with some problems.
Seems current version of the protobuf library not compatible with fancon sources.

Build log:

-- The CXX compiler identification is Clang 10.0.0
-- Check for working CXX compiler: /usr/lib/ccache/bin/clang++
-- Check for working CXX compiler: /usr/lib/ccache/bin/clang++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Boost: /usr/lib64/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0") found components: log thread system filesystem 
-- Found Sensors: /usr/include/sensors  
-- Found Protobuf: /usr/lib/libprotobuf.so;-lpthread (found version "3.11.4") 
-- Found GRPC: /usr/lib/libgrpc.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /var/cache/build/src/fancon/build
Scanning dependencies of target fancon
[  5%] Building CXX object CMakeFiles/fancon.dir/src/main.cpp.o
In file included from /var/cache/build/src/fancon/src/main.cpp:1:
In file included from /var/cache/build/src/fancon/src/main.hpp:23:
In file included from /var/cache/build/src/fancon/src/Controller.hpp:13:
In file included from /var/cache/build/src/fancon/src/Devices.hpp:6:
In file included from /var/cache/build/src/fancon/src/FanDell.hpp:4:
In file included from /var/cache/build/src/fancon/src/DellSMM.hpp:6:
In file included from /var/cache/build/src/fancon/src/FanInterface.hpp:7:
In file included from /var/cache/build/src/fancon/src/SensorInterface.hpp:8:
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:25:2: error: This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
 ^
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:26:2: error: incompatible with your Protocol Buffer headers.  Please
#error incompatible with your Protocol Buffer headers.  Please
 ^
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:27:2: error: regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
 ^
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:215:56: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedInputStream *input) final;
                                                       ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:217:64: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedOutputStream *output) const final;
                                                               ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:219:68: error: only virtual member functions can be marked 'final'
      bool deterministic, ::google::protobuf::uint8 *target) const final;
                                                                   ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:336:56: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedInputStream *input) final;
                                                       ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:338:64: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedOutputStream *output) const final;
                                                               ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:340:68: error: only virtual member functions can be marked 'final'
      bool deterministic, ::google::protobuf::uint8 *target) const final;
                                                                   ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:459:56: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedInputStream *input) final;
                                                       ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:461:64: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedOutputStream *output) const final;
                                                               ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:463:68: error: only virtual member functions can be marked 'final'
      bool deterministic, ::google::protobuf::uint8 *target) const final;
                                                                   ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:567:56: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedInputStream *input) final;
                                                       ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:569:64: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedOutputStream *output) const final;
                                                               ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:571:68: error: only virtual member functions can be marked 'final'
      bool deterministic, ::google::protobuf::uint8 *target) const final;
                                                                   ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:800:56: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedInputStream *input) final;
                                                       ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:802:64: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedOutputStream *output) const final;
                                                               ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:804:68: error: only virtual member functions can be marked 'final'
      bool deterministic, ::google::protobuf::uint8 *target) const final;
                                                                   ^~~~~
/var/cache/build/src/fancon/src/proto/DevicesSpec.pb.h:1010:56: error: only virtual member functions can be marked 'final'
      ::google::protobuf::io::CodedInputStream *input) final;
                                                       ^~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [CMakeFiles/fancon.dir/build.make:83: CMakeFiles/fancon.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/fancon.dir/all] Error 2
make: *** [Makefile:150: all] Error 2

PKGBUILD link: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=fancon-git

Steps to Reproduce

Start docker container with the build environment:

docker run -t -i --rm registry.gitlab.com/aur1/utils:latest bash

Inside container:

sudo pacman --sync --refresh --sysupgrade --noconfirm
aur sync fancon-git --noview --noconfirm

Expected behavior

Sucess build.

Environment

  • Version: 0.20.1.r3.gbebdfc8
  • OS: Arch Linux
  • Kernel: 5.6.10-zen1-1-zen
  • CMake: 3.17.2
  • CLang: 10.0.0
  • ProtoBuf: 3.11.4

I removed the included generated protobuf source files (3479347) and added it to the cmake file so that they're generated when building (0488ee7).

Please pull this latest commits and test this

Thank you for the reply and fix. But still broken now.

==> Starting build()...
-- The CXX compiler identification is Clang 10.0.0
-- Check for working CXX compiler: /usr/lib/ccache/bin/clang++
-- Check for working CXX compiler: /usr/lib/ccache/bin/clang++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Boost: /usr/lib64/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0") found components: log thread system filesystem 
-- Found Sensors: /usr/include/sensors  
-- Found Protobuf: /usr/lib/libprotobuf.so;-lpthread (found version "3.11.4") 
-- Found GRPC: /usr/lib/libgrpc.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /var/cache/build/fancon-git/src/fancon/build
Scanning dependencies of target fancon
[  5%] Building CXX object CMakeFiles/fancon.dir/src/main.cpp.o
In file included from /var/cache/build/fancon-git/src/fancon/src/main.cpp:1:
In file included from /var/cache/build/fancon-git/src/fancon/src/main.hpp:23:
In file included from /var/cache/build/fancon-git/src/fancon/src/Controller.hpp:13:
In file included from /var/cache/build/fancon-git/src/fancon/src/Devices.hpp:6:
In file included from /var/cache/build/fancon-git/src/fancon/src/FanDell.hpp:4:
In file included from /var/cache/build/fancon-git/src/fancon/src/DellSMM.hpp:6:
In file included from /var/cache/build/fancon-git/src/fancon/src/FanInterface.hpp:7:
In file included from /var/cache/build/fancon-git/src/fancon/src/SensorInterface.hpp:8:
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3033:2: error: #elif without #if
#elif __GNUC__
 ^
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3034:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma GCC diagnostic pop
                       ^
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3035:2: error: #endif without #if
#endif //__clang__
 ^
In file included from /var/cache/build/fancon-git/src/fancon/src/main.cpp:1:
In file included from /var/cache/build/fancon-git/src/fancon/src/main.hpp:23:
In file included from /var/cache/build/fancon-git/src/fancon/src/Controller.hpp:13:
In file included from /var/cache/build/fancon-git/src/fancon/src/Devices.hpp:6:
In file included from /var/cache/build/fancon-git/src/fancon/src/FanDell.hpp:4:
In file included from /var/cache/build/fancon-git/src/fancon/src/DellSMM.hpp:6:
In file included from /var/cache/build/fancon-git/src/fancon/src/FanInterface.hpp:9:
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3033:2: error: #elif without #if
#elif __GNUC__
 ^
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3034:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma GCC diagnostic pop
                       ^
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3035:2: error: #endif without #if
#endif //__clang__
 ^
In file included from /var/cache/build/fancon-git/src/fancon/src/main.cpp:1:
In file included from /var/cache/build/fancon-git/src/fancon/src/main.hpp:23:
In file included from /var/cache/build/fancon-git/src/fancon/src/Controller.hpp:13:
In file included from /var/cache/build/fancon-git/src/fancon/src/Devices.hpp:13:
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3033:2: error: #elif without #if
#elif __GNUC__
 ^
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3034:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma GCC diagnostic pop
                       ^
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3035:2: error: #endif without #if
#endif //__clang__
 ^
In file included from /var/cache/build/fancon-git/src/fancon/src/main.cpp:1:
In file included from /var/cache/build/fancon-git/src/fancon/src/main.hpp:23:
In file included from /var/cache/build/fancon-git/src/fancon/src/Controller.hpp:14:
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3033:2: error: #elif without #if
#elif __GNUC__
 ^
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3034:24: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
#pragma GCC diagnostic pop
                       ^
/var/cache/build/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h:3035:2: error: #endif without #if
#endif //__clang__
 ^
4 warnings and 8 errors generated.
make[2]: *** [CMakeFiles/fancon.dir/build.make:83: CMakeFiles/fancon.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/fancon.dir/all] Error 2
make: *** [Makefile:150: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Seems gen_proto.sh works incorrect at line 40:

$ head /var/cache/build/.cache/aurutils/sync/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#elif __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif //__clang__\n\n// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: DevicesSpec.proto

#ifndef GOOGLE_PROTOBUF_INCLUDED_DevicesSpec_2eproto
$ tail /var/cache/build/.cache/aurutils/sync/fancon-git/src/fancon/src/proto/DevicesSpec.pb.h
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)

#include <google/protobuf/port_undef.inc>
#endif  // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_DevicesSpec_2eproto\n\n#ifdef __clang__
#pragma clang diagnostic pop
#elif __GNUC__
#pragma GCC diagnostic pop
#endif //__clang__

To fix this use printf or echo -e.

Hopefully this fixes it (de5bb40). The dangers of shell scripts!

Works now. Thank you.

Now the package is built and working. You can add a link to the documentation if you want.

I'm not entirely familiar with Arch. Are these install instructions sufficient?
git clone https://aur.archlinux.org/fancon-git.git; cd fancon-git
makepkg -sic

git clone https://aur.archlinux.org/fancon-git.git; cd fancon-git
makepkg -sic

that's correct. Also you can add -r to remove a make deps after build.