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

Bazel build of example failed #2525

Open
shiponcs opened this issue Feb 8, 2024 · 7 comments
Open

Bazel build of example failed #2525

shiponcs opened this issue Feb 8, 2024 · 7 comments
Labels
bug Something isn't working Stale

Comments

@shiponcs
Copy link

shiponcs commented Feb 8, 2024

My system:

> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy

> gcc --version
gcc (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0

Steps to reproduce
Build an example (logs_simple) by running the command from the root directory of the repo

> bazel build examples/logs_simple:example_logs_simple

What is the expected behavior?
It should build the example and generate the binary (example_logs_simple).

What is the actual behavior?
The build fails as follows:

> bazel build examples/logs_simple:example_logs_simple
INFO: Analyzed target //examples/logs_simple:example_logs_simple (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/user/office/opentelemetry/opentelemetry-cpp/sdk/src/logs/BUILD:6:11: Compiling sdk/src/logs/readable_log_record.cc failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 22 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from sdk/src/logs/readable_log_record.cc:5:
bazel-out/k8-fastbuild/bin/sdk/_virtual_includes/headers/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h:76:12: error: 'std::enable_if_t' has not been declared
   76 |       std::enable_if_t<opentelemetry::common::detail::is_key_value_iterable<ArgumentType>::value>
      |            ^~~~~~~~~~~
bazel-out/k8-fastbuild/bin/sdk/_virtual_includes/headers/opentelemetry/sdk/instrumentationscope/instrumentation_scope.h:76:23: error: expected '>' before '<' token
   76 |       std::enable_if_t<opentelemetry::common::detail::is_key_value_iterable<ArgumentType>::value>
      |                       ^
Target //examples/logs_simple:example_logs_simple failed to build
Use --verbose_failures to see the command lines of failed build steps.
@shiponcs shiponcs added the bug Something isn't working label Feb 8, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 8, 2024
@owent
Copy link
Member

owent commented Feb 8, 2024

Could you please try bazel build --host_cxxopt=-std=c++14 --cxxopt=-std=c++14 examples/logs_simple:example_logs_simple ?

@shiponcs
Copy link
Author

shiponcs commented Feb 9, 2024

@owent thanks. This hack worked.

@marcalff
Copy link
Member

marcalff commented Feb 9, 2024

Opentelemetry-cpp no longer supports C++11:

@shiponcs
Copy link
Author

shiponcs commented Feb 11, 2024

Opentelemetry-cpp no longer supports C++11:

@marcalff Thanks. Seems like it doesn't support C++12 either.

@ThomsonTan ThomsonTan removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 12, 2024
@ThomsonTan
Copy link
Contributor

@shiponcs what OpenTelemetry SDK version is built here?

@shiponcs
Copy link
Author

shiponcs commented Feb 13, 2024

@ThomsonTan
tip of the current main branch.

Copy link

This issue was marked as stale due to lack of activity.

@github-actions github-actions bot added the Stale label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

4 participants