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 opentelemetry-proto file exists check #1824

Merged

Conversation

eguzki
Copy link
Contributor

@eguzki eguzki commented Nov 30, 2022

Fixes #1823

Changes

Fix CMake EXISTS syntax

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

@eguzki eguzki requested a review from a team November 30, 2022 10:12
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 30, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

The original bug is mine, sorry I must have been distracted when doing last minute changes.

@codecov
Copy link

codecov bot commented Nov 30, 2022

Codecov Report

Merging #1824 (cd12159) into main (7e26a7e) will not change coverage.
The diff coverage is n/a.

❗ Current head cd12159 differs from pull request most recent head 9c29437. Consider uploading reports for the commit 9c29437 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1824   +/-   ##
=======================================
  Coverage   85.73%   85.73%           
=======================================
  Files         171      171           
  Lines        5240     5240           
=======================================
  Hits         4492     4492           
  Misses        748      748           

@@ -26,7 +26,7 @@
#

if(OTELCPP_PROTO_PATH)
if(NOT EXISTS(${OTELCPP_PROTO_PATH}/opentelemetry/proto/common/v1/common.proto))
Copy link
Contributor

Choose a reason for hiding this comment

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

@marcalff , do you think we can have a test on this passed in env var?

Copy link
Member

Choose a reason for hiding this comment

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

Tested locally with:

malff@localhost.localdomain:build-opentelemetry-cpp> pwd
/home/malff/CODE/MY_GITHUB/build-opentelemetry-cpp
ccmake \
-DOTELCPP_PROTO_PATH=/home/malff/CODE/MY_GITHUB/opentelemetry-proto \
-DWITH_OTLP=ON \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_GRPC=ON \
 ../opentelemetry-cpp \

CMake result without the fix:

 CMake Error at cmake/opentelemetry-proto.cmake:30 (message):
   OTELCPP_PROTO_PATH does not point to a opentelemetry-proto repository

CMake result with the fix:

 opentelemetry-proto dependency satisfied by: external path

So the fix is working.

OTELCPP_PROTO_PATH also shows in the ccmake UI.

@ThomsonTan
Using environment variables will be odd, may be I don't understand what you suggest.

Copy link
Member

Choose a reason for hiding this comment

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

@ThomsonTan - Hope this is ok to merge. If there are any specific test scenarios, we can address them separately.

@lalitb lalitb merged commit 82d8cb4 into open-telemetry:main Dec 1, 2022
@eguzki eguzki deleted the fix-opentelemetry-proto-file-exists-check branch December 1, 2022 18:31
yxue pushed a commit to yxue/opentelemetry-cpp that referenced this pull request Dec 5, 2022
yxue pushed a commit to yxue/opentelemetry-cpp that referenced this pull request Dec 5, 2022
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.

opentelemetry-proto local own dependency not found
5 participants