Commit Graph

140 Commits

Author SHA1 Message Date
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
Yilun Chong
a2a0afb546
Down-integrate internal changes to github. (#5575)
* Down-integrate internal changes to github.

* Fix BUILD file and regenerate csharp descritpor
2019-01-13 17:40:58 -08:00
Keith Moyer
595cb359c0 Rely on no-writable-strings synonym
The -Wno-writable-strings warning flag is Clang-specific. GCC's
equivalent is -Wno-write-strings, which Clang also supports as a
synonym. So, -Wno-write strings is more compatible and there is no need
to specify both.

https://clang.llvm.org/docs/DiagnosticsReference.html#wwrite-strings
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
2018-12-27 13:52:23 -08:00
Yun Peng
073487b302 Exclude command_line_interface_unittest.cc in MSVC build 2018-12-14 12:53:36 +01:00
Cody Schroeder
802d543173 Add Bazel config for zlib support (#5389)
* Add Bazel config for optional zlib support

* Add hard dependency on zlib

* Remove unused config_setting
2018-12-11 11:58:26 -08:00
Adam Cozzette
4dd45935d7 Removed scc.cc 2018-11-09 11:40:27 -08:00
Thomas Van Lenten
18aa296144 Collapse :protobuf_objc and :objectivec targets.
Not sure the history for why there were two objc_library targets, but
given the one has an issue about not working, merge them into a single
target and an alias.

- Use the alias for :objectivec since that naming doesn't seem to follow
  the other targets *_library targets here.
- Update :protobuf_objc to be use for the working target and just inline
  the sources/headers lists so there is less indirection in the file.

Fixes #5284
2018-11-01 12:52:18 -04:00
scentini
b30ddee2aa
use flag_values = {"@bazel_tools//tools/cpp:compiler": "x"} for compiler config_settings 2018-08-28 14:07:55 +02:00
Feng Xiao
bde4eaf137 Update build files.
* Fixes https://github.com/google/protobuf/issues/5031
* Fixes https://github.com/google/protobuf/issues/5037
2018-08-13 14:41:27 -07:00
Feng Xiao
b1c5503022
Delete unused files. (#4942)
* Delete unused files.
2018-07-19 17:30:15 -07:00
Benjamin Barenblat
048f5c26a7 objectivec: Quash -Wself-assign and -Wvla (#4897)
* objectivec: Quash -Wself-assign

* objectivec: Set -Wno-vla when building

Objective-C protobuf uses VLAs for performance reasons. Ensure Clang
doesn’t complain about them.
2018-07-11 13:20:01 -04:00
Adam Cozzette
2c30fa71e7
Merge pull request #3981 from fahhem/patch-3
Handle srcs in generated files by cd'ing in and out
2018-07-02 15:08:12 -07:00
mdepristo
42141fa2f7 Remove unclear comment. 2018-06-30 14:56:19 -07:00
depristo
2506cf5cf4 Remove write-strings warning from COPTs.
This change reduces the excessive warnings when compiling C++ protobufs like "external/protobuf_archive/python/google/protobuf/pyext/message.cc:2629:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]"
2018-06-28 22:54:43 +00:00
Cory McLean
b7d3ec3aa9 Make proto_api target visible 2018-06-11 12:18:45 -04:00
Feng Xiao
a0e82dbe56
Merge pull request #4725 from ThomasColthurst/patch-2
Remove cycle in dependency graph
2018-06-09 23:25:56 -07:00
Loo Rong Jie
0456e269ee Align Bazel on Windows with CMake's MSVC flags (#4720)
* Align Bazel on Windows with CMake's MSVC flags
2018-06-05 19:03:24 -07:00
Thomas Colthurst
ee8d3aa308
Remove cycle in dependency graph 2018-06-04 16:38:58 -04:00
Feng Xiao
a7252bf42d
Merge pull request #4698 from ThomasColthurst/proto_c_api
Introduce Proto C API; based on cl/198113115 by amauryfa
2018-06-03 14:54:53 -07:00
Feng Xiao
143851ed25
Remove js_embed binary. (#4709)
* Remove js_embed binary.
2018-06-01 11:00:04 -07:00
Thomas Colthurst
7c6514245b Introduce Proto C API; based on cl/198113115 by amauryfa 2018-05-30 10:33:02 -04:00
Feng Xiao
8175c6e444
Merge pull request #4659 from calder/bazel-python-namespace-fix
Declare 'google' namespace when importing Python protobuf via Bazel
2018-05-24 16:35:16 -07:00
Jan Tattermusch
ccc56a3c1e fix syntax error in BUILD file 2018-05-24 09:51:53 -07:00
Calder Coalson
142cbe0d57 Declare 'google' namespace when importing Python protobuf via Bazel.
`python/google/__init__.py` declares the top-level 'google' namespace so that
`google.protobuf` can be imported alongside other Google Python modules like
`google.auth`.

This works well when installing protobuf via Pip, but the Bazel `//:python_srcs`
rule doesn't include this file in its `srcs`. Bazel implicitly creates an empty
`google/__init__.py`, which does *not* set up a namespace. The result is that
consuming Python protobuf via Bazel breaks all other Google Python libraries.

This fixes #4658.
2018-05-22 20:19:28 -07:00
Laszlo Csomor
5517168fa9 Windows: expand wildcard arguments
Fixes https://github.com/google/protobuf/issues/3957
2018-05-22 08:57:57 +02:00
Fahrzin Hemmati
55962db9b7 Fix generated_protos_proto deps 2018-05-07 17:36:34 -07:00
Fahrzin Hemmati
0d68b29ac4 Add unittest build rules 2018-05-07 15:40:31 -07:00
Feng Xiao
d34e3190df
Merge pull request #4431 from xfxyjwf/rmnano
Remove javanano.
2018-03-26 13:43:54 -07:00
Feng Xiao
d5a0024171 Remove javanano. 2018-03-26 12:59:28 -07:00
Adam Cozzette
2c963d3c24
Merge pull request #4413 from pmuetschard/msvc
Don't assume Windows builds use MSVC.
2018-03-23 15:24:03 -07:00
Adam Cozzette
5bed368014 Added missing .inc files to BUILD
This fixes the Bazel build.
2018-03-23 10:19:04 -07:00
Pascal Muetschard
a6957f2890 Don't assume Windows builds use MSVC.
Switch to using the MSVC options, not based on the cpu, but based
on the compiler name. This allows building on Windows with MSYS
or MinGW's gcc.
2018-03-22 13:14:10 -07:00
Adam Cozzette
0c5fcdee44 Removed some unused C++ source files 2018-03-22 10:15:31 -07:00
Feng Xiao
8e44a86fac
Merge pull request #4347 from xfxyjwf/pluginpb
Revert "Move `compiler/plugin.pb.cc` to libprotobuf with the other WKT sources."
2018-03-09 10:50:23 -08:00
James O'Kane
950f5e4205 Replace //:protoc and similar default macro arguments with
@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.
2018-03-08 22:30:44 -08:00
Feng Xiao
fd595fcc93 Revert "Move compiler/plugin.pb.cc to libprotobuf with the other WKT sources."
This reverts commit 724f0be33d.
2018-03-01 16:36:05 -08:00
John Millikin
350b135e23 Blacklist all WELL_KNOWN_PROTOS from Bazel C++ code generation.
This prevents the Bazel `CcProtoAspect` from generating and linking
C++ object code for these files. Without this blacklist, symbols for
protobuf types depended on by `libprotobuf` may be defined multiple
times and violate the ODR rule.

Fixes https://github.com/google/protobuf/issues/4311
2018-02-24 11:36:49 -08:00
John Millikin
724f0be33d Move compiler/plugin.pb.cc to libprotobuf with the other WKT sources.
This lets all values of `WELL_KNOWN_PROTOS` be treated the same with
regard to Bazel's protobuf blacklisting.
2018-02-24 11:34:40 -08:00
David Ostrovsky
85b488f7fa Bazel: Support building with Java 9
Fixes: #4256.

Bazel@HEAD supports Java 9.

The current code has one single issue with Java 9 compliance: the usage
of sun.misc package. We add jdk.unsupported module with --add-modules
compiler option for now. Long term, the usage of non public API should
be avoided.

To build with Java 9, build custom bazel version and issue:

  $ bazel --host_javabase=/usr/lib64/jvm/java-9-openjdk build \
    --javacopt='--release 9' \
    --java_toolchain=@bazel_tools//tools/jdk:toolchain_jdk9 \
   :protobuf_java
2018-01-31 23:12:04 +01:00
David Ostrovsky
019ceea4b3 Drop java 6 support
Fixes #4220.
2018-01-25 06:54:38 +01:00
Jisi Liu
27e877fdaa
Merge pull request #2834 from aj-michael/master
Make //:protobuf_python have correct __init__.py.
2017-12-12 16:22:47 -08:00
Adam Cozzette
609d752650 Ran update_file_lists.sh to update Bazel and CMake file lists
This should fix Bazel builds, since those were missing a new file
(implicit_weak_message.cc).
2017-12-07 14:16:50 -08:00
Justine Tunney
ac5371d13e Remove unhelpful build warnings
-Wno-writable-strings removes 230 "ISO C++11 does not allow conversion from
string literal to 'char *'" warnings from TensorFlow test / build output.
These happen because pyext/ sources pass string literals to Python C API data
structures, e.g. PyGetSetDef, which for some reason were designed to not have
the const qualifier.
2017-11-17 18:40:05 -08:00
Jisi Liu
b189389e2f Merge pull request #3757 from spinorx/master
Fix iOS cc_library build for protobuf.
2017-10-20 11:56:13 -07:00
Jisi Liu
1c682e0b0b Fix bazel build 2017-10-18 14:31:23 -07:00
Param Reddy
16792c6240 Fix iOS cc_library build for protobuf.
The SDK and os versions were hard coded.  Archs were mixed up.
Because of this,  Was getting errors with latest SDK:
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/' [-Wmissing-sysroot]
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/' [-Wmissing-sysroot]
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/' [-Wmissing-sysroot]
In file included from external/com_google_protobuf/src/google/protobuf/io/printer.cc:35:
In file included from external/com_google_protobuf/src/google/protobuf/io/printer.h:40:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string:470:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string_view:171:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__string:56:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:638:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:61:15: fatal error: 'string.h' file not found
              ^~~~~~~~~~
              1 error generated.

Currently none of these are needed when using bazel with https://github.com/bazelbuild/rules_apple.
-target arm64-apple-ios is passed properly to clang.  So -arch armv7 etc are not needed.
OS_IOS is not used anywhere.
Sources have:  GOOGLE_PROTOBUF_NO_THREADLOCAL defined in src/google/protobuf/stubs/platform_macros.h for iOS.  So __thread= is not needed.  In fact now that bazel is using C++11 by default,  __thread should ideally be moved to thread_local.
-miphoneos-version-min is passed by rules_apple.
2017-10-15 20:20:52 -07:00