Skip to content

Commit 0cf941e

Browse files
committed
Re-cover deleted base files
1 parent 455e8ce commit 0cf941e

File tree

7 files changed

+756
-0
lines changed

7 files changed

+756
-0
lines changed

.bazelrc

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Placeholder file for Prow
2+
3+
# Required by envoy and its tests
4+
build --define=grpc_no_ares=true
5+
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
6+
7+
# We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace.
8+
build --define absl=1
9+
10+
# Compile a Position Independent Executable
11+
# Ref: github.com/envoyproxy/envoy#8792
12+
build --copt=-fPIC
13+
14+
# Other flags for the C++ compiler
15+
build --show_timestamps
16+
17+
# Compilation modes
18+
build:release -c opt
19+
build:debug -c dbg
20+
21+
build --experimental_local_memory_estimate
22+
build --incompatible_strict_action_env=true
23+
build --host_force_python=PY3
24+
build --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a
25+
build --action_env=BAZEL_LINKOPTS=-lm
26+
27+
# We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace.
28+
build --define absl=1
29+
30+
# Pass PATH variable from the environment. CC and CXX are always clang (no gcc).
31+
build --action_env=CC=clang-14
32+
build --action_env=CXX=clang++-14
33+
build --action_env=PATH
34+
35+
# Disable ICU linking for googleurl.
36+
37+
# Common flags for sanitizers
38+
build:sanitizer --define tcmalloc=disabled
39+
build:sanitizer --linkopt -ldl
40+
build:sanitizer --build_tag_filters=-no_san
41+
build:sanitizer --test_tag_filters=-no_san
42+
43+
# Common flags for Clang
44+
build:clang --action_env=BAZEL_COMPILER=clang
45+
46+
# Compile with the Scudo allocator
47+
# https://llvm.org/docs/ScudoHardenedAllocator.html
48+
build:clang --copt -fsanitize=scudo
49+
50+
# Compile with automatic variable initialization
51+
# https://reviews.llvm.org/rL349442
52+
build:clang --copt -ftrivial-auto-var-init=pattern
53+
54+
# Compilation modes
55+
build:clang-release --config=clang
56+
build:clang-release --config=release
57+
58+
# Basic ASAN/UBSAN that works for gcc
59+
build:asan --config=sanitizer
60+
build:asan --config=debug
61+
# ASAN install its signal handler, disable ours so the stacktrace will be printed by ASAN
62+
build:asan --define signal_trace=disabled
63+
build:asan --define ENVOY_CONFIG_ASAN=1
64+
65+
build:asan --copt -fsanitize=address,undefined
66+
build:asan --linkopt -fsanitize=address,undefined
67+
68+
69+
build:asan --copt -DADDRESS_SANITIZER=1
70+
build:asan --copt -D__SANITIZE_ADDRESS__
71+
build:asan --test_env=ASAN_OPTIONS=handle_abort=1:allow_addr2line=true:check_initialization_order=true:strict_init_order=true:detect_odr_violation=1
72+
build:asan --test_env=UBSAN_OPTIONS=halt_on_error=true:print_stacktrace=1
73+
build:asan --test_env=ASAN_SYMBOLIZER_PATH
74+
75+
build:clang-asan --config=asan
76+
build:clang-asan --action_env=ENVOY_UBSAN_VPTR=1
77+
build:clang-asan --copt -fno-sanitize=vptr,function
78+
build:clang-asan --linkopt -fno-sanitize=vptr,function
79+
build:clang-asan --copt -fno-optimize-sibling-calls
80+
build:clang-asan --copt -fno-omit-frame-pointer
81+
82+
83+
build:asan --config=debug
84+
build:clang-tsan --config=sanitizer
85+
build:clang-tsan --define ENVOY_CONFIG_TSAN=1
86+
build:clang-tsan --copt -fsanitize=thread
87+
build:clang-tsan --linkopt -fsanitize=thread
88+
build:clang-tsan --copt -DEVENT__DISABLE_DEBUG_MODE
89+
90+
# Fuzz builds
91+
build:asan-fuzzer --config=clang-asan
92+
build:asan-fuzzer -c opt
93+
build:asan-fuzzer --action_env=CC=clang-14
94+
build:asan-fuzzer --action_env=CXX=clang++-14
95+
build:asan-fuzzer --nocache_test_results
96+
build:asan-fuzzer --define=FUZZING_ENGINE=libfuzzer
97+
build:asan-fuzzer --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
98+
build:asan-fuzzer --copt=-fsanitize=fuzzer-no-link
99+
# Remove UBSAN halt_on_error to avoid crashing on protobuf errors.
100+
build:asan-fuzzer --test_env=UBSAN_OPTIONS=print_stacktrace=1
101+
102+
# Coverage
103+
coverage --config=coverage
104+
build:coverage --action_env=BAZEL_USE_LLVM_NATIVE_COVERAGE=1
105+
build:coverage --action_env=GCOV=llvm-profdata
106+
build:coverage --action_env=CC=clang-14
107+
build:coverage --action_env=CXX=clang++-14
108+
build:coverage --copt=-DNDEBUG
109+
build:coverage --test_timeout=900
110+
build:coverage --define=ENVOY_CONFIG_COVERAGE=1
111+
build:coverage --cxxopt="-DENVOY_CONFIG_COVERAGE=1"
112+
build:coverage --coverage_support=@envoy//bazel/coverage:coverage_support
113+
build:coverage --test_env=CC_CODE_COVERAGE_SCRIPT=external/envoy/bazel/coverage/collect_cc_coverage.sh
114+
build:coverage --test_env=HEAPCHECK=
115+
build:coverage --combined_report=lcov
116+
build:coverage --strategy=TestRunner=sandboxed,local
117+
build:coverage --strategy=CoverageReport=sandboxed,local
118+
build:coverage --experimental_use_llvm_covmap
119+
build:coverage --collect_code_coverage
120+
build:coverage --test_tag_filters=-nocoverage
121+
build:coverage --instrumentation_filter="//src[/:]"
122+
coverage:test-coverage --test_arg="--log-path /dev/null"
123+
coverage:test-coverage --test_arg="-l trace"
124+
coverage:fuzz-coverage --config=asan-fuzzer
125+
coverage:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper.sh

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.1.0

BUILD.bazel

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("@rules_cc//cc:defs.bzl", "cc_library")
16+
17+
cc_library(
18+
name = "all_libs",
19+
visibility = ["//visibility:public"],
20+
deps = [
21+
"//proto_processing_lib:factory_helper",
22+
"//proto_processing_lib:interface_util",
23+
"//proto_processing_lib/proto_scrubber",
24+
"//proto_processing_lib/proto_scrubber:cloud_audit_log_field_checker",
25+
],
26+
)

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# How to contribute
2+
3+
We'd love to accept your patches and contributions to this project.
4+
5+
## Before you begin
6+
7+
### Sign our Contributor License Agreement
8+
9+
Contributions to this project must be accompanied by a
10+
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
11+
You (or your employer) retain the copyright to your contribution; this simply
12+
gives us permission to use and redistribute your contributions as part of the
13+
project.
14+
15+
If you or your current employer have already signed the Google CLA (even if it
16+
was for a different project), you probably don't need to do it again.
17+
18+
Visit <https://cla.developers.google.com/> to see your current agreements or to
19+
sign a new one.
20+
21+
### Review our community guidelines
22+
23+
This project follows
24+
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
25+
26+
## Contribution process
27+
28+
### Code reviews
29+
30+
All submissions, including submissions by project members, require review. We
31+
use GitHub pull requests for this purpose. Consult
32+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
33+
information on using pull requests.

WORKSPACE

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
workspace(name = "proto_processing_lib")
2+
3+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4+
5+
http_archive(
6+
name = "bazel_skylib",
7+
sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
8+
urls = [
9+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
10+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
11+
],
12+
)
13+
14+
http_archive(
15+
name = "com_google_googletest",
16+
sha256 = "730215d76eace9dd49bf74ce044e8daa065d175f1ac891cc1d6bb184ef94e565",
17+
strip_prefix = "googletest-f53219cdcb7b084ef57414efea92ee5b71989558",
18+
urls = [
19+
"https://github.com/google/googletest/archive/f53219cdcb7b084ef57414efea92ee5b71989558.tar.gz", # 2023-03-16
20+
],
21+
)
22+
23+
load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps")
24+
25+
googletest_deps()
26+
27+
# Archive building rules.
28+
http_archive(
29+
name = "rules_pkg",
30+
sha256 = "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d",
31+
urls = [
32+
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
33+
"https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
34+
],
35+
)
36+
37+
# For status_macros
38+
http_archive(
39+
name = "ocp",
40+
strip_prefix = "ocp-diag-core-e965ac0ac6db6686169678e2a6c77ede904fa82c/apis/c++",
41+
url = "https://github.com/opencomputeproject/ocp-diag-core/archive/e965ac0ac6db6686169678e2a6c77ede904fa82c.tar.gz",
42+
)
43+
44+
http_archive(
45+
name = "grpc_httpjson_transcoding",
46+
strip_prefix = "grpc-httpjson-transcoding-ff41eb3fc9209e6197595b54f7addfa244c0bdb6", # June 7, 2023
47+
url = "https://github.com/grpc-ecosystem/grpc-httpjson-transcoding/archive/ff41eb3fc9209e6197595b54f7addfa244c0bdb6.tar.gz",
48+
# commit = "ff41eb3fc9209e6197595b54f7addfa244c0bdb6", # June 7, 2023
49+
# remote = "https://github.com/grpc-ecosystem/grpc-httpjson-transcoding.git",
50+
)
51+
52+
http_archive(
53+
name = "com_google_ortools",
54+
sha256 = "054d9517fc6c83f15150c93ef1c2c674ffd7d4a0d1fdc78f6ef8bc3e25c2e339",
55+
strip_prefix = "or-tools-9.7",
56+
url = "https://github.com/google/or-tools/archive/refs/tags/v9.7.tar.gz",
57+
)
58+
59+
http_archive(
60+
name = "com_google_proto_field_extraction",
61+
strip_prefix = "proto-field-extraction-e808da3acf5bd6d518e19e8afa20b4a9d0b2b599", # Mar 20, 2024
62+
url = "https://github.com/grpc-ecosystem/proto-field-extraction/archive/e808da3acf5bd6d518e19e8afa20b4a9d0b2b599.tar.gz",
63+
)
64+
65+
# -------- Load and call dependencies of underlying libraries --------
66+
67+
load("@grpc_httpjson_transcoding//:repositories.bzl", "absl_repositories", "googleapis_repositories", "io_bazel_rules_docker", "protobuf_repositories", "protoconverter_repositories", "zlib_repositories")
68+
69+
protoconverter_repositories()
70+
71+
googleapis_repositories()
72+
73+
protobuf_repositories()
74+
75+
zlib_repositories()
76+
77+
absl_repositories()
78+
79+
io_bazel_rules_docker()
80+
81+
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
82+
83+
switched_rules_by_language(
84+
name = "com_google_googleapis_imports",
85+
cc = True,
86+
)
87+
88+
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
89+
90+
rules_pkg_dependencies()
91+
92+
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
93+
94+
bazel_skylib_workspace()
95+
96+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
97+
98+
protobuf_deps()

proto_processing_lib/BUILD.bazel

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
# Copyright 2023 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
package(default_visibility = ["//visibility:public"])
17+
18+
cc_library(
19+
name = "factory_helper",
20+
hdrs = [
21+
"factory_helper.h",
22+
],
23+
deps = [
24+
":interface_util",
25+
"//proto_processing_lib/proto_scrubber:field_checker_interface",
26+
"//proto_processing_lib/proto_scrubber:field_mask_tree",
27+
"//proto_processing_lib/proto_scrubber:unknown_field_checker",
28+
],
29+
)
30+
31+
cc_library(
32+
name = "interface_util",
33+
hdrs = [
34+
"interface_util.h",
35+
],
36+
deps = [
37+
"//proto_processing_lib/proto_scrubber:field_checker_interface",
38+
"//proto_processing_lib/proto_scrubber:field_mask_node",
39+
"//proto_processing_lib/proto_scrubber:proto_scrubber_enums",
40+
"@com_google_absl//absl/status",
41+
"@com_google_proto_field_extraction//proto_field_extraction/message_data:message_data_interface",
42+
],
43+
)
44+

0 commit comments

Comments
 (0)