Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4dfaf39
Enable timestamp tests and add support for fixed timezones.
TristonianJones Oct 9, 2020
85a8fe3
Add support for CelType to FunctionAdapter.
Oct 9, 2020
5877e23
Makes CEL parser tolerate trailing commas in `CreateMessage` and `Cre…
Oct 12, 2020
187e722
Internal change.
Oct 12, 2020
6821237
Fix signed and unsigned integer overflow cases within C++ evaluator.
TristonianJones Oct 14, 2020
5efd741
Enable proto2/proto3 test inputs for C++ Conformance server.
TristonianJones Oct 14, 2020
c20d88d
Internal change.
Oct 16, 2020
729b8f3
Adding support for bool keys to FieldBackedMapImpl
Oct 26, 2020
70b6812
Print out the optional field name in NoSuchFieldError to make debuggi…
Oct 26, 2020
6dfb7c8
Switch FieldBackedMapImpl to use proto2::Reflection::LookupMapValue i…
Oct 26, 2020
5200c84
Clean up unused protobuf-lite dependency
Oct 28, 2020
4e2d9ae
Update the has() macro support for C++ and fix enum resolution behavior
TristonianJones Nov 2, 2020
e541ad5
Add function reference renaming to reference resolver.
Nov 5, 2020
26599a1
Introduce PostVisitTarget() into the ast_visitor, to visit the target…
Nov 12, 2020
03d782f
Allow disabling the check phase.
kyessenov Nov 13, 2020
dbe7c54
Add overloads for building checked exprs. Add rewriting routine for r…
Nov 16, 2020
28cffc2
Use Enum Const References
Nov 18, 2020
684848d
Implement a pipe protocol for cel-spec conformance client/server.
kyessenov Nov 19, 2020
fc02992
Re-organize OSS build for easier maintenance.
kyessenov Nov 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package(default_visibility = ["//visibility:public"])
144 changes: 5 additions & 139 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,143 +1,9 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
workspace(name = "com_google_cel_cpp")

CEL_SPEC_GIT_SHA = "02a12e7cffe452a611b0e6ef47872963bbd87028" # 4/17/2020
load("//bazel:deps.bzl", "cel_cpp_deps")

CEL_SPEC_SHA = "757cfdb00dc76fd0d12dadbae982c22a9218711d5e4cf30c94cfe6c05b1cdf2b"
cel_cpp_deps()

http_archive(
name = "com_google_cel_spec",
sha256 = CEL_SPEC_SHA,
strip_prefix = "cel-spec-" + CEL_SPEC_GIT_SHA,
urls = ["https://github.com/google/cel-spec/archive/" + CEL_SPEC_GIT_SHA + ".zip"],
)
load("//bazel:deps_extra.bzl", "cel_cpp_deps_extra")

http_archive(
name = "com_google_absl",
strip_prefix = "abseil-cpp-master",
urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"],
)

# Google RE2 (Regular Expression) C++ Library
http_archive(
name = "com_googlesource_code_re2",
strip_prefix = "re2-master",
urls = ["https://github.com/google/re2/archive/master.zip"],
)

# gRPC dependencies:
http_archive(
name = "com_github_grpc_grpc",
sha256 = "1236514199d3deb111a6dd7f6092f67617cd2b147f7eda7adbafccea95de7381",
strip_prefix = "grpc-1.31.0",
urls = ["https://github.com/grpc/grpc/archive/v1.31.0.tar.gz"],
)

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")

grpc_deps()

GOOGLEAPIS_GIT_SHA = "be480e391cc88a75cf2a81960ef79c80d5012068" # Jul 24, 2019

GOOGLEAPIS_SHA = "c1969e5b72eab6d9b6cfcff748e45ba57294aeea1d96fd04cd081995de0605c2"

http_archive(
name = "com_google_googleapis",
sha256 = GOOGLEAPIS_SHA,
strip_prefix = "googleapis-" + GOOGLEAPIS_GIT_SHA,
urls = ["https://github.com/googleapis/googleapis/archive/" + GOOGLEAPIS_GIT_SHA + ".tar.gz"],
)

load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")

switched_rules_by_language(
name = "com_google_googleapis_imports",
cc = True,
go = True,
grpc = True,
)

http_archive(
name = "io_bazel_rules_go",
sha256 = "f04d2373bcaf8aa09bccb08a98a57e721306c8f6043a2a0ee610fd6853dcde3d",
urls = ["https://github.com/bazelbuild/rules_go/releases/download/0.18.6/rules_go-0.18.6.tar.gz"],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

# cel-go dependencies:
http_archive(
name = "bazel_gazelle",
sha256 = "3c681998538231a2d24d0c07ed5a7658cb72bfb5fd4bf9911157c0e9ac6a2687",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.17.0/bazel-gazelle-0.17.0.tar.gz"],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

git_repository(
name = "com_google_cel_go",
remote = "https://github.com/google/cel-go.git",
tag = "v0.5.1",
)

go_repository(
name = "org_golang_google_genproto",
build_file_proto_mode = "disable",
commit = "bd91e49a0898e27abb88c339b432fa53d7497ac0",
importpath = "google.golang.org/genproto",
)

go_repository(
name = "com_github_antlr",
commit = "621b933c7a7f01c67ae9de15103151fa0f9d6d90",
importpath = "github.com/antlr/antlr4",
)

go_rules_dependencies()

go_register_toolchains()

gazelle_dependencies()

# Parser dependencies
http_archive(
name = "rules_antlr",
sha256 = "7249d1569293d9b239e23c65f6b4c81a07da921738bde0dfeb231ed98be40429",
strip_prefix = "rules_antlr-3cc2f9502a54ceb7b79b37383316b23c4da66f9a",
urls = ["https://github.com/marcohu/rules_antlr/archive/3cc2f9502a54ceb7b79b37383316b23c4da66f9a.tar.gz"],
)

load("@rules_antlr//antlr:deps.bzl", "antlr_dependencies")

antlr_dependencies(472)

http_archive(
name = "antlr4_runtimes",
build_file_content = """
package(default_visibility = ["//visibility:public"])
cc_library(
name = "cpp",
srcs = glob(["runtime/Cpp/runtime/src/**/*.cpp"]),
hdrs = glob(["runtime/Cpp/runtime/src/**/*.h"]),
includes = ["runtime/Cpp/runtime/src"],
)
""",
sha256 = "46f5e1af5f4bd28ade55cb632f9a069656b31fc8c2408f9aa045f9b5f5caad64",
strip_prefix = "antlr4-4.7.2",
urls = ["https://github.com/antlr/antlr4/archive/4.7.2.tar.gz"],
)

# tools/flatbuffers dependencies
FLAT_BUFFERS_SHA = "a83caf5910644ba1c421c002ef68e42f21c15f9f"

http_archive(
name = "com_github_google_flatbuffers",
sha256 = "b8efbc25721e76780752bad775a97c3f77a0250271e2db37fc747b20e8b0f24a",
strip_prefix = "flatbuffers-" + FLAT_BUFFERS_SHA,
url = "https://github.com/google/flatbuffers/archive/" + FLAT_BUFFERS_SHA + ".tar.gz",
)

# Needed by gRPC build rules (but not used). Should be after genproto.
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")

grpc_extra_deps()
cel_cpp_deps_extra()
4 changes: 4 additions & 0 deletions base/status_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,8 @@ inline To down_cast(From* f) { // so we only accept pointers
#define EXPECT_OK(expression) EXPECT_TRUE(expression.ok())
#endif

#if !defined(CHECK_OK)
#define CHECK_OK(expression) assert(expression.ok())
#endif

#endif // THIRD_PARTY_CEL_CPP_BASE_STATUS_MACROS_H_
116 changes: 116 additions & 0 deletions bazel/deps.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
"""
Main dependencies of cel-cpp.
"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def base_deps():
"""Base evaluator and test dependencies."""
http_archive(
name = "com_google_absl",
strip_prefix = "abseil-cpp-master",
urls = ["https://github.com/abseil/abseil-cpp/archive/master.zip"],
)

http_archive(
name = "com_google_googletest",
urls = ["https://github.com/google/googletest/archive/master.zip"],
strip_prefix = "googletest-master",
)

http_archive(
name = "com_github_google_benchmark",
urls = ["https://github.com/google/benchmark/archive/master.zip"],
strip_prefix = "benchmark-master",
)

http_archive(
name = "com_googlesource_code_re2",
strip_prefix = "re2-master",
urls = ["https://github.com/google/re2/archive/master.zip"],
)

PROTOBUF_VERSION = "3.14.0"
http_archive(
name = "com_google_protobuf",
strip_prefix = "protobuf-" + PROTOBUF_VERSION,
urls = ["https://github.com/protocolbuffers/protobuf/archive/v" + PROTOBUF_VERSION + ".tar.gz"],
)

GOOGLEAPIS_GIT_SHA = "be480e391cc88a75cf2a81960ef79c80d5012068" # Jul 24, 2019
GOOGLEAPIS_SHA = "c1969e5b72eab6d9b6cfcff748e45ba57294aeea1d96fd04cd081995de0605c2"
http_archive(
name = "com_google_googleapis",
sha256 = GOOGLEAPIS_SHA,
strip_prefix = "googleapis-" + GOOGLEAPIS_GIT_SHA,
urls = ["https://github.com/googleapis/googleapis/archive/" + GOOGLEAPIS_GIT_SHA + ".tar.gz"],
)

def parser_deps():
"""ANTLR dependency for the parser."""
http_archive(
name = "rules_antlr",
sha256 = "7249d1569293d9b239e23c65f6b4c81a07da921738bde0dfeb231ed98be40429",
strip_prefix = "rules_antlr-3cc2f9502a54ceb7b79b37383316b23c4da66f9a",
urls = ["https://github.com/marcohu/rules_antlr/archive/3cc2f9502a54ceb7b79b37383316b23c4da66f9a.tar.gz"],
)

http_archive(
name = "antlr4_runtimes",
build_file_content = """
package(default_visibility = ["//visibility:public"])
cc_library(
name = "cpp",
srcs = glob(["runtime/Cpp/runtime/src/**/*.cpp"]),
hdrs = glob(["runtime/Cpp/runtime/src/**/*.h"]),
includes = ["runtime/Cpp/runtime/src"],
)
""",
sha256 = "46f5e1af5f4bd28ade55cb632f9a069656b31fc8c2408f9aa045f9b5f5caad64",
strip_prefix = "antlr4-4.7.2",
urls = ["https://github.com/antlr/antlr4/archive/4.7.2.tar.gz"],
)

def flatbuffers_deps():
"""FlatBuffers support."""
FLAT_BUFFERS_SHA = "a83caf5910644ba1c421c002ef68e42f21c15f9f"
http_archive(
name = "com_github_google_flatbuffers",
sha256 = "b8efbc25721e76780752bad775a97c3f77a0250271e2db37fc747b20e8b0f24a",
strip_prefix = "flatbuffers-" + FLAT_BUFFERS_SHA,
url = "https://github.com/google/flatbuffers/archive/" + FLAT_BUFFERS_SHA + ".tar.gz",
)

def cel_spec_deps():
"""CEL Spec conformance testing."""
http_archive(
name = "io_bazel_rules_go",
sha256 = "207fad3e6689135c5d8713e5a17ba9d1290238f47b9ba545b63d9303406209c6",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.7/rules_go-v0.24.7.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.7/rules_go-v0.24.7.tar.gz",
],
)

http_archive(
name = "bazel_gazelle",
sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.2/bazel-gazelle-v0.22.2.tar.gz",
],
)

CEL_SPEC_GIT_SHA = "95fe21a64063d63482a4b1b3159c07b5b7b64d77" # 11/23/2020
http_archive(
name = "com_google_cel_spec",
strip_prefix = "cel-spec-" + CEL_SPEC_GIT_SHA,
urls = ["https://github.com/google/cel-spec/archive/" + CEL_SPEC_GIT_SHA + ".zip"],
)

def cel_cpp_deps():
"""All core dependencies of cel-cpp."""
base_deps()
parser_deps()
flatbuffers_deps()
cel_spec_deps()
54 changes: 54 additions & 0 deletions bazel/deps_extra.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""
Transitive dependencies.
"""

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
load("@rules_antlr//antlr:deps.bzl", "antlr_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

def cel_spec_deps_extra():
"""CEL Spec dependencies."""
go_repository(
name = "org_golang_google_genproto",
build_file_proto_mode = "disable_global",
commit = "62d171c70ae133bd47722027b62f8820407cf744",
importpath = "google.golang.org/genproto",
)

go_repository(
name = "org_golang_google_grpc",
build_file_proto_mode = "disable_global",
importpath = "google.golang.org/grpc",
tag = "v1.33.2",
)

go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=",
version = "v0.0.0-20190311183353-d8887717615a",
)

go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=",
version = "v0.3.0",
)

go_rules_dependencies()
go_register_toolchains()
gazelle_dependencies()

def cel_cpp_deps_extra():
"""All transitive dependencies."""
protobuf_deps()
switched_rules_by_language(
name = "com_google_googleapis_imports",
cc = True,
go = True, # cel-spec requirement
)
antlr_dependencies(472)
cel_spec_deps_extra()
Loading