Commit Graph

119 Commits

Author SHA1 Message Date
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
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
Seth Greenstein
68ee916221 Don't pass -lpthread and -lm on Windows
These flags are ignored by cl.exe and have no effect, but add noise to the build logs.
2017-10-10 11:08:27 -07:00
Adam Cozzette
13fd045dbb Integrated internal changes from Google 2017-09-14 10:03:57 -07:00
Feng Xiao
6945203300 Exclude addressbook.proto from C# boostrap test.
This addressbook.proto now belongs to its own bazel pacakge and can't be
accessed in bazel protobuf_test target.
2017-09-11 17:00:11 -07:00
Jakob Buchgraber
699c0eb9cf bazel: Add proto_library rules for well known types. Fixes #2763
Adds a proto_library rule for each well known type proto:

$ bazel query "filter(\".*_proto$\", \"...\")"
//:wrappers_proto
//:timestamp_proto
//:struct_proto
//:field_mask_proto
//:empty_proto
//:duration_proto
//:compiler_plugin_proto
//:descriptor_proto
//:api_proto
//:type_proto
//:source_context_proto
//:any_proto

Bazel users can reference these proto_library rules for their own
language specific rules i.e.

java_proto_library(
  name = "any_java_proto",
  deps = ["@com_google_protobuf//:any_proto"],
)

Also set the workspace name to "com_google_protobuf", as proto_library
rules reference protobuf that way.
2017-09-05 22:33:54 +02:00
Jisi Liu
12c186f7c6 Fix makefile.am 2017-07-25 14:38:00 -07:00
Jisi Liu
e177739fa2 Fix build files 2017-07-25 14:37:19 -07:00
Jisi Liu
759245a49a Merge from master 2017-07-25 11:52:33 -07:00
Jisi Liu
11b6661e66 update build file list 2017-07-19 12:10:43 -07:00
Jakob Buchgraber
36e63da632 bazel: Make compiled jars java 6 binary compatible.
See: https://github.com/bazelbuild/bazel/issues/3198
2017-06-16 12:50:35 +02:00
Yun Peng
0b059a3d8a Refactor cc options in BUILD file for Windows
Don't put gcc warnings options in copts, so that protobuf is able to
build by MSVC toolchain without python wrappers.
2017-05-31 14:01:30 +02:00
Adam Cozzette
2f4489a3e5 Merge pull request #3024 from acozzette/merge-3.3-to-master
Merged 3.3.x branch to master
2017-05-01 10:58:38 -07:00
makdharma
286f059842 added "objectivec" build target (#3033)
This target will be used by gRPC iOS bazel build system.
2017-05-01 09:49:26 -07:00
Feng Xiao
acde1651b5 Update BUILD file for C# tests. 2017-03-29 15:14:18 -07:00
Feng Xiao
32d7830e4b Fix C++ build for down-integration. 2017-03-29 14:52:33 -07:00
cgrushko
6f21e29268 Compile the Java proto runtime with Java 6
in order to avoid errors related to generics when 
building user code in newer versions of Java.
2017-03-22 14:27:51 -04:00
Bairen Yi
312e2dbcfb Update BUILD 2017-03-21 03:52:37 +08:00
Byron Yi
cb3e84b78e migrate delimited messages functions to util package 2017-03-16 20:01:22 +08:00
Adam Michael
6044b24cfc Make //:protobuf_python have correct __init__.py.
Previously //:protobuf_python set no __init__.py so Bazel created an
empty one. This change makes it use the __init__.py from the repository.
2017-03-10 18:06:34 -05:00
Feng Xiao
0c0a8879c3 Merge pull request #2751 from keveman/master
Added a header only cc_library target for the protobuf library.
2017-03-06 10:41:19 -08:00
Manjunath Kudlur
6837b2dcb7 Added comment explaining the protobuf_headers target. 2017-03-02 18:02:05 -08:00
Jisi Liu
72b82e6875 Merge pull request #2630 from blodan/master
FreeBSD compatibility
2017-02-24 12:52:53 -08:00