GithubHelp home page GithubHelp logo

compiler error. "call of overloaded ‘Set(const seastar::basic_sstring<char, unsigned int, 15>&, google::protobuf::Arena*)’ is ambiguous" about seastar HOT 8 CLOSED

mickey298 avatar mickey298 commented on May 24, 2024
compiler error. "call of overloaded ‘Set(const seastar::basic_sstring&, google::protobuf::Arena*)’ is ambiguous"

from seastar.

Comments (8)

tchaikov avatar tchaikov commented on May 24, 2024

@mickey298 just created a fix. in future, please always paste the full copy of the error messages.

from seastar.

mickey298 avatar mickey298 commented on May 24, 2024

@mickey298 just created a fix. in future, please always paste the full copy of the error messages.

My bad. Here is the full error log:

ninja: Entering directory `build/release'
[24/320] Building CXX object CMakeFiles/seastar.dir/src/core/prometheus.cc.o
FAILED: CMakeFiles/seastar.dir/src/core/prometheus.cc.o
/usr/bin/g++ -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_DEFERRED_ACTION_REQUIRE_NOEXCEPT -DSEASTAR_HAS_MEMBARRIER -DSEASTAR_HAVE_ASAN_FIBER_SUPPORT -DSEASTAR_HAVE_DPDK -DSEASTAR_HAVE_HWLOC -DSEASTAR_HAVE_NUMA -DSEASTAR_HAVE_SYSTEMTAP_SDT -DSEASTAR_HAVE_URING -DSEASTAR_LOGGER_COMPILE_TIME_FMT -DSEASTAR_LOGGER_TYPE_STDOUT -DSEASTAR_PTHREAD_ATTR_SETAFFINITY_NP -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_SSTRING -DSEASTAR_STRERROR_R_CHAR_P -I/home/warren/projects/seastar/include -I/home/warren/projects/seastar/build/release/gen/include -I/home/warren/projects/seastar/build/release/gen/src -I/home/warren/projects/seastar/src -isystem /home/warren/projects/seastar/build/release/_cooking/installed/include -O2 -g -DNDEBUG -std=gnu++23 -U_FORTIFY_SOURCE -Wno-maybe-uninitialized -march=native -Wno-error=unused-result -UNDEBUG -Wall -Werror -Wimplicit-fallthrough -Wdeprecated -Wno-error=deprecated -Wno-error=stringop-overflow -Wno-error=array-bounds -fvisibility=hidden -gz -Wno-volatile -MD -MT CMakeFiles/seastar.dir/src/core/prometheus.cc.o -MF CMakeFiles/seastar.dir/src/core/prometheus.cc.o.d -o CMakeFiles/seastar.dir/src/core/prometheus.cc.o -c /home/warren/projects/seastar/src/core/prometheus.cc
In file included from /home/warren/projects/seastar/src/core/prometheus.cc:25:
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h: In instantiation of ‘void io::prometheus::client::LabelPair::set_name(Arg_&&, Args_ ...) [with Arg_ = const seastar::basic_sstring<char, unsigned int, 15>; Args_ = {}]’:
/home/warren/projects/seastar/src/core/prometheus.cc:81:24:   required from here
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h:2838:19: error: call of overloaded ‘Set(const seastar::basic_sstring<char, unsigned int, 15>, google::protobuf::Arena*)’ is ambiguous
 2838 |   _impl_.name_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
      |   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h:28:
/usr/include/google/protobuf/arenastring.h:478:22: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const std::string&, google::protobuf::Arena*) [with OverloadDisambiguator = {}; std::string = std::__cxx11::basic_string<char>]’
  478 | PROTOBUF_EXPORT void ArenaStringPtr::Set(const std::string& value,
      |                      ^~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:295:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(absl::lts_20230802::string_view, google::protobuf::Arena*)’
  295 |   void Set(absl::string_view value, Arena* arena);
      |        ^~~
/usr/include/google/protobuf/arenastring.h:296:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  296 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h: In instantiation of ‘void io::prometheus::client::LabelPair::set_value(Arg_&&, Args_ ...) [with Arg_ = const seastar::basic_sstring<char, unsigned int, 15>; Args_ = {}]’:
/home/warren/projects/seastar/src/core/prometheus.cc:82:25:   required from here
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h:2891:20: error: call of overloaded ‘Set(const seastar::basic_sstring<char, unsigned int, 15>, google::protobuf::Arena*)’ is ambiguous
 2891 |   _impl_.value_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
      |   ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:478:22: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const std::string&, google::protobuf::Arena*) [with OverloadDisambiguator = {}; std::string = std::__cxx11::basic_string<char>]’
  478 | PROTOBUF_EXPORT void ArenaStringPtr::Set(const std::string& value,
      |                      ^~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:295:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(absl::lts_20230802::string_view, google::protobuf::Arena*)’
  295 |   void Set(absl::string_view value, Arena* arena);
      |        ^~~
/usr/include/google/protobuf/arenastring.h:296:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  296 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h: In instantiation of ‘void io::prometheus::client::LabelPair::set_name(Arg_&&, Args_ ...) [with Arg_ = const seastar::basic_sstring<char, unsigned int, 15>&; Args_ = {}]’:
/home/warren/projects/seastar/src/core/prometheus.cc:86:24:   required from here
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h:2838:19: error: call of overloaded ‘Set(const seastar::basic_sstring<char, unsigned int, 15>&, google::protobuf::Arena*)’ is ambiguous
 2838 |   _impl_.name_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
      |   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:478:22: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const std::string&, google::protobuf::Arena*) [with OverloadDisambiguator = {}; std::string = std::__cxx11::basic_string<char>]’
  478 | PROTOBUF_EXPORT void ArenaStringPtr::Set(const std::string& value,
      |                      ^~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:295:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(absl::lts_20230802::string_view, google::protobuf::Arena*)’
  295 |   void Set(absl::string_view value, Arena* arena);
      |        ^~~
/usr/include/google/protobuf/arenastring.h:296:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  296 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h: In instantiation of ‘void io::prometheus::client::LabelPair::set_value(Arg_&&, Args_ ...) [with Arg_ = const seastar::basic_sstring<char, unsigned int, 15>&; Args_ = {}]’:
/home/warren/projects/seastar/src/core/prometheus.cc:87:25:   required from here
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h:2891:20: error: call of overloaded ‘Set(const seastar::basic_sstring<char, unsigned int, 15>&, google::protobuf::Arena*)’ is ambiguous
 2891 |   _impl_.value_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
      |   ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:478:22: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const std::string&, google::protobuf::Arena*) [with OverloadDisambiguator = {}; std::string = std::__cxx11::basic_string<char>]’
  478 | PROTOBUF_EXPORT void ArenaStringPtr::Set(const std::string& value,
      |                      ^~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:295:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(absl::lts_20230802::string_view, google::protobuf::Arena*)’
  295 |   void Set(absl::string_view value, Arena* arena);
      |        ^~~
/usr/include/google/protobuf/arenastring.h:296:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  296 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h: In instantiation of ‘void io::prometheus::client::MetricFamily::set_name(Arg_&&, Args_ ...) [with Arg_ = seastar::basic_sstring<char, unsigned int, 15>; Args_ = {}]’:
/home/warren/projects/seastar/src/core/prometheus.cc:800:21:   required from here
/home/warren/projects/seastar/build/release/gen/src/proto/metrics2.pb.h:4708:19: error: call of overloaded ‘Set(seastar::basic_sstring<char, unsigned int, 15>, google::protobuf::Arena*)’ is ambiguous
 4708 |   _impl_.name_.Set(static_cast<Arg_&&>(arg), args..., GetArena());
      |   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:478:22: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const std::string&, google::protobuf::Arena*) [with OverloadDisambiguator = {}; std::string = std::__cxx11::basic_string<char>]’
  478 | PROTOBUF_EXPORT void ArenaStringPtr::Set(const std::string& value,
      |                      ^~~~~~~~~~~~~~
/usr/include/google/protobuf/arenastring.h:295:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(absl::lts_20230802::string_view, google::protobuf::Arena*)’
  295 |   void Set(absl::string_view value, Arena* arena);
      |        ^~~
/usr/include/google/protobuf/arenastring.h:296:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  296 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
[33/320] Building CXX object CMakeFiles/seastar.dir/src/core/reactor.cc.o
ninja: build stopped: subcommand failed.

PS. Thanks a lot. @tchaikov

from seastar.

tchaikov avatar tchaikov commented on May 24, 2024

thanks. updated the patch to address all the places reported above.

from seastar.

mickey298 avatar mickey298 commented on May 24, 2024

I got another error when compilation.

ninja: Entering directory `build/release'
[1/242] Linking CXX executable tests/perf/fstream_perf
FAILED: tests/perf/fstream_perf
: && /usr/bin/g++ -O2 -g -DNDEBUG  tests/perf/CMakeFiles/test_perf_fstream.dir/fstream_perf.cc.o -o tests/perf/fstream_perf  libseastar.a  /usr/lib/libboost_program_options.so  /usr/lib/libboost_thread.so  /usr/lib/libboost_chrono.so  /usr/lib/libboost_atomic.so  /usr/lib/libcares.so  /usr/lib/libfmt.so.10.2.0  /usr/lib/liblz4.so  -ldl  /usr/lib/libgnutls.so  -latomic  /usr/lib/libsctp.so  /usr/lib/libprotobuf.so  /usr/lib/libyaml-cpp.so  /usr/lib/libhwloc.so  /usr/lib/liburing.so  /usr/lib/libnuma.so && :
/usr/bin/ld: libseastar.a(dpdk.o): in function `firmware_read':
eal_firmware.c:(.text+0x2c6f2): undefined reference to `archive_read_new'
/usr/bin/ld: eal_firmware.c:(.text+0x2c706): undefined reference to `archive_read_support_format_raw'
/usr/bin/ld: eal_firmware.c:(.text+0x2c716): undefined reference to `archive_read_support_filter_xz'
/usr/bin/ld: eal_firmware.c:(.text+0x2c72e): undefined reference to `archive_read_open_filename'
/usr/bin/ld: eal_firmware.c:(.text+0x2c741): undefined reference to `archive_read_next_header'
/usr/bin/ld: eal_firmware.c:(.text+0x2c795): undefined reference to `archive_read_data'
/usr/bin/ld: eal_firmware.c:(.text+0x2c7c2): undefined reference to `archive_read_free'
/usr/bin/ld: eal_firmware.c:(.text+0x2c7e8): undefined reference to `archive_read_free'
collect2: error: ld returned 1 exit status
[2/242] Linking CXX executable tests/perf/fair_queue_perf
FAILED: tests/perf/fair_queue_perf
: && /usr/bin/g++ -O2 -g -DNDEBUG  tests/perf/CMakeFiles/test_perf_fair_queue.dir/fair_queue_perf.cc.o -o tests/perf/fair_queue_perf  libseastar_perf_testing.a  libseastar.a  /usr/lib/libboost_program_options.so  /usr/lib/libboost_thread.so  /usr/lib/libboost_chrono.so  /usr/lib/libboost_atomic.so  /usr/lib/libcares.so  /usr/lib/libfmt.so.10.2.0  /usr/lib/liblz4.so  -ldl  /usr/lib/libgnutls.so  -latomic  /usr/lib/libsctp.so  /usr/lib/libprotobuf.so  /usr/lib/libyaml-cpp.so  /usr/lib/libhwloc.so  /usr/lib/liburing.so  /usr/lib/libnuma.so && :
/usr/bin/ld: libseastar.a(dpdk.o): in function `firmware_read':
eal_firmware.c:(.text+0x2c6f2): undefined reference to `archive_read_new'
/usr/bin/ld: eal_firmware.c:(.text+0x2c706): undefined reference to `archive_read_support_format_raw'
/usr/bin/ld: eal_firmware.c:(.text+0x2c716): undefined reference to `archive_read_support_filter_xz'
/usr/bin/ld: eal_firmware.c:(.text+0x2c72e): undefined reference to `archive_read_open_filename'
/usr/bin/ld: eal_firmware.c:(.text+0x2c741): undefined reference to `archive_read_next_header'
/usr/bin/ld: eal_firmware.c:(.text+0x2c795): undefined reference to `archive_read_data'
/usr/bin/ld: eal_firmware.c:(.text+0x2c7c2): undefined reference to `archive_read_free'
/usr/bin/ld: eal_firmware.c:(.text+0x2c7e8): undefined reference to `archive_read_free'
collect2: error: ld returned 1 exit status
[3/242] Linking CXX executable tests/perf/shared_token_bucket_perf
FAILED: tests/perf/shared_token_bucket_perf
: && /usr/bin/g++ -O2 -g -DNDEBUG  tests/perf/CMakeFiles/test_perf_shared_token_bucket.dir/shared_token_bucket.cc.o -o tests/perf/shared_token_bucket_perf  libseastar_perf_testing.a  libseastar.a  /usr/lib/libboost_program_options.so  /usr/lib/libboost_thread.so  /usr/lib/libboost_chrono.so  /usr/lib/libboost_atomic.so  /usr/lib/libcares.so  /usr/lib/libfmt.so.10.2.0  /usr/lib/liblz4.so  -ldl  /usr/lib/libgnutls.so  -latomic  /usr/lib/libsctp.so  /usr/lib/libprotobuf.so  /usr/lib/libyaml-cpp.so  /usr/lib/libhwloc.so  /usr/lib/liburing.so  /usr/lib/libnuma.so && :
/usr/bin/ld: libseastar.a(dpdk.o): in function `firmware_read':
eal_firmware.c:(.text+0x2c6f2): undefined reference to `archive_read_new'
/usr/bin/ld: eal_firmware.c:(.text+0x2c706): undefined reference to `archive_read_support_format_raw'
/usr/bin/ld: eal_firmware.c:(.text+0x2c716): undefined reference to `archive_read_support_filter_xz'
/usr/bin/ld: eal_firmware.c:(.text+0x2c72e): undefined reference to `archive_read_open_filename'
/usr/bin/ld: eal_firmware.c:(.text+0x2c741): undefined reference to `archive_read_next_header'
/usr/bin/ld: eal_firmware.c:(.text+0x2c795): undefined reference to `archive_read_data'
/usr/bin/ld: eal_firmware.c:(.text+0x2c7c2): undefined reference to `archive_read_free'
/usr/bin/ld: eal_firmware.c:(.text+0x2c7e8): undefined reference to `archive_read_free'
collect2: error: ld returned 1 exit status
[4/242] Linking CXX executable tests/perf/future_util_perf
FAILED: tests/perf/future_util_perf
: && /usr/bin/g++ -O2 -g -DNDEBUG  tests/perf/CMakeFiles/test_perf_future_util.dir/future_util_perf.cc.o -o tests/perf/future_util_perf  libseastar_perf_testing.a  libseastar.a  /usr/lib/libboost_program_options.so  /usr/lib/libboost_thread.so  /usr/lib/libboost_chrono.so  /usr/lib/libboost_atomic.so  /usr/lib/libcares.so  /usr/lib/libfmt.so.10.2.0  /usr/lib/liblz4.so  -ldl  /usr/lib/libgnutls.so  -latomic  /usr/lib/libsctp.so  /usr/lib/libprotobuf.so  /usr/lib/libyaml-cpp.so  /usr/lib/libhwloc.so  /usr/lib/liburing.so  /usr/lib/libnuma.so && :
/usr/bin/ld: libseastar.a(dpdk.o): in function `firmware_read':
eal_firmware.c:(.text+0x2c6f2): undefined reference to `archive_read_new'
/usr/bin/ld: eal_firmware.c:(.text+0x2c706): undefined reference to `archive_read_support_format_raw'
/usr/bin/ld: eal_firmware.c:(.text+0x2c716): undefined reference to `archive_read_support_filter_xz'
/usr/bin/ld: eal_firmware.c:(.text+0x2c72e): undefined reference to `archive_read_open_filename'
/usr/bin/ld: eal_firmware.c:(.text+0x2c741): undefined reference to `archive_read_next_header'
/usr/bin/ld: eal_firmware.c:(.text+0x2c795): undefined reference to `archive_read_data'
/usr/bin/ld: eal_firmware.c:(.text+0x2c7c2): undefined reference to `archive_read_free'
/usr/bin/ld: eal_firmware.c:(.text+0x2c7e8): undefined reference to `archive_read_free'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

it still exists after i reinstall libarchive.

 sudo pacman -S libarchive
warning: libarchive-3.7.2-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) libarchive-3.7.2-1

Total Installed Size:  1.16 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n]

Anyway, i still try to figure it out, any progress will post later.

from seastar.

tchaikov avatar tchaikov commented on May 24, 2024

@mickey298 probably you could provide more background, like how you configure the building system, like if you are using the dpdk built by yourself, or installed using the package system, or cooked using --cook option. anyway, this deserves another issue.

i guess the root cause is that you enabled dpdk, and dpdk pulls libarchive in if the latter is installed in the system. while we does not use libdpdk.pc for calculating the ldflags exposed by seastar library. because we want to statically link against libdpdk, we just pull the .a archives manually with a hardwired name list, but we missed the libraries linked by it.

from seastar.

mickey298 avatar mickey298 commented on May 24, 2024

@mickey298 probably you could provide more background, like how you configure the building system, like if you are using the dpdk built by yourself, or installed using the package system, or cooked using --cook option. anyway, this deserves another issue.

i guess the root cause is that you enabled dpdk, and dpdk pulls libarchive in if the latter is installed in the system. while we does not use libdpdk.pc for calculating the ldflags exposed by seastar library. because we want to statically link against libdpdk, we just pull the .a archives manually with a hardwired name list, but we missed the libraries linked by it.


OS

it is a fresh new vm system. and upgrade to latest.

sudo pacman -Syu

after clone this repo and sub module(git submodule update),only run the install-dependencies.sh to install dependencies.
and configure command:

./configure.py --mode=release --enable-dpdk --prefix=/usr

then

 ninja -C build/release

@tchaikov

from seastar.

tchaikov avatar tchaikov commented on May 24, 2024

thanks. so my guess is correct. could you file another issue attached with this information and error messages from linker?

from seastar.

mickey298 avatar mickey298 commented on May 24, 2024

I will try to reproduce this issue on another fresh new vm...But it will take some time.
@tchaikov

from seastar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.