You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/21 12:06:19 UTC

[GitHub] [pulsar] rickif opened a new pull request, #17771: [BugFix] build pulsar-client-cpp with BUILD_TESTS=OFF

rickif opened a new pull request, #17771:
URL: https://github.com/apache/pulsar/pull/17771

   <!--
   ### Contribution Checklist
     
     - PR title format should be *[type][component] summary*. For details, see *[Guideline - Pulsar PR Naming Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*. 
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   -->
   
   <!-- Either this PR fixes an issue, -->
   
   Fixes https://github.com/apache/pulsar/issues/1964
   
   <!-- or this PR is one task of an issue -->
   
   ### Motivation
   When the pulsar-client-cpp is built with `cmake . -DTESTS=OFF`, the cmake stil would look for the  `GTEST_INCLUDE_PATH` and `GMOCK_INCLUDE_PATH`, which leads the problem in #1964.
   <!-- Explain here the context, and why you're making that change. What is the problem you're trying to solve. -->
   
   ### Modifications
   * remove gtest/gmock from the `include_directories` of `CMakeLists.txt` when the `BUILD_TESTS=OFF`.
   <!-- Describe the modifications you've done. -->
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI checks.
   
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [x] Anything that affects deployment
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
   
   - [x] `doc-not-needed` 
   (Please explain why)
   
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)
   
   ### Matching PR in forked repository
   
   PR in forked repository: https://github.com/rickif/pulsar
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] rickif commented on pull request #17771: [fix][build] build pulsar-client-cpp with BUILD_TESTS=OFF

Posted by GitBox <gi...@apache.org>.
rickif commented on PR #17771:
URL: https://github.com/apache/pulsar/pull/17771#issuecomment-1257649474

   > There are many other problems with `LINK_STATIC=ON`. I'm handling this issue at the moment.
   > 
   > BTW, the `Matching PR in forked repository` means you should open a PR to merge to your own fork first, then the GitHub Actions will run first in your own account.
   > 
   > Take my PR #17833 for example, it links to [BewareMyPower#4](https://github.com/BewareMyPower/pulsar/pull/4) in my fork, where the CI ran.
   
   Thanks for your guidance. I've created a PR in my fork and updated the `Matching PR in forked repository`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] rickif closed pull request #17771: [fix][build] build pulsar-client-cpp with BUILD_TESTS=OFF

Posted by GitBox <gi...@apache.org>.
rickif closed pull request #17771: [fix][build] build pulsar-client-cpp with BUILD_TESTS=OFF
URL: https://github.com/apache/pulsar/pull/17771


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] BewareMyPower commented on pull request #17771: [fix][build] build pulsar-client-cpp with BUILD_TESTS=OFF

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on PR #17771:
URL: https://github.com/apache/pulsar/pull/17771#issuecomment-1257624376

   There are many other problems with `LINK_STATIC=ON`. I'm handling this issue at the moment.
   
   BTW, the `Matching PR in forked repository` means you should open a PR to merge to your own fork first, then the GitHub Actions will run first in your own account.
   
   Take my PR https://github.com/apache/pulsar/pull/17833 for example, it links to https://github.com/BewareMyPower/pulsar/pull/4 in my fork, where the CI ran.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] rickif commented on pull request #17771: [fix][build] build pulsar-client-cpp with BUILD_TESTS=OFF

Posted by GitBox <gi...@apache.org>.
rickif commented on PR #17771:
URL: https://github.com/apache/pulsar/pull/17771#issuecomment-1258879359

   I test it with CentOS 7.9.2009 and get the right result. Thanks for helping. @BewareMyPower 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] rickif commented on a diff in pull request #17771: [fix][build] build pulsar-client-cpp with BUILD_TESTS=OFF

Posted by GitBox <gi...@apache.org>.
rickif commented on code in PR #17771:
URL: https://github.com/apache/pulsar/pull/17771#discussion_r979672067


##########
pulsar-client-cpp/CMakeLists.txt:
##########
@@ -345,10 +345,15 @@ include_directories(
   ${CURL_INCLUDE_DIRS}
   ${Protobuf_INCLUDE_DIRS}
   ${LOG4CXX_INCLUDE_PATH}
-  ${GTEST_INCLUDE_PATH}
-  ${GMOCK_INCLUDE_PATH}

Review Comment:
   Sorry for the typo. It is `cmake . -DBUILD_TESTS=OFF` indeed. I've corrected it.
   ![image](https://user-images.githubusercontent.com/16649269/192221579-6c2213a6-92cb-4670-a3be-4f9f4596b752.png)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] BewareMyPower commented on a diff in pull request #17771: [fix][build] build pulsar-client-cpp with BUILD_TESTS=OFF

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on code in PR #17771:
URL: https://github.com/apache/pulsar/pull/17771#discussion_r979662754


##########
pulsar-client-cpp/CMakeLists.txt:
##########
@@ -345,10 +345,15 @@ include_directories(
   ${CURL_INCLUDE_DIRS}
   ${Protobuf_INCLUDE_DIRS}
   ${LOG4CXX_INCLUDE_PATH}
-  ${GTEST_INCLUDE_PATH}
-  ${GMOCK_INCLUDE_PATH}

Review Comment:
   Even if these variables are not set, it won't make build failed.
   
   Actually there are already a CI to verify the case when `BUILD_TESTS=OFF` without GTest dependency. See
   
   https://github.com/apache/pulsar/blob/f0aeb5acfb127c42d8f5dda65804617e69e77dd3/.github/workflows/ci-cpp-build.yaml#L231-L234
   
   https://github.com/apache/pulsar/blob/f0aeb5acfb127c42d8f5dda65804617e69e77dd3/pulsar-client-cpp/pkg/deb/docker-build-deb.sh#L33-L34
   
   https://github.com/apache/pulsar/blob/f0aeb5acfb127c42d8f5dda65804617e69e77dd3/pulsar-client-cpp/pkg/deb/build-deb.sh#L44
   
   Your CMake option is wrong, you should use `-DBUILD_TESTS=OFF`, not `-DTESTS=OFF`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org