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

CURL support for Bazel #402

Merged
merged 11 commits into from
Nov 30, 2020
Merged

Conversation

jsuereth
Copy link
Contributor

@jsuereth jsuereth commented Nov 24, 2020

This wires CURL into the BAZEL build, and enables the CURL http tests to also be run in the BAZEL build.

Fixes #390

Note: This does NOT provide CURL build in a consumable way for release, that will be done as part of a larger PR for enabling OT CPP releases to be consumed by downstream bazel users.

- Pull a specific version of CURL as a dep.
- Add this version of CURL as a dep to the test of the CURL client.
- CURL should not be a dependency in any other way, but may be built if
you glob-build.
@jsuereth jsuereth requested a review from a team November 24, 2020 16:38
@codecov
Copy link

codecov bot commented Nov 24, 2020

Codecov Report

Merging #402 (bebc4f5) into master (347ca02) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #402   +/-   ##
=======================================
  Coverage   94.74%   94.74%           
=======================================
  Files         175      175           
  Lines        7590     7591    +1     
=======================================
+ Hits         7191     7192    +1     
  Misses        399      399           
Impacted Files Coverage Δ
ext/test/http/curl_http_test.cc 93.54% <100.00%> (+0.04%) ⬆️

lalitb and others added 5 commits November 25, 2020 01:43
Remove BUILD file causing issues in cmake
- Need to define CURL_STATICLIB for imports
- Add missing windows static libraries to link (advapi32, crypt32 and Normaliz)
@jsuereth
Copy link
Contributor Author

@lalitb I got the build to work in bazel. It looks like there's some kind of runtime error in the CURL test for "POST" for windows/osx. I'm getting a non-zero exit code running the tests after I build locally. I'm going to take a deeper look when I can, but if you have any insight, it'd be appreciated.

@lalitb
Copy link
Member

lalitb commented Nov 25, 2020

@lalitb I got the build to work in bazel. It looks like there's some kind of runtime error in the CURL test for "POST" for windows/osx. I'm getting a non-zero exit code running the tests after I build locally. I'm going to take a deeper look when I can, but if you have any insight, it'd be appreciated.

@jsuereth - I would instead suggest to remove the curl build/test for Windows, as we would like to have WinInet as the default http client for Windows. Either me/Max would work on this client. I will look into the osx failure, as it should work fine there.

@jsuereth
Copy link
Contributor Author

Disabling the unit test on windows is out-of-scope for this PR (I'm still working on that entire mechanism, trying to make sure we don't go down a path of madness).

@lalitb I did get the CURL test working on windows CI, just not locally. I'll disable it in the future. For the Darwin build, it may be a similar issue to windows where the CURL -D definitions (in bazel) are NOT saved in a config.h for later usage, so you need to define a subset of them to compile against it.

@lalitb
Copy link
Member

lalitb commented Nov 25, 2020

Disabling the unit test on windows is out-of-scope for this PR (I'm still working on that entire mechanism, trying to make sure we don't go down a path of madness).

@lalitb I did get the CURL test working on windows CI, just not locally. I'll disable it in the future. For the Darwin build, it may be a similar issue to windows where the CURL -D definitions (in bazel) are NOT saved in a config.h for later usage, so you need to define a subset of them to compile against it.

Have fixed the MacOS test now - it was something to do with how loopback address subnet is configured in MacOS.

@lalitb
Copy link
Member

lalitb commented Nov 25, 2020

Add comment on why this fixes the timeout test?

Sorry for not being clear enough in my earlier comment. The fix is to change the non-existent IP address value from "127.0.0.X" to some random address "222.222.X.X". The reason was that loopback address subnet range is different in Linux and MacOS and so timeout test works in one, and fails in another. The new IP address won't be reachable in both the platforms, and so test will pass. Also reduced the timeout value to 2sec, to ensure that test won't take long time,

Copy link
Contributor

@ThomsonTan ThomsonTan left a comment

Choose a reason for hiding this comment

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

LGTM once the format issue is fixed.

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.

LGTM

@reyang reyang added the pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.) label Nov 30, 2020
@reyang reyang merged commit 9ddcc88 into open-telemetry:master Nov 30, 2020
@jsuereth jsuereth deleted the wip-curl-support branch December 12, 2020 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bazel build for curl based http client implementation
4 participants