Error building roughtime c++ project using bazel

26 views
Skip to first unread message

Althony Lim

unread,
Mar 21, 2024, 6:49:09 AM3/21/24
to proto-roughtime
Hi, 

I am currently struggling in building the Roughtime C++ project on my Ubuntu machine. Can anyone help? :'(

ubuntu@ubuntu:~/Desktop/roughtime.googlesource.com$ bazel run //:simple_client roughtime-servers.json
INFO: Analyzed target //:simple_client (1 packages loaded, 15 targets configured).
ERROR: /home/ubuntu/Desktop/roughtime.googlesource.com/BUILD:76:10: Compiling simple_client.cc failed: (Exit 1): gcc failed: error executing CppCompile command (from target //:simple_client) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++14' -MD -MF ... (remaining 60 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
   12 | #error This file was generated by a newer version of protoc which is
      |  ^~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
   13 | #error incompatible with your Protocol Buffer headers. Please update
      |  ^~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:14:2: error: #error your headers.
   14 | #error your headers.
      |  ^~~~~
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:36:1: error: 'PROTOBUF_NAMESPACE_OPEN' does not name a type
   36 | PROTOBUF_NAMESPACE_OPEN
      | ^~~~~~~~~~~~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:40:1: error: 'PROTOBUF_NAMESPACE_CLOSE' does not name a type
   40 | PROTOBUF_NAMESPACE_CLOSE
      | ^~~~~~~~~~~~~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:66:1: error: 'PROTOBUF_NAMESPACE_OPEN' does not name a type
   66 | PROTOBUF_NAMESPACE_OPEN
      | ^~~~~~~~~~~~~~~~~~~~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:68:39: error: 'Arena' has not been declared
   68 | template<> ::roughtime::config::Link* Arena::CreateMaybeMessage<::roughtime::config::Link>(Arena*);
      |                                       ^~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:68:64: error: expected initializer before '<' token
   68 | template<> ::roughtime::config::Link* Arena::CreateMaybeMessage<::roughtime::config::Link>(Arena*);
      |                                                                ^
bazel-out/k8-fastbuild/bin/config.pb.h:69:41: error: 'Arena' has not been declared
   69 | template<> ::roughtime::config::Server* Arena::CreateMaybeMessage<::roughtime::config::Server>(Arena*);
      |                                         ^~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:69:66: error: expected initializer before '<' token
   69 | template<> ::roughtime::config::Server* Arena::CreateMaybeMessage<::roughtime::config::Server>(Arena*);
      |                                                                  ^
bazel-out/k8-fastbuild/bin/config.pb.h:70:48: error: 'Arena' has not been declared
   70 | template<> ::roughtime::config::ServerAddress* Arena::CreateMaybeMessage<::roughtime::config::ServerAddress>(Arena*);
      |                                                ^~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:70:73: error: expected initializer before '<' token
   70 | template<> ::roughtime::config::ServerAddress* Arena::CreateMaybeMessage<::roughtime::config::ServerAddress>(Arena*);
      |                                                                         ^
bazel-out/k8-fastbuild/bin/config.pb.h:71:46: error: 'Arena' has not been declared
   71 | template<> ::roughtime::config::ServersJSON* Arena::CreateMaybeMessage<::roughtime::config::ServersJSON>(Arena*);
      |                                              ^~~~~
bazel-out/k8-fastbuild/bin/config.pb.h:71:71: error: expected initializer before '<' token
   71 | template<> ::roughtime::config::ServersJSON* Arena::CreateMaybeMessage<::roughtime::config::ServersJSON>(Arena*);
      |                                                                       ^
bazel-out/k8-fastbuild/bin/config.pb.h:72:1: error: 'PROTOBUF_NAMESPACE_CLOSE' does not name a type
   72 | PROTOBUF_NAMESPACE_CLOSE
      | ^~~~~~~~~~~~~~~~~~~~~~~~
simple_client.cc: In function 'bool roughtime::GetUsableServer(std::string*, std::string*, std::string*, const string&)':
simple_client.cc:58:23: error: aggregate 'roughtime::config::ServersJSON servers' has incomplete type and cannot be defined
   58 |   config::ServersJSON servers;
      |                       ^~~~~~~
simple_client.cc:72:9: error: invalid use of incomplete type 'const class roughtime::config::Server'
   72 |     if (server.public_key_type() != "ed25519") {
      |         ^~~~~~
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:55:7: note: forward declaration of 'class roughtime::config::Server'
   55 | class Server;
      |       ^~~~~~
simple_client.cc:76:25: error: invalid use of incomplete type 'const class roughtime::config::Server'
   76 |     for (int j = 0; j < server.addresses_size(); j++) {
      |                         ^~~~~~
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:55:7: note: forward declaration of 'class roughtime::config::Server'
   55 | class Server;
      |       ^~~~~~
simple_client.cc:77:46: error: invalid use of incomplete type 'const class roughtime::config::Server'
   77 |       const config::ServerAddress& address = server.addresses(j);
      |                                              ^~~~~~
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:55:7: note: forward declaration of 'class roughtime::config::Server'
   55 | class Server;
      |       ^~~~~~
simple_client.cc:79:11: error: invalid use of incomplete type 'const class roughtime::config::ServerAddress'
   79 |       if (address.protocol() != "udp") {
      |           ^~~~~~~
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:58:7: note: forward declaration of 'class roughtime::config::ServerAddress'
   58 | class ServerAddress;
      |       ^~~~~~~~~~~~~
simple_client.cc:83:19: error: invalid use of incomplete type 'const class roughtime::config::Server'
   83 |       *out_name = server.name();
      |                   ^~~~~~
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:55:7: note: forward declaration of 'class roughtime::config::Server'
   55 | class Server;
      |       ^~~~~~
simple_client.cc:84:22: error: invalid use of incomplete type 'const class roughtime::config::ServerAddress'
   84 |       *out_address = address.address();
      |                      ^~~~~~~
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:58:7: note: forward declaration of 'class roughtime::config::ServerAddress'
   58 | class ServerAddress;
      |       ^~~~~~~~~~~~~
simple_client.cc:85:25: error: invalid use of incomplete type 'const class roughtime::config::Server'
   85 |       *out_public_key = server.public_key();
      |                         ^~~~~~
In file included from simple_client.cc:36:
bazel-out/k8-fastbuild/bin/config.pb.h:55:7: note: forward declaration of 'class roughtime::config::Server'
   55 | class Server;
      |       ^~~~~~
Target //:simple_client failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.321s, Critical Path: 0.82s
INFO: 3 processes: 3 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

Christopher Patton

unread,
Mar 22, 2024, 12:04:20 PM3/22/24
to Althony Lim, proto-roughtime
Hi Anthony,

The last commit was 3 years ago, so there's a good chance the code is too old to build with more recent tooling.

If you need C++: if I were you I would take some time to update the code and send a CL. There may still be maintainers who would be willing to review.

If you can use Go, there is a fork here that is still maintained here: https://github.com/cloudflare/roughtime

--
You received this message because you are subscribed to the Google Groups "proto-roughtime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proto-roughti...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/proto-roughtime/c9165908-6a60-4d1a-b794-4fa5d2f19a7dn%40chromium.org.
Reply all
Reply to author
Forward
0 new messages