Fixing merge issues

pull/10797/head
Mike Kruskal 2 years ago
parent c1202610e0
commit 449b6e860f
  1. 34
      .bazelrc
  2. 4
      CMakeLists.txt
  3. 1
      cmake/protobuf-config.cmake.in
  4. 6
      cmake/utf8_range.cmake
  5. 2
      kokoro/windows/prepare_build_win64.bat
  6. 4
      protobuf_deps.bzl
  7. 1
      python/google/protobuf/pyext/message.cc
  8. 2
      python/setup.py
  9. 2
      src/google/protobuf/compiler/csharp/csharp_map_field.cc
  10. 42
      src/google/protobuf/generated_message_tctable_lite.cc
  11. 2
      third_party/utf8_range

@ -1 +1,35 @@
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
build:dbg --compilation_mode=dbg
build:opt --compilation_mode=opt
build:san-common --config=dbg --strip=never --copt=-O0 --copt=-fno-omit-frame-pointer
build:asan --config=san-common --copt=-fsanitize=address --linkopt=-fsanitize=address
build:asan --copt=-DADDRESS_SANITIZER=1
# ASAN hits ODR violations with shared linkage due to rules_proto.
build:asan --dynamic_mode=off
build:msan --config=san-common --copt=-fsanitize=memory --linkopt=-fsanitize=memory
build:msan --copt=-fsanitize-memory-track-origins
build:msan --copt=-fsanitize-memory-use-after-dtor
build:msan --action_env=MSAN_OPTIONS=poison_in_dtor=1
build:msan --copt=-DMEMORY_SANITIZER=1
# Use our instrumented LLVM libc++ in Kokoro.
build:kokoro-msan --config=msan
build:kokoro-msan --linkopt=-L/opt/libcxx_msan/lib
build:kokoro-msan --linkopt=-Wl,-rpath,/opt/libcxx_msan/lib
build:kokoro-msan --cxxopt=-stdlib=libc++ --linkopt=-stdlib=libc++
build:tsan --config=san-common --copt=-fsanitize=thread --linkopt=-fsanitize=thread
build:tsan --copt=-DTHREAD_SANITIZER=1
build:ubsan --config=san-common --copt=-fsanitize=undefined --linkopt=-fsanitize=undefined
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
build:ubsan --copt=-DUNDEFINED_SANITIZER=1
# Workaround for the fact that Bazel links with $CC, not $CXX
# https://github.com/bazelbuild/bazel/issues/11122#issuecomment-613746748
build:ubsan --copt=-fno-sanitize=function --copt=-fno-sanitize=vptr

@ -23,6 +23,10 @@ endif()
if(POLICY CMP0063) if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW) cmake_policy(SET CMP0063 NEW)
endif() endif()
# option() honor variables
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif (POLICY CMP0077)
# Project # Project
project(protobuf C CXX) project(protobuf C CXX)

@ -4,6 +4,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/protobuf-options.cmake")
# Depend packages # Depend packages
@_protobuf_FIND_ZLIB@ @_protobuf_FIND_ZLIB@
@_protobuf_FIND_ABSL@ @_protobuf_FIND_ABSL@
@_protobuf_FIND_UTF8_RANGE@
# Imported targets # Imported targets
include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/protobuf-targets.cmake")

@ -1,4 +1,4 @@
set(utf8_range_ENABLE_TESTS OFF) set(utf8_range_ENABLE_TESTS OFF CACHE BOOL "Disable utf8_range tests")
if (NOT EXISTS "${protobuf_SOURCE_DIR}/third_party/utf8_range/CMakeLists.txt") if (NOT EXISTS "${protobuf_SOURCE_DIR}/third_party/utf8_range/CMakeLists.txt")
message(FATAL_ERROR message(FATAL_ERROR
@ -8,5 +8,7 @@ if (NOT EXISTS "${protobuf_SOURCE_DIR}/third_party/utf8_range/CMakeLists.txt")
" git submodule update --init --recursive\n") " git submodule update --init --recursive\n")
endif() endif()
set(utf8_range_ENABLE_INSTALL ${protobuf_INSTALL}) set(utf8_range_ENABLE_INSTALL ${protobuf_INSTALL} CACHE BOOL "Set install")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range third_party/utf8_range) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range third_party/utf8_range)
set(_protobuf_FIND_UTF8_RANGE "if(NOT TARGET utf8_range)\n find_package(utf8_range CONFIG)\nendif()")

@ -13,4 +13,4 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary
@rem Convert Windows line breaks to Unix line breaks @rem Convert Windows line breaks to Unix line breaks
@rem This allows text-matching tests to pass @rem This allows text-matching tests to pass
find . -type f -print0 | xargs -0 d2u @find . -type f -print0 | xargs -0 d2u

@ -67,8 +67,8 @@ def protobuf_deps():
_github_archive( _github_archive(
name = "utf8_range", name = "utf8_range",
repo = "https://github.com/protocolbuffers/utf8_range", repo = "https://github.com/protocolbuffers/utf8_range",
commit = "a67b76f9f40107f2c78a5aa860bb6ce37ed83d85", commit = "de0b4a8ff9b5d4c98108bdfe723291a33c52c54f",
sha256 = "de5f99318f3b5073dd99f3d4ca31e00e90a86cc400fb375e2147ae1fd41711ed", sha256 = "5da960e5e5d92394c809629a03af3c7709d2d3d0ca731dacb3a9fb4bf28f7702",
) )
if not native.existing_rule("rules_cc"): if not native.existing_rule("rules_cc"):

@ -70,7 +70,6 @@
#include "google/protobuf/pyext/unknown_field_set.h" #include "google/protobuf/pyext/unknown_field_set.h"
#include "google/protobuf/pyext/unknown_fields.h" #include "google/protobuf/pyext/unknown_fields.h"
#include "google/protobuf/util/message_differencer.h" #include "google/protobuf/util/message_differencer.h"
#include "strings/util.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include "google/protobuf/io/coded_stream.h" #include "google/protobuf/io/coded_stream.h"
#include "google/protobuf/io/strtod.h" #include "google/protobuf/io/strtod.h"

@ -297,6 +297,8 @@ if __name__ == '__main__':
extra_objects = ['../bazel-bin/src/google/protobuf/libprotobuf.a'] extra_objects = ['../bazel-bin/src/google/protobuf/libprotobuf.a']
else: else:
extra_objects = ['../libprotobuf.a'] extra_objects = ['../libprotobuf.a']
extra_objects += list(
glob.iglob('../third_party/utf8_range/*.a'))
# Repeat all of these enough times to eliminate order-dependence. # Repeat all of these enough times to eliminate order-dependence.
extra_objects += list( extra_objects += list(
glob.iglob('../third_party/abseil-cpp/absl/**/*.a')) glob.iglob('../third_party/abseil-cpp/absl/**/*.a'))

@ -88,7 +88,7 @@ void MapFieldGenerator::GenerateMembers(io::Printer* printer) {
void MapFieldGenerator::GenerateMergingCode(io::Printer* printer) { void MapFieldGenerator::GenerateMergingCode(io::Printer* printer) {
printer->Print( printer->Print(
variables_, variables_,
"$name$_.Add(other.$name$_);\n"); "$name$_.MergeFrom(other.$name$_);\n");
} }
void MapFieldGenerator::GenerateParsingCode(io::Printer* printer) { void MapFieldGenerator::GenerateParsingCode(io::Printer* printer) {

@ -297,23 +297,31 @@ const char* TcParser::MiniParse(PROTOBUF_TC_PARAM_DECL) {
&Error, // kSplitMask | FieldKind::kFkMap &Error, // kSplitMask | FieldKind::kFkMap
}; };
// Just to be sure we got the order right, above. // Just to be sure we got the order right, above.
static_assert(0 == FieldKind::kFkNone); static_assert(0 == FieldKind::kFkNone, "Invalid table order");
static_assert(1 == FieldKind::kFkVarint); static_assert(1 == FieldKind::kFkVarint, "Invalid table order");
static_assert(2 == FieldKind::kFkPackedVarint); static_assert(2 == FieldKind::kFkPackedVarint, "Invalid table order");
static_assert(3 == FieldKind::kFkFixed); static_assert(3 == FieldKind::kFkFixed, "Invalid table order");
static_assert(4 == FieldKind::kFkPackedFixed); static_assert(4 == FieldKind::kFkPackedFixed, "Invalid table order");
static_assert(5 == FieldKind::kFkString); static_assert(5 == FieldKind::kFkString, "Invalid table order");
static_assert(6 == FieldKind::kFkMessage); static_assert(6 == FieldKind::kFkMessage, "Invalid table order");
static_assert(7 == FieldKind::kFkMap); static_assert(7 == FieldKind::kFkMap, "Invalid table order");
static_assert(8 == (+field_layout::kSplitMask | FieldKind::kFkNone)); static_assert(8 == (+field_layout::kSplitMask | FieldKind::kFkNone),
static_assert(9 == (+field_layout::kSplitMask | FieldKind::kFkVarint)); "Invalid table order");
static_assert(10 == (+field_layout::kSplitMask | FieldKind::kFkPackedVarint)); static_assert(9 == (+field_layout::kSplitMask | FieldKind::kFkVarint),
static_assert(11 == (+field_layout::kSplitMask | FieldKind::kFkFixed)); "Invalid table order");
static_assert(12 == (+field_layout::kSplitMask | FieldKind::kFkPackedFixed)); static_assert(10 == (+field_layout::kSplitMask | FieldKind::kFkPackedVarint),
static_assert(13 == (+field_layout::kSplitMask | FieldKind::kFkString)); "Invalid table order");
static_assert(14 == (+field_layout::kSplitMask | FieldKind::kFkMessage)); static_assert(11 == (+field_layout::kSplitMask | FieldKind::kFkFixed),
static_assert(15 == (+field_layout::kSplitMask | FieldKind::kFkMap)); "Invalid table order");
static_assert(12 == (+field_layout::kSplitMask | FieldKind::kFkPackedFixed),
"Invalid table order");
static_assert(13 == (+field_layout::kSplitMask | FieldKind::kFkString),
"Invalid table order");
static_assert(14 == (+field_layout::kSplitMask | FieldKind::kFkMessage),
"Invalid table order");
static_assert(15 == (+field_layout::kSplitMask | FieldKind::kFkMap),
"Invalid table order");
TailCallParseFunc parse_fn = kMiniParseTable[field_type]; TailCallParseFunc parse_fn = kMiniParseTable[field_type];
PROTOBUF_MUSTTAIL return parse_fn(PROTOBUF_TC_PARAM_PASS); PROTOBUF_MUSTTAIL return parse_fn(PROTOBUF_TC_PARAM_PASS);

@ -1 +1 @@
Subproject commit a67b76f9f40107f2c78a5aa860bb6ce37ed83d85 Subproject commit de0b4a8ff9b5d4c98108bdfe723291a33c52c54f
Loading…
Cancel
Save