aboutsummaryrefslogtreecommitdiff
path: root/protobuf.bzl
Commit message (Collapse)AuthorAgeFilesLines
* Change deprecated Bazel single file attr paramJames Judd2018-08-141-1/+1
| | | | | This removes the need for --incompatible_disable_deprecated_attr_params when using Protobuf
* Merge pull request #3981 from fahhem/patch-3Adam Cozzette2018-07-021-32/+78
|\ | | | | Handle srcs in generated files by cd'ing in and out
| * Fix moving generated files onto themselvesFahrzin Hemmati2018-05-071-3/+5
| |
| * Only use realpath when in gendir, and use the original ctx.action if not in ↵Fahrzin Hemmati2018-05-071-20/+24
| | | | | | | | gendir
| * Track outputs correctlyFahrzin Hemmati2018-05-071-2/+5
| |
| * Handle multiple outs per input (for plugins)Fahrzin Hemmati2018-05-071-22/+25
| |
| * Strip trailing / from pathFahrzin Hemmati2018-05-071-1/+1
| |
| * Handle srcs in generated files by cd'ing in and outFahrzin Hemmati2018-05-071-28/+62
| |
* | Merge pull request #4168 from jin/masterFeng Xiao2018-06-221-4/+3
|\ \ | | | | | | Use versions module from Skylib for version checking
| * | Use versions module from Skylib for version checkingJingwen Chen2018-01-121-4/+3
| | |
* | | remove PACKAGE_NAME and REPOSITORY_NAME deprecated usage (#4650)Ittai Zeidman2018-05-211-2/+2
| |/ |/|
* | Output *_pb2_grpc.py when use_grpc_plugin=TrueMateusz Matejczyk2018-03-111-3/+6
| | | | | | Start outputting missing *_pb2_grpc.py files when use_grpc_plugin is set to True for py_proto_library.
* | Replace //:protoc and similar default macro arguments withJames O'Kane2018-03-081-4/+4
|/ | | | | | | @com_google_protobuf prefixed versions. This allows them to work in 3rd party repositories. Fix a bad visibility rule. :hidden does not exist, but :private does.
* Add a check_protobuf_required_bazel_version() for use in WORKSPACEsFahrzin Hemmati2017-12-041-0/+12
|
* Make .bzl files compatible with future versions of BazelVladimir Moskva2017-08-071-3/+3
|
* Adding default shell envMarco A. Harrendorf2017-04-031-0/+1
| | | | | | | I am adding default shell environment, so that protobuf compilation makes use of set LD_LIBRARY_PATH and so on. In this way, also non-default gcc installations (e.g. not in /usr/lib) can be used to compile protobuf. This would fix the following issue: https://github.com/bazelbuild/bazel/issues/2515
* Bazel can build protobuf when it's not in the rootcgrushko2017-02-081-2/+3
| | | That is, Bazel can now build protobuf when the latter resides in a subdirectory of a project.
* Update genfiles paths to work with a different execroot arrangementKristina Chodorow2017-01-251-6/+24
| | | | | | Bazel is changing the way the execution root is organized (see https://github.com/bazelbuild/bazel/issues/1681 for details) and this updates the protobuf path logic to work with both old and new versions of Bazel.
* Merge pull request #2403 from google/down-integrate-with-msvc-fixAdam Cozzette2016-11-231-5/+0
|\ | | | | Integrated internal changes from Google
| * Merge branch 'master' into down-integrate-with-msvc-fixAdam Cozzette2016-11-171-7/+17
| |\
| * | Integrated internal changes from GoogleAdam Cozzette2016-11-171-5/+0
| | |
* | | Support grpc plugin in py_proto_libraryWiktor Tomczak2016-11-221-0/+12
| |/ |/|
* | Merge pull request #1959 from abergmeier-dsfishlabs/feature/cppFeng Xiao2016-10-131-7/+17
|\ \ | |/ |/| Need to expose generated protobuf C++ headers
| * Need to expose generated protobuf C++ headers so they can actually be ↵Andreas Bergmeier2016-08-151-7/+17
| | | | | | | | accessed from other libraries.
* | Declare all inputs of protoc actionFlorian Weikert2016-10-121-1/+3
| | | | | | | | | | ctx.executable.plugin must be in the inputs of protoc's action when using a plugin, otherwise the action will fail. This bug has been hidden by a bug in Bazel: for every ctx.action, Bazel used to automatically add the runfiles of all executable inputs of the RULE instead of using the inputs of the specific ACTION. Consequently, we could get away with underspecifying the inputs of the action.
* | Resolved a conflictVladimir Moskva2016-09-121-10/+44
|\ \
| * | Generalize plugin support in Bazel Skylark ruleYuki Yugui Sonoda2016-06-011-10/+44
| |/ | | | | | | | | It helps users to support their own plugins in a manner consistent to cc_proto_library and py_proto_libary in their skylark rules
* / Compatibility with the new version of Bazel.Vladimir Moskva2016-09-091-2/+2
|/ | | Global variable HOST_CFG is deprecated and will not be supported soon.
* Bazel build: Keep generated sources and Python runtime in the same directory.David Z. Chen2016-05-251-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users often encounter a Python import error when trying to build Python protos if protobuf is installed locally on the machine. In this case, Python ends up looking in the wrong directory when importing files (see bazelbuild/bazel#1209 and tensorflow/tensorflow#2021). It seems that the problem is caused by Python getting confused when there are Python source files that are meant to be part of the same package but are in separate directories. Prior to #1233, the Bazel build setup would copy the Python runtime sources and all generated sources for the builtin protos into the root directory (assuming that the protobuf tree is vendored in a google/protobuf directory). With #1233, the two sets of sources are kept in their respective directories but both `src/` and `python/` are added to the `PYTHONPATH` using the new `imports` attribute of the Bazel Python rules. However, both the runtime sources and the generated sources are under the same package: `google.protobuf`, causing Python to become confused when trying to import modules that are in the other directory. This patch adds a workaround to the Bazel build to add a modified version of the original `internal_copied_filegroup` macro to copy the `.proto` files under `src/` to `python/` before building the `py_proto_library` targets for the builtin protos. This ensures that the generated sources for the builtin protos will be in the same directory as the corresponding runtime sources. This patch was tested with the following: * All Python tests in protobuf * All Python tests in tensorflow * All tests in [Skydoc](https://github.com/bazelbuild/skydoc) * Importing protobuf as `//google/protobuf` * Importing and binding targets under `//external` * Importing protobuf as `//third_party/protobuf`
* pass correct args to protoc for java wellknown protos when used as an ↵Steven Parkes2016-03-101-0/+25
| | | | external repository
* Remove hack for building Python support with Bazel.David Z. Chen2016-02-251-44/+6
| | | | | | | | | | | | | | | | This change makes use of new imports attribute for Bazel's Python rules, which enable adding directories to the PYTHONPATH. This allows us to remove the hack for building protobuf's Python support with Bazel and now allows projects to include protobuf using a Bazel external repository rather than requiring it to be imported directly into the source tree as //google/protobuf. This change also updates the protobuf BUILD file to use a named repository, @python//, for including Python headers rather than //util/python. This allows projects to specify their own package for Python headers when including protobuf with an external repository. Fixes #1230
* Fixed grpc C++ plugin support.Manjunath Kudlur2016-02-251-6/+11
| | | | | | | | | | grpc C++ plugin generates additional files, namely .grpc.pb.cc and .grpc.pb.h. Adding these files to the outs of the _proto_gen rule, so dependents don't complain about undeclared inclusions. Also, compiling the .grpc.pb.cc requires additional header files from the grpc library, so added //external:grpc_lib to the deps of the cc_library. Clients are expected to declare that in their bazel WORKSPACE, pointing it to @grpc//:grpc++{_unsecure}.
* Added grpc plugin support to cc_proto_library.Manjunath Kudlur2016-02-221-0/+17
| | | | | | | | cc_proto_library now supports use_grpc_plugin flag that passes --plugin=protoc-gen-grpc=grpc_cpp_plugin to protoc compiler invocation. grpc_cpp_plugin is assumed to be present as //external:grpc_cpp_plugin, so clients can setup their WORKSPACE files appropriately to point to grpc location using bind.
* Make protobuf Skylark extension appends the workspace rootDamien Martin-Guillerez2016-01-151-6/+10
| | | | | | | | | | | | | This change make protobuf skylark extension works when using remote repository. Note that this make the Skylark extension unusable prior to Bazel 0.1.4 because the workspace_root is not available on prior version. Tested with Bazel 0.1.4rc2. Fixes https://github.com/bazelbuild/bazel/issues/784.
* Making _genproto rules public.Martin Maly2015-12-041-0/+3
| | | | | This enables other xx_proto_library targets to depend on xx_proto_library targets in different packages, and specifically on xx_wkt_protos.
* Build protoc for host platform to enable cross-compilation.Andrew Harp2015-11-031-0/+1
| | | This is necessary to run protoc on the host as a dependency for Android BUILD targets with Bazel.
* add warning notes for cc|py_proto_library rules.Jisi Liu2015-11-021-0/+8
| | | | | To mention that the interface may change or be removed when bazel has support it natively.
* add default_runtime attribute to cc|py rules.Jisi Liu2015-10-271-0/+11
| | | | This adds implicit dependencies to the coressponding runtime libraries.
* Use && for internal_copied_filegroup.Jisi Liu2015-10-211-3/+3
| | | | So that the rule fails if one or more files cannot be copied.
* Rename copeid_src to internal_copied_filegroupJisi Liu2015-10-201-7/+7
|
* fix sources for python target and add needed dependencies.Jisi Liu2015-10-201-3/+3
|
* Change the impl rule include to includes.Jisi Liu2015-10-201-12/+22
| | | | | We need to use the list to indicate field presense. The field must only contain 0 or 1 string element.
* Change default value of protoc on xx_proto_library rules.Jisi Liu2015-10-201-2/+2
|
* Support python for bazel.Jisi Liu2015-10-191-3/+39
|
* Python bazel support.Jisi Liu2015-10-191-5/+94
|
* Allow include to be None.Jisi Liu2015-10-191-2/+8
| | | | | | | | | | This enables the use case where all the paths are relative to the workspace root, e.g. foo/bar/BUILD /foo.proto -- package foo.bar would generate the message correctly.
* Change prefix to include, and add docsJisi Liu2015-10-161-10/+27
|
* Rename deps/proto_deps to cc_libs/depsJisi Liu2015-10-161-8/+6
|
* style/naming fixJisi Liu2015-10-151-9/+11
|
* make cc_out and py_out internal.Jisi Liu2015-10-141-3/+3
|