Commit Graph

188 Commits

Author SHA1 Message Date
Joshua Haberman
820d1ca5af Merge tag 'refs/tags/sync-piper' into sync-stage 2020-10-21 10:04:14 -07:00
Joshua Haberman
de371235c9 Sync from Piper @338284531
PROTOBUF_SYNC_PIPER
2020-10-21 10:04:14 -07:00
Joshua Haberman
a633ad452d Ran update_file_lists.sh to pick up arenastring.cc. 2020-09-28 12:19:39 -07:00
Joshua Haberman
38d6de1eef Sync from Piper @334206209
PROTOBUF_SYNC_PIPER
2020-09-28 11:54:54 -07:00
David L. Jones
02955622cc
[bazel/py] Omit google/__init__.py from the Protobuf runtime. (#7908)
Since `google` is a Python namespace package, the google/__init__.py
file should be omitted to avoid collisions. For example, its presence
may cause other Pip packages in the google namespace not to be found.

This change narrows which __init__.py files are included in the
`//:protobuf_runtime` target to include only those under
`google/protobuf`. It also moves their canonical inclusion to the
internal `//:python_srcs` rule, eliminating the dual specification in
`python_protobuf.extra_srcs`.

This is the difference in files, lexicographically ordered:

```
$ bazel cquery 'labels(srcs, kind(py_library, deps(:protobuf_python)))' | sort > /tmp/deps-{before,after}.txt
$ diff /tmp/deps-{before,after}.txt
1,5d0
< //:python/compatibility_tests/v2.5.0/tests/__init__.py (null)
< //:python/compatibility_tests/v2.5.0/tests/google/__init__.py (null)
< //:python/compatibility_tests/v2.5.0/tests/google/protobuf/__init__.py (null)
< //:python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/__init__.py (null)
< //:python/google/__init__.py (null)
51d45
< //:python/protobuf_distutils/protobuf_distutils/__init__.py (null)
```

This seems like a desirable change, since it avoids polluting other
packages, too.

This change is conceptually similar to #7877, but for Bazel.
2020-09-23 15:20:38 -07:00
Joshua Haberman
b3cdd40ef0 Added new map.cc file to Bazel BUILD file. 2020-08-17 17:12:44 -07:00
Yannic Bonenberger
8b93b8eae5 [bazel] Move Objective-C runtime into //objectivec
Removing language-specific targets from the top-level BUILD file
will allow users to keep their workspaces smaller and easier to
maintain by not depending on language rules they don't need.

Similar work was done for Java in #7190.
2020-07-20 16:51:30 -07:00
Yannic
cdc7fe8f05 [bazel] Use proto_library targets to exclude WKPs from code-gen
This prepares protobuf for a future release of Bazel which will make
`ProtoInfo` mandatory for `proto_lang_toolchain.blacklisted_protos`.
2020-07-01 13:46:50 -07:00
Joshua Haberman
c077d949d8 Merge branch '3.12.x' into merge-312 2020-05-26 16:45:43 -07:00
Stanley Cheung
ef22086980
Fix :protobuf_objc bazel target (#7538)
* Potential 3.12 ObjC bazel patch

* Add test targets to bazel test

* Remove :protobuf_objc test target
2020-05-21 12:46:35 -07:00
Joshua Haberman
c8fce07914 Removed "no_arena" variants from the build system. 2020-05-13 13:49:35 -07:00
Joshua Haberman
243558921f Some fixes to make the tests pass on Bazel. 2020-03-31 17:31:32 -07:00
Yannic Bonenberger
723a85f797 [bazel] Remove bootstrap hack from cc_proto_library and add interop with proto_library
Bazel had a native `cc_proto_library` for more than 2 years now.
This is the first step towards removing that rule from the Protobuf
repo.
2020-03-04 09:25:41 -08:00
Yannic
2e51ad6344
[bazel] Update gtest and deprecate //external:{gtest,gtest_main} (#7237)
This change updates the gtest-version used by Bazel.
Also, `//external:{gtest,gtest_main}` is deprecated so we can remove some
of the uses of the discouraged `bind` function.

RELNOTES[bazel]: Starting with Protobuf 3.13.0, building and running
Protobuf tests requires `@com_google_googletest//:{gtest,gtest_main}`
instead of `//external:{gtest,gtest_main}`. Use
`--@com_google_protobuf//:incompatible_use_com_google_googletest=true`
to verify your workspace is not affected by this change.
2020-03-02 15:15:22 -08:00
Yannic
f0cb9cdb95
[bazel] Move Java runtime/toolchains into //java (#7190)
* [bazel] Move Java runtime/toolchains into //java

This change moves `java_library` targets from the top-level BUILD file
into `//java/{core,lite,util}` and declares `alias` targets to point to
their new locations (hence, this is not a breaking change).

This will allow users that don't use Java to stop depending on
`@rules_java` (e.g. as requested in
https://github.com/bazelbuild/rules_scala/pull/989#issuecomment-583405161).

Note that there is no intention to deprecate + remove the top-level
targets in the foreseeable future.

* Add BUILD files in //java to java_EXTRA_DIST
2020-02-13 13:04:14 -08:00
Yannic
948740bc9d [bazel] Fix blacklisted_protos in cc_toolchain and add test (#7075) 2020-01-15 10:27:35 -08:00
Yannic
082cc23afd Blacklist .proto source files if Bazel allows us to (#7065)
* Blacklist .proto source files is Bazel allows us to

This is a partial revert of 7b28278c7d to unblock, e.g., https://github.com/grpc/grpc/pull/21590 or https://github.com/lyft/envoy-mobile/issues/617 until Bazel is fixed.

Note: this is a forward-compatible change that automatically switches to the behavior intended by 7b28278c7d when a compatible Bazel is released without requiring users to upgrade Protobuf. We will revert this change when Bazel is fixed.

* Remove trailing ,

* Update BUILD
2020-01-09 10:23:02 -08:00
Rafi Kamal
e6c5a3b57d
Add a proto_lang_toolchain for javalite (#6882)
* Add a proto_lang_toolchain for javalite

* fix toolchain. Swap javalite example to master repo
2019-11-27 11:10:45 -08:00
Rafi Kamal
58d4420e2d Down Integrate Internal Changes 2019-11-12 13:38:58 -08:00
Adam Cozzette
f4ceaecf68 Updated deprecation macros to annotate deprecated code 2019-09-30 14:29:24 -07:00
Yannic Bonenberger
d2d6ff51a8 [bazel] Load python rules from @rules_python 2019-08-06 16:50:32 -07:00
Yannic Bonenberger
bf0c69e130 [bazel] Add fixes for --incompatible_load_{cc,java,proto}_rules_from_bzl (Part 2)
This change adds the required loads to examples and zlib.
For full compatibility with --incompatible_load_{cc,java,proto}_rules_from_bzl,
we will need to roll gtest to a newer version.
2019-07-29 14:14:04 -07:00
Laszlo Csomor
ea61636cbc Merge branch 'master' into expand-wildcards 2019-07-29 15:16:10 +02:00
Yannic Bonenberger
4979489451 Add test to verify BUILD- and cmake-files are in sync with src/Makefile.am 2019-07-24 10:23:55 -07:00
Yannic Bonenberger
6e8991981a [bazel] Add fixes for --incompatible_load_{cc,java,proto}_rules_from_bzl 2019-07-24 10:10:22 -07:00
Laszlo Csomor
5e026abd05 Merge branch 'master' into expand-wildcards 2019-07-19 10:09:18 +02:00
Yannic Bonenberger
a03d332aca [bazel] Use strip_import_prefix for wkp instead of copying them 2019-07-18 13:59:40 -07:00
Laszlo Csomor
416872ef2c Merge branch 'master' into expand-wildcards 2019-07-18 12:11:06 +02:00
Adam Liddell
a74c43bbd9 Fix usage of six in //:protobuf_python rule and add import (#6310)
* Fix reference to six in //:protobuf_python rule

* Add six to protobuf_deps.bzl

* Use six archive directly as repo @six
2019-07-15 16:35:19 -07:00
Laszlo Csomor
a118acc476 Merge branch 'master' into HEAD 2019-07-15 13:13:22 +02:00
Liam Miller-Cushon
7b28278c7d Use proto_library in proto_lang_toolchain.blacklisted_protos
Support for using proto_library in this attribute was added in:
a5ee2c4d97

Legacy support for using .proto files will be removed in a future
version of Bazel.
2019-07-01 14:15:32 -07:00
Liam Miller-Cushon
2b857d0078 Format with buildifier 2019-07-01 14:10:31 -07:00
Hao Nguyen
e1d8b31ba4 Remove map_test.util.cc from BUILD 2019-06-26 15:02:11 -07:00
Bo Yang
bc742640ef Merge remote-tracking branch 'origin/3.8.x' 2019-06-21 04:01:45 +00:00
Hao Nguyen
e992abd1f8
Merge pull request #6177 from cgrushko/master
Add `protobuf_java_lite` Bazel target
2019-06-20 11:15:08 -07:00
Yun Peng
6e58040a71 Add "src/**/*.inc" to //:protobuf_headers
Otherwise, sandbox and remote execution will complain `google/protobuf/port_def.inc` doesn't exist.
2019-06-19 09:25:52 -07:00
John W. Bruce
21e4b1c336 Fix Alphabetization of BUILD 2019-06-10 20:52:51 -07:00
Carmi Grushko
5c25f41423 Add protobuf_java_lite Bazel target
that builds the JavaLite runtime.

Contents based on java/lite/pom.xml.
2019-06-01 12:08:53 +03:00
Joshua Haberman
c659a4a4db Fixed typo: conformance_test_runner should be a binary, not library. 2019-05-14 14:01:16 -07:00
Joshua Haberman
2996da4d81 Merge branch 'master' into conformance-build 2019-05-13 07:45:30 -07:00
Hao Nguyen
4cebf97a52 Update BUILD file to match the changes in cmake files for lite 2019-05-03 15:08:01 -07:00
Keith Smiley
1c5e8cbb8f Remove -Wall from default build options
All bazel crosstools automatically pass -Wall to compiles. The order of
operations is:

- bazel crosstool flags
- `--host_copt` flags and other variations like `--host_cxxopt`
- the `copts` defined on the rule

Because of this when protobuf produces warnings, there's no way to
disable them from the consumer side if they are re-enabled later by
another `-Wall` flag.
2019-04-16 09:49:59 -07:00
Nic McDonald
f313b9ccf7 comply with Bazel recommendations 2019-04-15 13:43:05 -07:00
Hao Nguyen
ef1e8e7172 Add module for JavaLite and fix builds 2019-04-09 06:48:01 -07:00
yejianwu
df4ec8a273 support specify C++ STL for android 2019-04-08 14:01:34 -07:00
Hao Nguyen
c163a2d1a4 Revert accidentally commit 2019-04-05 17:09:42 -07:00
Hao Nguyen
1eb049141e Add module for JavaLite and fix builds 2019-04-05 16:55:34 -07:00
Phillipp Schoppmann
8e5b2f1b82 Update file list for protobuf_lite 2019-04-01 14:06:18 -07:00
David Ostrovsky
35c9a5fef3 Bazel: Add dependency to error_prone_annotations
Recently dependency to error_prone_annotations was added to the code,
but only Maven build tool chain was updated.

Closes #5795.
2019-03-08 09:38:28 -08:00
Yilun Chong
9fd18ae9a5 fix BUILD for adding any_lite.cc 2019-02-26 13:55:31 -08:00