Commit Graph

67 Commits

Author SHA1 Message Date
cgrushko
65a4d20deb Update load() statement to latest style
The first argument is currently implicitly a .bzl file.
Change this to be explicit.
2017-02-08 15:23:57 -05:00
cgrushko
e4baf3f58a Add a proto_lang_toolchain for Java
This allows easy use of Bazel's java_proto_library native rule.
2017-01-12 12:51:04 -05:00
Adam Cozzette
d1e7bd9842 Added Bazel genrule for generating well_known_types_embed.cc
In pull request #2517 I made this change for the CMake and autotools
builds but forgot to do it for the Bazel build.
2016-12-20 09:08:19 -08:00
Jisi Liu
f92b455aa6 Add missing files. 2016-12-05 10:16:47 -08:00
cgrushko
45d92aea27 Add a proto_lang_toolchain() for cc_proto_library
Bazel's built-in cc_proto_library rule uses a proto_lang_toolchain to learn how to invoke proto-compiler.
To use Bazel's cc_proto_library, add the following to your project's WORKSPACE file:

local_repository(
  name = "com_google_protobuf_cc",
  path = "/path/to/protobuf-distribution/"
)
2016-12-02 19:40:50 -05:00
Richard Shin
df5841f0b2 Place Python extensions correctly in Bazel build. 2016-10-18 13:17:27 -07:00
Jisi Liu
9d4657a9e2 update files to include php generators 2016-10-10 11:43:48 -07:00
Andy Hochhaus
b2b65842ea Silence compile warnings in bazel 2016-10-09 08:36:01 -07:00
Feng Xiao
431cee60e6 Remove inexist files from build. 2016-10-06 16:36:45 -07:00
Jisi Liu
d947308aa1 update files to include php generators (#2165) 2016-10-06 11:49:47 -07:00
Piotr Sikora
faea19c359 Bazel: export LICENSE file.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-08-04 15:32:14 -07:00
David Z. Chen
02cd45ca35 Bazel build: Keep generated sources and Python runtime in the same directory.
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`
2016-05-25 18:02:09 -07:00
Jisi Liu
f86d39c295 Update file lists. 2016-04-28 14:43:22 -07:00
Feng Xiao
0ad204845f Merge pull request #1416 from cwhipkey/master
Change protobuf CPP proto generator to support the 'lite' option in
2016-04-20 17:15:16 -07:00
Feng Xiao
83a7a5e885 Merge pull request #1402 from davidzchen/py2and3
Add missing PY2AND3 srcs_versions attributes to Python Bazel build targets
2016-04-19 10:01:29 -07:00
Jisi Liu
1f4f3e26bd Update file list to include the missing extension lite file. 2016-04-18 14:12:08 -07:00
Chad Whipkey
baf52bd79e Change protobuf CPP proto generator to support the 'lite' option in
proto3.

Added a couple unit test proto3 files, for arena_lite and lite. Cloned
the proto3_arena_unittest to test some of the basics of generated code
(and to ensure that the generated proto3 test files are used by some
test).
2016-04-15 09:23:50 -07:00
David Z. Chen
5ebeefb94c Add missing PY2AND3 srcs_versions attributes to Python Bazel build targets. 2016-04-08 13:30:13 -07:00
Andrew Harp
3b4e7dcf29 Update BUILD 2016-04-04 16:13:31 -04:00
Andrew Harp
b56b461e49 Do not link in pthread library for Android builds.
This is required to allow Tensorflow to build on Android without hacks. Currently we create a dummy pthread library just to satisfy this dependency for a library that does not exist on Android. See https://github.com/google/protobuf/issues/1373 for more context.
2016-04-04 15:13:30 -04:00
Steven Parkes
d5a573274d export well known protos 2016-03-22 17:56:07 -07:00
Feng Xiao
ca3dc15d4c Merge pull request #1318 from smparkes/smparkes/grpc
add java/util support based on java/util/pom.xml
2016-03-14 14:57:33 -07:00
Jisi Liu
9aea0ef0cd Merge pull request #1312 from petewarden/master
Bazel iOS build settings
2016-03-12 15:15:03 -08:00
Steven Parkes
a9244ca0df add java/util support based on java/util/pom.xml 2016-03-11 18:08:09 -08:00
Steven Parkes
ea1886661e pass correct args to protoc for java wellknown protos when used as an external repository 2016-03-10 15:04:46 -08:00
Pete Warden
bc2d6c2504 Merge remote-tracking branch 'upstream/master' 2016-03-09 13:05:15 -08:00
Pete Warden
f0c1a86372 Added iOS settings to Bazel build 2016-03-09 13:03:52 -08:00
David Z. Chen
985c968443 Remove hack for building Python support with Bazel.
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
2016-02-25 12:52:21 -08:00
Pete Warden
cb39204af8 Updated library generation with iOS options 2016-02-23 10:18:32 -08:00
Manjunath Kudlur
99a3e30bd7 Added PROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS macro and setting it when
--allow_oversize_protos=true is passed to bazel build.
When this macro is set, SetTotalBytesLimit is called to remove
the 64MB limit on binary protos when during ParseFromString.
2016-02-16 15:17:10 -08:00
Ming Zhao
4fe03816b1 Fix bazel BUILD for Java. 2016-01-21 23:08:33 -08:00
Feng Xiao
ef6c72b46b Update BUILD/cmake files.
Change-Id: I6fa9f1b65d6c06b891aabf3f3d868364d74d727d
2015-12-28 17:33:55 -08:00
Manjunath Kudlur
d03ef20039 Made targets relative to google/protobuf
Fixes #1029
2015-12-08 10:46:26 -08:00
Manjunath Kudlur
a194921527 Made building the python extension configurable via --define=use_fast_cpp_protos=true 2015-12-08 08:24:37 -08:00
Manjunath Kudlur
3ff1dca0bd Enable fast cpp protos in the python interface. 2015-12-07 13:08:21 -08:00
Geoffrey Irving
29799238c2 Add srcs_version = "PY2AND3" in BUILD files
The sources themselves appear to already be Python 3 clean.
2015-12-03 13:16:06 -08:00
Jan Tattermusch
562372e53a Merge pull request #989 from jskeet/rename-umbrella
Rename "umbrella" to "reflection" consistently.
2015-11-19 16:31:19 -08:00
Jisi Liu
fa8e2911bb Merge pull request #977 from lberki/master
add headers
2015-11-19 14:39:54 -08:00
Jon Skeet
a6361a124a Rename "umbrella" to "reflection" consistently.
This changes csharp_names.h, which will require a corresponding change in GRPC.
2015-11-19 13:05:17 +00:00
Jisi Liu
6a40bf89d3 Make the cc wkt proto target public. 2015-11-17 12:37:56 -08:00
Lukacs T. Berki
915d9cd245 add headers 2015-11-16 09:36:32 +01:00
Jisi Liu
be92ffbf74 add default_runtime attribute to cc|py rules.
This adds implicit dependencies to the coressponding runtime libraries.
2015-10-27 15:11:38 -07:00
Jisi Liu
e1f60f5043 Update comments. 2015-10-22 13:55:37 -07:00
Jisi Liu
fbc51b7018 Add six as an external dep. 2015-10-22 13:38:17 -07:00
Jisi Liu
68e13f40f4 Enable python tests with testdata. 2015-10-22 11:13:14 -07:00
Jisi Liu
598480df11 Add runfiles to make the protobuf_test pass. 2015-10-21 11:19:16 -07:00
Jisi Liu
166e9bbb84 Rename python and java bazel rules. 2015-10-21 10:56:38 -07:00
Jisi Liu
8f54026ded avoid name duplication. 2015-10-20 16:21:41 -07:00
Jisi Liu
bc4fd15209 Rename copeid_src to internal_copied_filegroup 2015-10-20 16:02:58 -07:00
Jisi Liu
14c8f8ac1d Uncomment objc tests 2015-10-20 15:36:22 -07:00