Skip to content

Makes it friendly to import grpc from other bazel projects.#13468

Closed
renning22 wants to merge 5 commits intogrpc:masterfrom
renning22:master
Closed

Makes it friendly to import grpc from other bazel projects.#13468
renning22 wants to merge 5 commits intogrpc:masterfrom
renning22:master

Conversation

@renning22
Copy link
Copy Markdown
Contributor

@renning22 renning22 commented Nov 20, 2017

Example of how to import grpc in other project's WORKSPACE file:

git_repository(
  name = "com_github_grpc_grpc",
  remote = "https://github.com/renning22/grpc.git",
  commit = "14a4c935dd0407cad121d91dd959ce3aae16b002",
)

# Setup grpc's dependencies.
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()

Then
bazel build @com_github_grpc_grpc//:grpc would work.

@thelinuxfoundation
Copy link
Copy Markdown

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
The Linux Foundation CLA GitHub bot

@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@nicolasnoble
Copy link
Copy Markdown
Contributor

I am going to merge #13060 first - you'll most likely want to revisit your PR after that.

@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@renning22
Copy link
Copy Markdown
Contributor Author

Ack, thanks @nicolasnoble .

@renning22 renning22 force-pushed the master branch 2 times, most recently from 5d25206 to 3d87a62 Compare November 21, 2017 00:47
@grpc-testing
Copy link
Copy Markdown

[microbenchmarks] No significant performance differences

@nicolasnoble
Copy link
Copy Markdown
Contributor

Also, I'm sorry, but I won't be able to accept your PR if you don't accept the linux foundation CLA. Please visit https://identity.linuxfoundation.org/projects/cncf for this.

@renning22 renning22 force-pushed the master branch 3 times, most recently from 53b9fd6 to c5f8213 Compare November 22, 2017 01:21
@renning22
Copy link
Copy Markdown
Contributor Author

Thanks @nicolasnoble ,
I have signed linux foundation CLA and the PR is ready to review.

@nicolasnoble
Copy link
Copy Markdown
Contributor

@grpc-testing
Copy link
Copy Markdown

****************************************************************

libgrpc.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]


****************************************************************

libgrpc++.so

     VM SIZE        FILE SIZE
 ++++++++++++++  ++++++++++++++

  [ = ]       0        0  [ = ]



@grpc-testing
Copy link
Copy Markdown

[trickle] No significant performance differences

@grpc-testing
Copy link
Copy Markdown

[microbenchmarks] No significant performance differences

@ghost
Copy link
Copy Markdown

ghost commented Nov 28, 2017

You might consider adopting the pattern used by https://github.com/bazelbuild/rules_go to allow users to optionally overwrite one or more of the dependencies supplied by your Skylark rules. For example,

if "com_github_bazelbuild_buildtools" not in native.existing_rules():
    native.http_archive(
        name = "com_github_bazelbuild_buildtools",
        url = "https://codeload.github.com/bazelbuild/buildtools/zip/799e530642bac55de7e76728fa0c3161484899f6",
        strip_prefix = "buildtools-799e530642bac55de7e76728fa0c3161484899f6",
        type = "zip",
    )

The conditional works such that it will only install the version of Buildtools, supplied below if the user is not explicitly binding a rule of the same name somewhere else. See https://github.com/bazelbuild/rules_go/blob/master/go/private/repositories.bzl for more examples. A little more discussion can be found at https://groups.google.com/forum/#!topic/bazel-discuss/EBeFucaAg3A.

Ning Ren added 4 commits November 29, 2017 15:15
…sued by other projects, and simplifies cares build.
…s dependency check.

Otherwise include "third_party/nanopb/pb.h" will find local ph.h rather than the one in "//external:nanopb".
@renning22 renning22 changed the title Bazel managers 3rd-party dependencies itself. Makes it friendly to import grpc from other bazel projects. Nov 30, 2017
@renning22
Copy link
Copy Markdown
Contributor Author

I've fixed "check_bazel_workspace.py" test. It still not passing on my machine because "git submodule" for protobuf is still 80a37e0782d2d702d52234b62dd4b9ec74fd2c95, while the expectation has been updated in 28661ea. I guess it should also fail "check_submodules.sh".

@jwpowell055 also adopted your suggestion, thanks!

apolcyn added a commit that referenced this pull request Dec 15, 2017
Carry on from #13468, simplify bazel consumption of grpc
apolcyn added a commit that referenced this pull request Dec 22, 2017
@renning22 renning22 closed this Jan 8, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants