Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUILD] Default bazel build fails #1802

Closed
marcalff opened this issue Nov 23, 2022 · 2 comments · Fixed by #1816
Closed

[BUILD] Default bazel build fails #1802

marcalff opened this issue Nov 23, 2022 · 2 comments · Fixed by #1816
Assignees
Labels
bug Something isn't working build and test

Comments

@marcalff
Copy link
Member

Clone a fresh opentelemetry-cpp repository.

Run:
CC=/usr/bin/gcc-11 CXX=/usr/bin/g++-11 bazel build //...

Expecting the code to build, per instructions from INSTALL.md

Instead, it breaks here:

malff@localhost.localdomain:opentelemetry-cpp> CC=/usr/bin/gcc-11 CXX=/usr/bin/g++-11 bazel build //...
INFO: Analyzed 202 targets (0 packages loaded, 0 targets configured).
INFO: Found 202 targets...
ERROR: /home/malff/CODE/MY_GITHUB/opentelemetry-cpp/ext/src/http/client/nosend/BUILD:3:11: Compiling ext/src/http/client/nosend/http_client_factory_nosend.cc failed: (Exit 1): gcc-11 failed: error executing command /usr/bin/gcc-11 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 41 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
ext/src/http/client/nosend/http_client_factory_nosend.cc: In static member function 'static std::shared_ptr<opentelemetry::v1::ext::http::client::HttpClient> opentelemetry::v1::ext::http::client::HttpClientFactory::CreateNoSend()':
ext/src/http/client/nosend/http_client_factory_nosend.cc:12:40: error: 'nosend' is not a member of 'http_client'
   12 |   return std::make_shared<http_client::nosend::HttpClient>();
      |                                        ^~~~~~
ext/src/http/client/nosend/http_client_factory_nosend.cc:12:40: error: 'nosend' is not a member of 'http_client'
ext/src/http/client/nosend/http_client_factory_nosend.cc:12:15: error: parse error in template argument list
   12 |   return std::make_shared<http_client::nosend::HttpClient>();
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ext/src/http/client/nosend/http_client_factory_nosend.cc:12:59: error: no matching function for call to 'make_shared<<expression error> >()'
   12 |   return std::make_shared<http_client::nosend::HttpClient>();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/11/memory:77,
                 from bazel-out/k8-fastbuild/bin/api/_virtual_includes/api/opentelemetry/nostd/function_ref.h:6,
                 from bazel-out/k8-fastbuild/bin/ext/_virtual_includes/headers/opentelemetry/ext/http/client/http_client.h:10,
                 from ext/src/http/client/nosend/http_client_factory_nosend.cc:4:
/usr/include/c++/11/bits/shared_ptr.h:875:5: note: candidate: 'template<class _Tp, class ... _Args> std::shared_ptr<_Tp> std::make_shared(_Args&& ...)'
  875 |     make_shared(_Args&&... __args)
      |     ^~~~~~~~~~~
/usr/include/c++/11/bits/shared_ptr.h:875:5: note:   template argument deduction/substitution failed:
ext/src/http/client/nosend/http_client_factory_nosend.cc:12:59: error: template argument 1 is invalid
   12 |   return std::make_shared<http_client::nosend::HttpClient>();
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
INFO: Elapsed time: 1.024s, Critical Path: 0.88s
INFO: 58 processes: 50 internal, 8 linux-sandbox.
FAILED: Build did NOT complete successfully

I suspect nosend is not seen because #ifdef ENABLE_TESTING is not defined.

No idea how to fix this (not a bazel user, not familiar with ext that contains test code).

@marcalff marcalff added bug Something isn't working build and test labels Nov 23, 2022
@esigo esigo self-assigned this Nov 27, 2022
@owent
Copy link
Member

owent commented Nov 28, 2022

I think http client factory for nosend client should also be disabled without ENABLE_TESTING .

@esigo
Copy link
Member

esigo commented Nov 28, 2022

@marcalff sorry I missed this. You could use bazel query '//... except kind(.*test, //...)' | xargs bazel build --cxxopt=-std=c++14 to build non-test targets after merging the PR I just raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build and test
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants