Commit Graph

207 Commits

Author SHA1 Message Date
Adam Cozzette
8a3c4948a4
Merge pull request #8858 from acozzette/sync-stage
Integrate from Piper for C++, Java, and Python
2021-08-09 15:55:00 -07:00
UebelAndre
ae26a81918
bazel: make *.bzl files publicly accessible for use with stardoc (#8847) 2021-08-06 08:08:32 -07:00
Tamir Duberstein
57a120fe3b
Disallow missing field initializers
Change-Id: I0f60c220d1441ee5594c9c9437a68de84c6c854a
2021-08-04 11:19:26 -04:00
Tamir Duberstein
9e675037dc
Disallow deprecated-declarations in non-test
Some deprecated functions have tests, so they must be exempted.
2021-08-04 09:31:33 -04:00
Tamir Duberstein
2772f0d553
Disallow unused-function, write-strings
unused-function was suppressed way back in b2b65842ea.
write-strings was suppressed in 2506cf5cf4.

Neither appears to be needed today.
2021-08-04 09:25:44 -04:00
Tamir Duberstein
7e97fd4168
BUILD: buildifier
Automatically format using `buildifier BUILD`.
2021-08-04 09:25:44 -04:00
Adam Cozzette
2fd5c96f4d Add map_test.inc to build configs and new Kotlin files to java_EXTRA_DIST 2021-08-03 14:13:43 -07:00
Adam Cozzette
d46abc1e7e Update BUILD and cmake files and add some missing Java dependencies 2021-08-03 13:44:26 -07:00
Adam Cozzette
d662ec9c2e
Update the automake and Bazel configs to be consistent about field_access_listener.cc (#8823)
In an earlier change I moved field_access_listener.cc from the lite
runtime to the full runtime in the CMake configuration, but this caused
//:build_files_updated_unittest to start failing because it expects all
three build systems to be consistent. To fix that, I updated the
Automake configuration and then ran ./update_file_lists.sh to propagate
that change to the other configs.
2021-07-16 12:26:09 -07:00
Deanna Garcia
89a9f459e9 Changing BUILD files and adding pom templates 2021-06-21 22:28:17 +00:00
Joshua Haberman
45bb1d2feb Added new file to build files. 2021-05-24 15:33:54 -07:00
deannagarcia
76188afb94
Merge pull request #8272 from deannagarcia/kotlinProtos
Opensourcing kotlin protos
2021-04-21 10:29:26 -07:00
Derek Perez
bc45f92262
Bazel powered Java testing (#8506)
* Protobuf Java/Core Tests running w/ Bazel.

Also integrates rules_jvm_external and migrates existing maven deps
in place.

* Add test_suite target that maps to rule name.

* Lite tests passing in Bazel

* util tests passing with Bazel.

* Add conformance and build testing to //java:core

* Cleanup bzl style and lock down access to failure lists.

* Adding Java Lite conformance tests.

* rm newline

* parameterize conformance_test

This makes usage of failure lists more explicit.

* restrict visibility more for newly added libs and fix formatting.

* fix formatting and visibility.

* move testing.bzl to an internal package.

* fix file formatting.

* moving conformance_test to internal.bzl
2021-04-20 11:36:32 -07:00
Joshua Haberman
1dcea0f02d Fixed sort ordering and updated test to output context information. 2021-04-16 08:10:49 -07:00
Joshua Haberman
64a7d647f9 Added new/missing file to Bazel BUILD. 2021-04-15 16:58:16 -07:00
Deanna Garcia
438d777e05 Adding file names to cmake files 2021-03-24 20:00:57 +00:00
Yannic Bonenberger
a3aecacc24 [bazel] Remove deprecated way to depend on googletest 2021-03-10 10:22:42 +01:00
Yannic
82f5ecd955 Revert "[bazel] Flip --incompatible_use_com_google_googletest"
This reverts commit 85e5204517.
2021-03-03 15:30:00 -08:00
Yannic
85e5204517 [bazel] Flip --incompatible_use_com_google_googletest 2021-03-02 11:17:52 -08:00
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