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

[CI] Add CI for instrumentation/boost_log #424

Merged
merged 12 commits into from
Apr 5, 2024

Conversation

marcalff
Copy link
Member

@marcalff marcalff commented Apr 4, 2024

Fixes #420

Fixed CMakeLists:

  • Require GTest 1.12.0. Building with 1.11 breaks the build due to a gtest bug.
  • Require Boost.Log 1.73, as documented in the README.md. Building with 1.66 breaks the build, as found locally.

Relevant links:

@marcalff
Copy link
Member Author

marcalff commented Apr 4, 2024

Now getting a build break in the boost_log unit test.

-- Build files have been written to: /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/boost_log/build
[1/4] Building CXX object CMakeFiles/opentelemetry_boost_log_sink.dir/src/sink.cc.o
[2/4] Linking CXX static library libopentelemetry_boost_log_sink.a
[3/4] Building CXX object CMakeFiles/sink_test.dir/test/sink_test.cc.o
FAILED: CMakeFiles/sink_test.dir/test/sink_test.cc.o 
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CHRONO_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_LOG_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_THREAD_DYN_LINK -DOPENTELEMETRY_ABI_VERSION_NO=1 -I/home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/include -isystem /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include -Wall -Wextra -Werror -Wpedantic -fPIC -MD -MT CMakeFiles/sink_test.dir/test/sink_test.cc.o -MF CMakeFiles/sink_test.dir/test/sink_test.cc.o.d -o CMakeFiles/sink_test.dir/test/sink_test.cc.o -c /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc
In file included from /usr/include/gmock/gmock.h:59,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:24:
/usr/include/gmock/gmock-actions.h: In instantiation of ‘testing::internal::ReturnAction<R>::Impl<R_, F>::Impl(const std::shared_ptr<_Tp>&) [with R_ = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; F = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>(); R = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>]’:
/usr/include/gmock/gmock-actions.h:662:22:   required from ‘testing::internal::ReturnAction<R>::operator testing::Action<Func>() const [with F = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>(); R = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>]’
/home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:135:56:   required from here
/usr/include/gmock/gmock-actions.h:682:39: error: use of deleted function ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’
  682 |           value_(ImplicitCast_<Result>(value_before_cast_)) {}
      |                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include/opentelemetry/logs/event_id.h:9,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include/opentelemetry/logs/logger_type_traits.h:12,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include/opentelemetry/logs/logger.h:6,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:8:
/home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include/opentelemetry/nostd/unique_ptr.h:45:7: note: ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’ is implicitly declared as deleted because ‘opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>’ declares a move constructor or move assignment operator
   45 | class unique_ptr
      |       ^~~~~~~~~~
In file included from /usr/include/gmock/internal/gmock-port.h:56,
                 from /usr/include/gmock/internal/gmock-internal-utils.h:46,
                 from /usr/include/gmock/gmock-actions.h:145,
                 from /usr/include/gmock/gmock.h:59,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:24:
/usr/include/gtest/internal/gtest-port.h:1070:28: note:   initializing argument 1 of ‘To testing::internal::ImplicitCast_(To) [with To = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>]’
 1070 | inline To ImplicitCast_(To x) { return x; }
      |                         ~~~^
In file included from /usr/include/gmock/gmock.h:59,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:24:
/usr/include/gmock/gmock-actions.h:681:11: error: use of deleted function ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’
  681 |         : value_before_cast_(*value),
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gmock/gmock-actions.h: In instantiation of ‘testing::internal::ReturnAction<R>::Impl<R_, F>::Result testing::internal::ReturnAction<R>::Impl<R_, F>::Perform(const ArgumentTuple&) [with R_ = std::nullptr_t; F = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>(); R = std::nullptr_t; testing::internal::ReturnAction<R>::Impl<R_, F>::Result = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; testing::internal::ReturnAction<R>::Impl<R_, F>::ArgumentTuple = std::tuple<>]’:
/usr/include/gmock/gmock-actions.h:684:12:   required from here
/usr/include/gmock/gmock-actions.h:684:60: error: use of deleted function ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’
  684 |     Result Perform(const ArgumentTuple&) override { return value_; }
      |                                                            ^~~~~~
/usr/include/gmock/gmock-actions.h: In instantiation of ‘testing::internal::ReturnAction<R>::Impl<R_, F>::Result testing::internal::ReturnAction<R>::Impl<R_, F>::Perform(const ArgumentTuple&) [with R_ = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; F = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>(); R = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; testing::internal::ReturnAction<R>::Impl<R_, F>::Result = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; testing::internal::ReturnAction<R>::Impl<R_, F>::ArgumentTuple = std::tuple<>]’:
/usr/include/gmock/gmock-actions.h:684:12:   required from here
/usr/include/gmock/gmock-actions.h:684:60: error: use of deleted function ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’
ninja: build stopped: subcommand failed.
Error: Process completed with exit code 1.

@chusitoo Any idea ?

Tentative work around for unit test break with nostd::unique_ptr
@marcalff
Copy link
Member Author

marcalff commented Apr 5, 2024

Unit test build broken, due to:

GTest 1.12.0 is required, the runner uses Gtest 1.11.0-3 which is broken

Setting up googletest (1.11.0-3) ...

@marcalff marcalff marked this pull request as ready for review April 5, 2024 09:54
@marcalff marcalff requested a review from a team April 5, 2024 09:54
@marcalff
Copy link
Member Author

marcalff commented Apr 5, 2024

@chusitoo @owent @lalitb @ThomsonTan @esigo Please review

@marcalff marcalff changed the title Add CI for instrumentation/boost_log [CI] Add CI for instrumentation/boost_log Apr 5, 2024
@chusitoo
Copy link
Contributor

chusitoo commented Apr 5, 2024

Now getting a build break in the boost_log unit test.

-- Build files have been written to: /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/boost_log/build
[1/4] Building CXX object CMakeFiles/opentelemetry_boost_log_sink.dir/src/sink.cc.o
[2/4] Linking CXX static library libopentelemetry_boost_log_sink.a
[3/4] Building CXX object CMakeFiles/sink_test.dir/test/sink_test.cc.o
FAILED: CMakeFiles/sink_test.dir/test/sink_test.cc.o 
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CHRONO_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_LOG_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_THREAD_DYN_LINK -DOPENTELEMETRY_ABI_VERSION_NO=1 -I/home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/include -isystem /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include -Wall -Wextra -Werror -Wpedantic -fPIC -MD -MT CMakeFiles/sink_test.dir/test/sink_test.cc.o -MF CMakeFiles/sink_test.dir/test/sink_test.cc.o.d -o CMakeFiles/sink_test.dir/test/sink_test.cc.o -c /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc
In file included from /usr/include/gmock/gmock.h:59,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:24:
/usr/include/gmock/gmock-actions.h: In instantiation of ‘testing::internal::ReturnAction<R>::Impl<R_, F>::Impl(const std::shared_ptr<_Tp>&) [with R_ = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; F = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>(); R = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>]’:
/usr/include/gmock/gmock-actions.h:662:22:   required from ‘testing::internal::ReturnAction<R>::operator testing::Action<Func>() const [with F = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>(); R = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>]’
/home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:135:56:   required from here
/usr/include/gmock/gmock-actions.h:682:39: error: use of deleted function ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’
  682 |           value_(ImplicitCast_<Result>(value_before_cast_)) {}
      |                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include/opentelemetry/logs/event_id.h:9,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include/opentelemetry/logs/logger_type_traits.h:12,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include/opentelemetry/logs/logger.h:6,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:8:
/home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/sandbox/include/opentelemetry/nostd/unique_ptr.h:45:7: note: ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’ is implicitly declared as deleted because ‘opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>’ declares a move constructor or move assignment operator
   45 | class unique_ptr
      |       ^~~~~~~~~~
In file included from /usr/include/gmock/internal/gmock-port.h:56,
                 from /usr/include/gmock/internal/gmock-internal-utils.h:46,
                 from /usr/include/gmock/gmock-actions.h:145,
                 from /usr/include/gmock/gmock.h:59,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:24:
/usr/include/gtest/internal/gtest-port.h:1070:28: note:   initializing argument 1 of ‘To testing::internal::ImplicitCast_(To) [with To = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>]’
 1070 | inline To ImplicitCast_(To x) { return x; }
      |                         ~~~^
In file included from /usr/include/gmock/gmock.h:59,
                 from /home/runner/work/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/opentelemetry-cpp-contrib/instrumentation/boost_log/test/sink_test.cc:24:
/usr/include/gmock/gmock-actions.h:681:11: error: use of deleted function ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’
  681 |         : value_before_cast_(*value),
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/gmock/gmock-actions.h: In instantiation of ‘testing::internal::ReturnAction<R>::Impl<R_, F>::Result testing::internal::ReturnAction<R>::Impl<R_, F>::Perform(const ArgumentTuple&) [with R_ = std::nullptr_t; F = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>(); R = std::nullptr_t; testing::internal::ReturnAction<R>::Impl<R_, F>::Result = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; testing::internal::ReturnAction<R>::Impl<R_, F>::ArgumentTuple = std::tuple<>]’:
/usr/include/gmock/gmock-actions.h:684:12:   required from here
/usr/include/gmock/gmock-actions.h:684:60: error: use of deleted function ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’
  684 |     Result Perform(const ArgumentTuple&) override { return value_; }
      |                                                            ^~~~~~
/usr/include/gmock/gmock-actions.h: In instantiation of ‘testing::internal::ReturnAction<R>::Impl<R_, F>::Result testing::internal::ReturnAction<R>::Impl<R_, F>::Perform(const ArgumentTuple&) [with R_ = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; F = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>(); R = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; testing::internal::ReturnAction<R>::Impl<R_, F>::Result = opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>; testing::internal::ReturnAction<R>::Impl<R_, F>::ArgumentTuple = std::tuple<>]’:
/usr/include/gmock/gmock-actions.h:684:12:   required from here
/usr/include/gmock/gmock-actions.h:684:60: error: use of deleted function ‘constexpr opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>::unique_ptr(const opentelemetry::v1::nostd::unique_ptr<opentelemetry::v1::logs::LogRecord>&)’
ninja: build stopped: subcommand failed.
Error: Process completed with exit code 1.

@chusitoo Any idea ?

Guess I'm too late to reply but I'll add my two cents, anyways.

I had been able to repro this following the exact setup steps from this PR's yaml but didn't have time to dig deeper.
It does make sense, though, as I've always set up the environment using opentelemetry-cpp/ci/setup_cmake.sh which installs a more recent version of gtest compared to system package.

@marcalff
Copy link
Member Author

marcalff commented Apr 5, 2024

Guess I'm too late to reply but I'll add my two cents, anyways.

I had been able to repro this following the exact setup steps from this PR's yaml but didn't have time to dig deeper. It does make sense, though, as I've always set up the environment using opentelemetry-cpp/ci/setup_cmake.sh which installs a more recent version of gtest compared to system package.

Thanks for investigating.

I think this is due to #424 (comment)

I changed the makefiles to require gtest 1.12, and it now works.

@chusitoo
Copy link
Contributor

chusitoo commented Apr 5, 2024

LGTM!

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@marcalff marcalff merged commit b216e0d into open-telemetry:main Apr 5, 2024
2 checks passed
@marcalff marcalff added the instrumentation:boost-log Boost-log log appender label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
instrumentation:boost-log Boost-log log appender
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] Add CI for instrumentation/boost_log
3 participants