Squashed 'third_party/upb/' changes from 363e39c171..92e63da733

92e63da733 Merge pull request #295 from haberman/mac-compile-fix
e179dda212 Added initialization of all members to satisfy compiler warnings.
f7fcc0df37 Fix divide by zero vs2019 compilation error #293 (#294)
7d38c201fa Enabled conformance tests to run under ASAN. This apears to work now. (#292)
0dc2394da5 Changes to support import into google3 (#291)

git-subtree-dir: third_party/upb
git-subtree-split: 92e63da73328d01b417cf26c2de7b0a27a0f83af
pull/21905/head
Mark D. Roth 5 years ago
parent c6d2315315
commit b48f821048
  1. 20
      BUILD
  2. 3
      bazel/build_defs.bzl
  3. 2
      bazel/upb_proto_library.bzl
  4. 2
      bazel/workspace_deps.bzl
  5. 2
      kokoro/ubuntu/build.sh
  6. 2
      tests/conformance_upb_failures.txt
  7. 2
      upb/def.c
  8. 2
      upb/json_decode.c
  9. 1
      upb/json_decode.h
  10. 5
      upb/port_def.inc
  11. 1
      upb/port_undef.inc

20
BUILD

@ -1,7 +1,3 @@
load(
"@rules_proto//proto:defs.bzl",
"proto_library",
)
load(
"//bazel:build_defs.bzl",
"generated_file_staleness_test",
@ -14,10 +10,17 @@ load(
"upb_proto_library",
"upb_proto_reflection_library",
)
# copybara:strip_for_google3_begin
load(
"@rules_proto//proto:defs.bzl",
"proto_library",
)
load(
"//:upb/bindings/lua/lua_proto_library.bzl",
"lua_proto_library",
)
# copybara:strip_end
licenses(["notice"]) # BSD (Google-authored w/ possible external contributions)
@ -627,11 +630,15 @@ cc_binary(
srcs = [
"tests/conformance_upb.c",
],
data = [
"tests/conformance_upb_failures.txt",
],
copts = select({
":windows": [],
"//conditions:default": COPTS,
}) + ["-Ibazel-out/k8-fastbuild/bin"],
deps = [
":port",
":conformance_proto_upb",
":conformance_proto_upbdefs",
":json",
@ -646,7 +653,10 @@ cc_binary(
make_shell_script(
name = "gen_test_conformance_upb",
out = "test_conformance_upb.sh",
contents = "external/com_google_protobuf/conformance_test_runner --enforce_recommended ./conformance_upb",
contents = "external/com_google_protobuf/conformance_test_runner " +
" --enforce_recommended " +
" --failure_list ./tests/conformance_upb_failures.txt" +
" ./conformance_upb",
)
sh_test(

@ -50,7 +50,8 @@ def _remove_suffix(str, suffix):
return str[:-len(suffix)]
def make_shell_script(name, contents, out):
contents = (runfiles_init + contents).replace("$", "$$")
contents = runfiles_init + contents # copybara:strip_for_google3
contents = contents.replace("$", "$$")
native.genrule(
name = "gen_" + name,
outs = [out],

@ -5,7 +5,7 @@
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load("@rules_proto//proto:defs.bzl", "ProtoInfo") # copybara:strip_for_google3
# Generic support code #########################################################

@ -16,7 +16,7 @@ def upb_deps():
git_repository,
name = "com_google_protobuf",
remote = "https://github.com/protocolbuffers/protobuf.git",
commit = "62832897c3cf14c93b91c412f7e64086cd272cb7", # Need to use Git until proto3 optional is released
commit = "5f5efe50c5bef20042645b51a697f58b0704ac89", # Need to use Git until proto3 optional is released
)
maybe(

@ -24,7 +24,7 @@ bazel test --test_output=errors :all
if [[ $(uname) = "Linux" ]]; then
# Verify the ASAN build. Have to exclude test_conformance_upb as protobuf
# currently leaks memory in the conformance test runner.
bazel test --copt=-fsanitize=address --linkopt=-fsanitize=address --test_output=errors -- :all -:test_conformance_upb
bazel test --copt=-fsanitize=address --linkopt=-fsanitize=address --test_output=errors :all
# Verify the UBSan build. Have to exclude Lua as the version we are using
# fails some UBSan tests.

@ -1 +1 @@
Required.ProtobufInput.PrematureEofInSubmessageValue.MESSAGE
Recommended.Proto2.JsonInput.FieldNameExtension.Validator

@ -1802,7 +1802,7 @@ static bool build_filedef(
const google_protobuf_FieldDescriptorProto *const *exts;
const upb_strview* strs;
size_t i, n;
decl_counts counts = {0};
decl_counts counts = {0, 0, 0};
count_types_in_file(file_proto, &counts);

@ -733,7 +733,7 @@ static upb_msgval jsondec_double(jsondec *d, const upb_fielddef *f) {
case JD_STRING:
str = jsondec_string(d);
if (jsondec_streql(str, "NaN")) {
val.double_val = 0.0 / 0.0;
val.double_val = UPB_NAN;
} else if (jsondec_streql(str, "Infinity")) {
val.double_val = UPB_INFINITY;
} else if (jsondec_streql(str, "-Infinity")) {

@ -3,7 +3,6 @@
#define UPB_JSONDECODE_H_
#include "upb/def.h"
#include "upb/msg.h"
#ifdef __cplusplus
extern "C" {

@ -172,3 +172,8 @@ int msvc_vsnprintf(char* s, size_t n, const char* format, va_list arg);
#else
#define UPB_INFINITY (1.0 / 0.0)
#endif
#ifdef NAN
#define UPB_NAN NAN
#else
#define UPB_NAN (0.0 / 0.0)
#endif

@ -21,6 +21,7 @@
#undef UPB_ASSERT_DEBUGVAR
#undef UPB_UNREACHABLE
#undef UPB_INFINITY
#undef UPB_NAN
#undef UPB_MSVC_VSNPRINTF
#undef _upb_snprintf
#undef _upb_vsnprintf

Loading…
Cancel
Save