Fixes for Bazel 0.25.

Disabled the conformance tests for now because I didn't push
the necessary changes to the protobuf repo yet.
pull/13171/head
Joshua Haberman 6 years ago
parent b08819749e
commit 20d849a5e0
  1. 78
      BUILD
  2. 15
      WORKSPACE
  3. 16
      build_defs.bzl

78
BUILD

@ -350,45 +350,45 @@ cc_test(
copts = CPPOPTS,
)
upb_proto_library(
name = "conformance_proto_upb",
deps = ["@com_google_protobuf//:conformance_proto"],
)
upb_proto_library(
name = "test_messages_proto3_proto_upb",
deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
)
cc_binary(
name = "conformance_upb",
srcs = [
"tests/conformance_upb.c",
],
copts = COPTS + ["-Ibazel-out/k8-fastbuild/bin"],
deps = [
":conformance_proto_upb",
":test_messages_proto3_proto_upb",
":upb",
],
)
make_shell_script(
name = "gen_test_conformance_upb",
out = "test_conformance_upb.sh",
contents = "$(rlocation com_google_protobuf/conformance_test_runner) $(rlocation upb/conformance_upb)",
)
sh_test(
name = "test_conformance_upb",
srcs = ["test_conformance_upb.sh"],
data = [
"tests/conformance_upb_failures.txt",
":conformance_upb",
"@bazel_tools//tools/bash/runfiles",
"@com_google_protobuf//:conformance_test_runner",
],
)
#upb_proto_library(
# name = "conformance_proto_upb",
# deps = ["@com_google_protobuf//:conformance_proto"],
#)
#upb_proto_library(
# name = "test_messages_proto3_proto_upb",
# deps = ["@com_google_protobuf//:test_messages_proto3_proto"],
#)
#cc_binary(
# name = "conformance_upb",
# srcs = [
# "tests/conformance_upb.c",
# ],
# copts = COPTS + ["-Ibazel-out/k8-fastbuild/bin"],
# deps = [
# ":conformance_proto_upb",
# ":test_messages_proto3_proto_upb",
# ":upb",
# ],
#)
#
#make_shell_script(
# name = "gen_test_conformance_upb",
# out = "test_conformance_upb.sh",
# contents = "$(rlocation com_google_protobuf/conformance_test_runner) $(rlocation upb/conformance_upb)",
#)
#
#sh_test(
# name = "test_conformance_upb",
# srcs = ["test_conformance_upb.sh"],
# data = [
# "tests/conformance_upb_failures.txt",
# ":conformance_upb",
# "@bazel_tools//tools/bash/runfiles",
# "@com_google_protobuf//:conformance_test_runner",
# ],
#)
# Amalgamation #################################################################

@ -17,11 +17,16 @@ http_archive(
git_repository(
name = "com_google_protobuf",
commit = "25feb59620627b673df76813dfd66e3f565765e7",
#sha256 = "d7a221b3d4fb4f05b7473795ccea9e05dab3b8721f6286a95fffbffc2d926f8b",
remote = "https://github.com/haberman/protobuf.git",
shallow_since = "1541281400 -0700"
#tag = "conformance-build-tag",
commit = "ec1a70913e5793a7d0a7b5fbf7e0e4f75409dd41",
remote = "https://github.com/protocolbuffers/protobuf.git",
)
http_archive(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
)
git_repository(

@ -1,3 +1,7 @@
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
_shell_find_runfiles = """
# --- begin runfiles.bash initialization ---
# Copy-pasted from Bazel's Bash runfiles library (tools/bash/runfiles/runfiles.bash).
@ -23,10 +27,6 @@ _shell_find_runfiles = """
# --- end runfiles.bash initialization ---
"""
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "CPP_LINK_STATIC_LIBRARY_ACTION_NAME")
def _librule(name):
return name + "_lib"
@ -286,15 +286,17 @@ def cc_library_func(ctx, hdrs, srcs, deps):
unsupported_features = ctx.disabled_features,
)
compilation_info = cc_common.compile(
ctx = ctx,
actions = ctx.actions,
feature_configuration = feature_configuration,
cc_toolchain = toolchain,
name = "upb_lib",
srcs = srcs,
hdrs = hdrs,
public_hdrs = hdrs,
compilation_contexts = compilation_contexts,
)
linking_info = cc_common.link(
ctx = ctx,
actions = ctx.actions,
name = "upb_lib",
feature_configuration = feature_configuration,
cc_toolchain = toolchain,
cc_compilation_outputs = compilation_info.cc_compilation_outputs,

Loading…
Cancel
Save