aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xpython/google/protobuf/internal/python_message.py4
-rw-r--r--src/Makefile.am6
-rw-r--r--src/google/protobuf/SEBS240
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto (renamed from src/google/protobuf/compiler/cpp/test_large_enum_value.proto)0
5 files changed, 6 insertions, 245 deletions
diff --git a/.gitignore b/.gitignore
index cb0347fc..b8ba4892 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@ src/Makefile
/config.h
config.log
config.status
+pbconfig.h
libtool
protobuf-lite.pc
diff --git a/python/google/protobuf/internal/python_message.py b/python/google/protobuf/internal/python_message.py
index 6ad0f90d..54f584ae 100755
--- a/python/google/protobuf/internal/python_message.py
+++ b/python/google/protobuf/internal/python_message.py
@@ -324,7 +324,7 @@ def _ReraiseTypeErrorWithFieldName(message_name, field_name):
exc = TypeError('%s for field %s.%s' % (str(exc), message_name, field_name))
# re-raise possibly-amended exception with original traceback:
- raise type(exc), exc, sys.exc_info()[2]
+ raise type(exc)(exc, sys.exc_info()[2])
def _AddInitMethod(message_descriptor, cls):
@@ -894,7 +894,7 @@ def _AddMergeFromStringMethod(message_descriptor, cls):
except (IndexError, TypeError):
# Now ord(buf[p:p+1]) == ord('') gets TypeError.
raise message_mod.DecodeError('Truncated message.')
- except struct.error, e:
+ except struct.error as e:
raise message_mod.DecodeError(e)
return length # Return this for legacy reasons.
cls.MergeFromString = MergeFromString
diff --git a/src/Makefile.am b/src/Makefile.am
index 8a27b823..7811b0ae 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -322,7 +322,7 @@ protoc_inputs = \
google/protobuf/unittest_preserve_unknown_enum2.proto \
google/protobuf/unittest_proto3_arena.proto \
google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto \
- google/protobuf/compiler/cpp/test_large_enum_value.proto
+ google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto
EXTRA_DIST = \
$(protoc_inputs) \
@@ -398,8 +398,8 @@ protoc_outputs = \
google/protobuf/unittest_preserve_unknown_enum2.pb.h \
google/protobuf/unittest_proto3_arena.pb.cc \
google/protobuf/unittest_proto3_arena.pb.h \
- google/protobuf/compiler/cpp/test_large_enum_value.pb.cc \
- google/protobuf/compiler/cpp/test_large_enum_value.pb.h \
+ google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc \
+ google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.h \
google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc \
google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h
diff --git a/src/google/protobuf/SEBS b/src/google/protobuf/SEBS
deleted file mode 100644
index ba33c732..00000000
--- a/src/google/protobuf/SEBS
+++ /dev/null
@@ -1,240 +0,0 @@
-# **EXPERIMENTAL**
-#
-# See http://sebs.googlecode.com
-#
-# This is an experimental build definition file using the SEBS build system.
-# I (Kenton Varda, maintainer of Protocol Buffers) happen to be the author of
-# SEBS, though SEBS is not a Google project. I'm sticking this file in
-# protobuf's SVN because that's the easiest place for me to put it, and it
-# shouldn't harm anyone. This file is not included in the distribution.
-#
-# Currently, to use this file, you must generate config.h and put it at the
-# top level of the source tree.
-
-_cpp = sebs.import_("//sebs/cpp.sebs")
-
-# ====================================================================
-# Public targets
-
-protobuf_lite = _cpp.Library(
- name = "protobuf-lite",
- srcs = [ "stubs/common.cc",
- "stubs/once.cc",
- "stubs/hash.cc",
- "stubs/hash.h",
- "stubs/map-util.h",
- "stubs/stl_util-inl.h",
- "extension_set.cc",
- "generated_message_util.cc",
- "message_lite.cc",
- "repeated_field.cc",
- "wire_format_lite.cc",
- "io/coded_stream.cc",
- "io/zero_copy_stream.cc",
- "io/zero_copy_stream_impl_lite.cc" ],
- deps = [ _cpp.SystemLibrary(name = "pthread") ])
-
-protobuf = _cpp.Library(
- name = "protobuf",
- srcs = [ "stubs/strutil.cc",
- "stubs/strutil.h",
- "stubs/substitute.cc",
- "stubs/substitute.h",
- "stubs/structurally_valid.cc",
- "descriptor.cc",
- "descriptor.pb.cc",
- "descriptor_database.cc",
- "dynamic_message.cc",
- "extension_set_heavy.cc",
- "generated_message_reflection.cc",
- "message.cc",
- "reflection_ops.cc",
- "service.cc",
- "text_format.cc",
- "unknown_field_set.cc",
- "wire_format.cc",
- "io/gzip_stream.cc",
- "io/printer.cc",
- "io/tokenizer.cc",
- "io/zero_copy_stream_impl.cc",
- "compiler/importer.cc",
- "compiler/parser.cc" ],
- deps = [ protobuf_lite,
- _cpp.SystemLibrary(name = "z") ])
-
-libprotoc = _cpp.Library(
- name = "protoc",
- srcs = [ "compiler/code_generator.cc",
- "compiler/command_line_interface.cc",
- "compiler/cpp/cpp_enum.cc",
- "compiler/cpp/cpp_enum.h",
- "compiler/cpp/cpp_enum_field.cc",
- "compiler/cpp/cpp_enum_field.h",
- "compiler/cpp/cpp_extension.cc",
- "compiler/cpp/cpp_extension.h",
- "compiler/cpp/cpp_field.cc",
- "compiler/cpp/cpp_field.h",
- "compiler/cpp/cpp_file.cc",
- "compiler/cpp/cpp_file.h",
- "compiler/cpp/cpp_generator.cc",
- "compiler/cpp/cpp_helpers.cc",
- "compiler/cpp/cpp_helpers.h",
- "compiler/cpp/cpp_message.cc",
- "compiler/cpp/cpp_message.h",
- "compiler/cpp/cpp_message_field.cc",
- "compiler/cpp/cpp_message_field.h",
- "compiler/cpp/cpp_primitive_field.cc",
- "compiler/cpp/cpp_primitive_field.h",
- "compiler/cpp/cpp_service.cc",
- "compiler/cpp/cpp_service.h",
- "compiler/cpp/cpp_string_field.cc",
- "compiler/cpp/cpp_string_field.h",
- "compiler/java/java_enum.cc",
- "compiler/java/java_enum.h",
- "compiler/java/java_enum_field.cc",
- "compiler/java/java_enum_field.h",
- "compiler/java/java_extension.cc",
- "compiler/java/java_extension.h",
- "compiler/java/java_field.cc",
- "compiler/java/java_field.h",
- "compiler/java/java_file.cc",
- "compiler/java/java_file.h",
- "compiler/java/java_generator.cc",
- "compiler/java/java_helpers.cc",
- "compiler/java/java_helpers.h",
- "compiler/java/java_message.cc",
- "compiler/java/java_message.h",
- "compiler/java/java_message_field.cc",
- "compiler/java/java_message_field.h",
- "compiler/java/java_primitive_field.cc",
- "compiler/java/java_primitive_field.h",
- "compiler/java/java_service.cc",
- "compiler/java/java_service.h",
- "compiler/python/python_generator.cc" ],
- deps = [ protobuf ])
-
-protoc = _cpp.Binary(
- name = "protoc",
- srcs = [ "compiler/main.cc" ],
- deps = [ libprotoc ])
-
-# ====================================================================
-# ProtobufLibrary rule class
-
-class ProtobufLibrary(sebs.Rule):
- argument_spec = sebs.ArgumentSpec(srcs = [sebs.Artifact],
- deps = ([sebs.Rule], []),
- lite = (bool, False))
-
- def _expand(self, args):
- for dep in args.deps:
- if not isinstance(dep, ProtobufLibrary):
- raise sebs.DefinitionError(
- "Dependency of ProtobufLibrary is not a ProtobufLibrary: %s" % dep)
-
- protoc.expand_once()
-
- # We must build protoc for the host configuration to allow cross-compiling.
- host_protoc = self.context.configured_artifact(protoc.binary, "host")
-
- protoc_action = self.context.action(self, "protobuf")
- protoc_args = [host_protoc, "-Isrc", "-Itmp", "-Iinclude","--cpp_out=tmp"]
-
- cpp_srcs = []
- for src in args.srcs:
- protoc_args.append(src)
-
- # We cannot build .proto files from other packages because the .pb.cc
- # and .pb.h files would be written to that package, and we aren't allowed
- # to write to other packages.
- if self.context.local_filename(src) is None:
- raise sebs.DefinitionError(
- "Source file is not in this package: %s" % src)
-
- cc_artifact = self.context.derived_artifact(src, ".pb.cc", protoc_action)
- header_artifact = self.context.derived_artifact(
- src, ".pb.h", protoc_action)
-
- cpp_srcs.append(cc_artifact)
- cpp_srcs.append(header_artifact)
-
- protoc_action.set_command(
- sebs.SubprocessCommand(protoc_action, protoc_args, implicit = cpp_srcs))
-
- deps = list(args.deps)
- if args.lite:
- deps.append(protobuf_lite)
- else:
- deps.append(protobuf)
-
- self.__cpp_library = _cpp.Library(srcs = cpp_srcs, deps = deps,
- context = self.context)
- self.__cpp_library.label = self.label
- self.outputs = []
-
- def as_cpp_library(self):
- self.expand_once()
- return self.__cpp_library
-
-# ====================================================================
-# Tests
-
-_lite_test_protos = ProtobufLibrary(
- srcs = [ "unittest_lite.proto",
- "unittest_import_lite.proto" ],
- lite = True)
-_test_protos = ProtobufLibrary(
- srcs = [ "unittest.proto",
- "unittest_empty.proto",
- "unittest_import.proto",
- "unittest_mset.proto",
- "unittest_optimize_for.proto",
- "unittest_embed_optimize_for.proto",
- "unittest_custom_options.proto",
- "unittest_lite_imports_nonlite.proto",
- "compiler/cpp/cpp_test_bad_identifiers.proto" ],
- deps = [ _lite_test_protos ])
-
-_test_util = _cpp.Library(
- name = "test_util",
- srcs = [ "test_util.cc",
- "test_util.h",
- "testing/googletest.cc",
- "testing/googletest.h",
- "testing/file.cc",
- "testing/file.h" ],
- deps = [ protobuf, _test_protos, _cpp.SystemLibrary(name = "gtest")] )
-
-protobuf_lite_test = _cpp.Test(
- srcs = [ "lite_unittest.cc",
- "test_util_lite.cc",
- "test_util_lite.h" ],
- deps = [ _lite_test_protos ])
-
-protobuf_test = _cpp.Test(
- srcs = [ "stubs/common_unittest.cc",
- "stubs/once_unittest.cc",
- "stubs/strutil_unittest.cc",
- "stubs/structurally_valid_unittest.cc",
- "descriptor_database_unittest.cc",
- "descriptor_unittest.cc",
- "dynamic_message_unittest.cc",
- "extension_set_unittest.cc",
- "generated_message_reflection_unittest.cc",
- "message_unittest.cc",
- "reflection_ops_unittest.cc",
- "repeated_field_unittest.cc",
- "text_format_unittest.cc",
- "unknown_field_set_unittest.cc",
- "wire_format_unittest.cc",
- "io/coded_stream_unittest.cc",
- "io/printer_unittest.cc",
- "io/tokenizer_unittest.cc",
- "io/zero_copy_stream_unittest.cc",
- "compiler/command_line_interface_unittest.cc",
- "compiler/importer_unittest.cc",
- "compiler/parser_unittest.cc",
- "compiler/cpp/cpp_bootstrap_unittest.cc",
- "compiler/cpp/cpp_unittest.cc" ],
- deps = [ protobuf, libprotoc, _test_util,
- _cpp.SystemLibrary(name = "gtest_main") ])
diff --git a/src/google/protobuf/compiler/cpp/test_large_enum_value.proto b/src/google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto
index cb6ca1b1..cb6ca1b1 100644
--- a/src/google/protobuf/compiler/cpp/test_large_enum_value.proto
+++ b/src/google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto