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

Fix #724 #725

Merged
merged 1 commit into from
May 11, 2021
Merged

Fix #724 #725

merged 1 commit into from
May 11, 2021

Conversation

owent
Copy link
Member

@owent owent commented May 5, 2021

Signed-off-by: owent admin@owent.net

Fixes #724

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@owent owent requested a review from a team May 5, 2021 06:18
@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #725 (2f70ae2) into main (5914160) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #725   +/-   ##
=======================================
  Coverage   94.75%   94.75%           
=======================================
  Files         217      217           
  Lines        9923     9923           
=======================================
  Hits         9403     9403           
  Misses        520      520           
Impacted Files Coverage Δ
...include/opentelemetry/sdk/common/circular_buffer.h 97.87% <0.00%> (-2.13%) ⬇️
sdk/src/logs/batch_log_processor.cc 95.00% <0.00%> (+1.25%) ⬆️

@@ -3,6 +3,9 @@ include_directories(${CMAKE_SOURCE_DIR}/ext/include)

add_library(opentelemetry_exporter_elasticsearch_logs src/es_log_exporter.cc)

target_link_libraries(opentelemetry_exporter_elasticsearch_logs
Copy link
Contributor

@ThomsonTan ThomsonTan May 5, 2021

Choose a reason for hiding this comment

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

Seems this change is only for MinGW, is it needed for other toolchains?

Copy link
Contributor

@maxgolov maxgolov May 5, 2021

Choose a reason for hiding this comment

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

It builds with msvc already, so I assume it's unique to MinGW?

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems this change is only for MinGW, is it needed for other toolchains?

Yes. Some test targets use target_link_libraries to link additional dependencies which are also depended by exporters. I think the depended targets should be added automatically by linking the exporters, and users should not concern these targets unless they use these targets directly.

These PR mainly remove the linking targets from test targets and add these targets into the exporters.

Copy link
Member Author

Choose a reason for hiding this comment

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

It builds with msvc already, so I assume it's unique to MinGW?

I create a script toolset to build opentelemetry-cpp and here is the output when using MinGW64 https://github.com/atframework/cmake-toolset/runs/2492797467 .I'm trying to build all the dependencies myself or use my vcpkg instead of opentelemetry-cpp/tools/vcpkg to build opentelemetry-cpp .

@owent owent force-pushed the fix_compiling_on_mingw64 branch from 75f60a4 to 6344d37 Compare May 5, 2021 06:56
@owent
Copy link
Member Author

owent commented May 5, 2021

Don't know why coverage descrease. This PR has not change sdk/include/opentelemetry/sdk/metrics/controller.h and
sdk/src/logs/batch_log_processor.cc .

@@ -2,6 +2,19 @@
#include "opentelemetry/version.h"

#if defined(HAVE_ABSEIL)

# if defined(__GNUC__) || defined(__GNUG__)
Copy link
Contributor

@maxgolov maxgolov May 5, 2021

Choose a reason for hiding this comment

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

I am sorry for adding void __cdecl ThrowBadVariantAccess(). What you are doing here seems reasonable.

@lalitb
Copy link
Member

lalitb commented May 5, 2021

Don't know why coverage descrease. This PR has not change sdk/include/opentelemetry/sdk/metrics/controller.h and
sdk/src/logs/batch_log_processor.cc .

You can ignore this as it is not related to PR. The coverage issue has occurred multiple times and needs to be looked at separately.

@reyang
Copy link
Member

reyang commented May 6, 2021

Is there a way to add MinGW in the CI?

Copy link
Member Author

@owent owent left a comment

Choose a reason for hiding this comment

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

Is there a way to add MinGW in the CI?

Github hosted runner has mingw toolchain. Maybe we can use C:/msys64/msys2_shell.cmd -mingw64 -defterm -no-start -here -lc "ci/do_ci.sh cmake.test" to build on MinGW(e.g. https://github.com/atframework/cmake-toolset/blob/main/.github/workflows/build.yaml#L98), but I didn't test it.

@@ -3,6 +3,9 @@ include_directories(${CMAKE_SOURCE_DIR}/ext/include)

add_library(opentelemetry_exporter_elasticsearch_logs src/es_log_exporter.cc)

target_link_libraries(opentelemetry_exporter_elasticsearch_logs
Copy link
Member Author

Choose a reason for hiding this comment

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

Seems this change is only for MinGW, is it needed for other toolchains?

Yes. Some test targets use target_link_libraries to link additional dependencies which are also depended by exporters. I think the depended targets should be added automatically by linking the exporters, and users should not concern these targets unless they use these targets directly.

These PR mainly remove the linking targets from test targets and add these targets into the exporters.

@@ -3,6 +3,9 @@ include_directories(${CMAKE_SOURCE_DIR}/ext/include)

add_library(opentelemetry_exporter_elasticsearch_logs src/es_log_exporter.cc)

target_link_libraries(opentelemetry_exporter_elasticsearch_logs
Copy link
Member Author

Choose a reason for hiding this comment

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

It builds with msvc already, so I assume it's unique to MinGW?

I create a script toolset to build opentelemetry-cpp and here is the output when using MinGW64 https://github.com/atframework/cmake-toolset/runs/2492797467 .I'm trying to build all the dependencies myself or use my vcpkg instead of opentelemetry-cpp/tools/vcpkg to build opentelemetry-cpp .

@lalitb
Copy link
Member

lalitb commented May 11, 2021

@owent - Can you update the branch with base, that will allows us to merge the PR

Signed-off-by: owent <admin@owent.net>
@owent owent force-pushed the fix_compiling_on_mingw64 branch from 6344d37 to 2f70ae2 Compare May 11, 2021 06:19
@owent
Copy link
Member Author

owent commented May 11, 2021

@owent - Can you update the branch with base, that will allows us to merge the PR

@lalitb done.

@lalitb lalitb merged commit 5278e8c into open-telemetry:main May 11, 2021
@owent owent deleted the fix_compiling_on_mingw64 branch May 11, 2021 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not build shared libraries on MinGW and GCC has no __cdecl on some platform.
5 participants