From d5644c49210229300ab6d4db2fc95e035d1755d2 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Thu, 11 Jun 2020 23:33:22 +0000 Subject: [PATCH 01/34] Subject: porting Envoy to C++17 Signed-off-by: Yifan Yang --- .bazelrc | 1 + bazel/cel-cpp.patch | 1360 +++++++++++++++++ bazel/envoy_internal.bzl | 4 +- bazel/repositories.bzl | 6 +- ci/do_ci.sh | 1 + source/common/grpc/google_async_client_impl.h | 2 +- .../common/upstream/outlier_detection_impl.h | 2 +- .../common/aws/credentials_provider.h | 1 + .../http/grpc_http1_reverse_bridge/filter.cc | 2 +- tools/type_whisperer/api_type_db.h | 1 + 10 files changed, 1374 insertions(+), 6 deletions(-) create mode 100644 bazel/cel-cpp.patch diff --git a/.bazelrc b/.bazelrc index b7bd7b87950cd..544fdd933a449 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,6 +19,7 @@ build --action_env=BAZEL_LINKOPTS=-lm build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11 build --javabase=@bazel_tools//tools/jdk:remote_jdk11 build --enable_platform_specific_config +build --cxxopt=-std=c++17 # Enable position independent code, this option is not supported on Windows and default on on macOS. build:linux --copt=-fPIC diff --git a/bazel/cel-cpp.patch b/bazel/cel-cpp.patch new file mode 100644 index 0000000000000..4511503966a22 --- /dev/null +++ b/bazel/cel-cpp.patch @@ -0,0 +1,1360 @@ +diff --git a/base/BUILD b/base/BUILD +index 2ddce9f..f6c1d58 100644 +--- a/base/BUILD ++++ b/base/BUILD +@@ -13,7 +13,7 @@ cc_library( + "statusor.h", + "statusor_internals.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_google_absl//absl/base:core_headers", + "@com_google_absl//absl/meta:type_traits", +@@ -26,5 +26,5 @@ cc_library( + hdrs = [ + "status_macros.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + ) +diff --git a/common/BUILD b/common/BUILD +index d561461..a08de81 100644 +--- a/common/BUILD ++++ b/common/BUILD +@@ -12,7 +12,7 @@ cc_library( + hdrs = [ + "macros.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [], + ) + +@@ -21,7 +21,7 @@ cc_library( + hdrs = [ + "id.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//internal:cel_printer", + "//internal:handle", +@@ -35,7 +35,7 @@ cc_library( + hdrs = [ + "type.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//internal:handle", + "@com_google_absl//absl/memory", +@@ -51,7 +51,7 @@ cc_library( + hdrs = [ + "enum.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":type", + "//internal:cel_printer", +@@ -66,7 +66,7 @@ cc_library( + hdrs = [ + "error.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//internal:cel_printer", + "//internal:hash_util", +@@ -84,7 +84,7 @@ cc_library( + hdrs = [ + "unknown.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":id", + ":macros", +@@ -100,7 +100,7 @@ cc_library( + hdrs = [ + "parent_ref.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//internal:ref_countable", + "@com_google_absl//absl/types:optional", +@@ -115,7 +115,7 @@ cc_library( + hdrs = [ + "custom_object.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":value", + ], +@@ -129,7 +129,7 @@ cc_library( + hdrs = [ + "operators.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_google_absl//absl/strings", + "@com_google_absl//absl/types:optional", +@@ -145,7 +145,7 @@ cc_library( + hdrs = [ + "escaping.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_google_absl//absl/strings", + "@com_google_absl//absl/strings:str_format", +@@ -156,7 +156,7 @@ cc_library( + cc_test( + name = "escaping_test", + srcs = ["escaping_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":escaping", + "@com_github_google_googletest//:gtest_main", +@@ -171,7 +171,7 @@ cc_library( + hdrs = [ + "value.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":enum", + ":error", +@@ -202,7 +202,7 @@ cc_library( + cc_test( + name = "value_test", + srcs = ["value_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":custom_object", + ":value", +@@ -226,7 +226,7 @@ cc_library( + hdrs = [ + "converters.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":parent_ref", + ":value", +@@ -239,7 +239,7 @@ cc_library( + cc_test( + name = "converters_test", + srcs = ["converters_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":converters", + ":value", +diff --git a/conformance/BUILD b/conformance/BUILD +index 2aacf82..0e680ba 100644 +--- a/conformance/BUILD ++++ b/conformance/BUILD +@@ -31,7 +31,7 @@ cc_binary( + name = "server", + testonly = 1, + srcs = ["server.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//base:statusor", + "//eval/eval:container_backed_list_impl", +diff --git a/eval/compiler/BUILD b/eval/compiler/BUILD +index 93eaf84..456eb73 100644 +--- a/eval/compiler/BUILD ++++ b/eval/compiler/BUILD +@@ -14,7 +14,7 @@ cc_library( + hdrs = [ + "flat_expr_builder.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":constant_folding", + "//base:status_macros", +@@ -45,7 +45,7 @@ cc_test( + srcs = [ + "flat_expr_builder_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":flat_expr_builder", + "//base:status_macros", +@@ -71,7 +71,7 @@ cc_test( + srcs = [ + "flat_expr_builder_comprehensions_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":flat_expr_builder", + "//base:status_macros", +@@ -100,7 +100,7 @@ cc_library( + hdrs = [ + "constant_folding.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//eval/eval:const_value_step", + "//eval/eval:container_backed_list_impl", +@@ -119,7 +119,7 @@ cc_test( + srcs = [ + "constant_folding_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":constant_folding", + "//base:status_macros", +diff --git a/eval/eval/BUILD b/eval/eval/BUILD +index 36df103..537f82a 100644 +--- a/eval/eval/BUILD ++++ b/eval/eval/BUILD +@@ -14,7 +14,7 @@ cc_library( + hdrs = [ + "evaluator_core.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":attribute_trail", + ":unknowns_utility", +@@ -37,7 +37,7 @@ cc_library( + hdrs = [ + "expression_step_base.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + "//eval/public:activation", +@@ -57,7 +57,7 @@ cc_library( + hdrs = [ + "const_value_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":expression_step_base", +@@ -78,7 +78,7 @@ cc_library( + hdrs = [ + "container_access_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":expression_step_base", +@@ -99,7 +99,7 @@ cc_library( + hdrs = [ + "ident_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":expression_step_base", +@@ -119,7 +119,7 @@ cc_library( + hdrs = [ + "function_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":attribute_trail", + ":evaluator_core", +@@ -149,7 +149,7 @@ cc_library( + hdrs = [ + "field_access.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//eval/public:cel_value", + "//internal:proto_util", +@@ -166,7 +166,7 @@ cc_library( + hdrs = [ + "container_backed_list_impl.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//eval/public:cel_value", + "@com_google_absl//absl/strings", +@@ -182,7 +182,7 @@ cc_library( + hdrs = [ + "container_backed_map_impl.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//eval/public:cel_value", + "@com_google_absl//absl/container:node_hash_map", +@@ -198,7 +198,7 @@ cc_library( + hdrs = [ + "field_backed_list_impl.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":field_access", + "//eval/public:cel_value", +@@ -214,7 +214,7 @@ cc_library( + hdrs = [ + "field_backed_map_impl.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":field_access", + "//eval/public:cel_value", +@@ -231,7 +231,7 @@ cc_library( + hdrs = [ + "select_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":expression_step_base", +@@ -252,7 +252,7 @@ cc_library( + hdrs = [ + "create_list_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":container_backed_list_impl", + ":evaluator_core", +@@ -273,7 +273,7 @@ cc_library( + hdrs = [ + "create_struct_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":container_backed_map_impl", + ":evaluator_core", +@@ -294,7 +294,7 @@ cc_library( + hdrs = [ + "jump_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":expression_step_base", +@@ -313,7 +313,7 @@ cc_library( + hdrs = [ + "logic_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":expression_step_base", +@@ -334,7 +334,7 @@ cc_library( + hdrs = [ + "comprehension_step.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":expression_step_base", +@@ -353,7 +353,7 @@ cc_test( + srcs = [ + "evaluator_core_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + "//base:status_macros", +@@ -372,7 +372,7 @@ cc_test( + srcs = [ + "const_value_step_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":const_value_step", + ":evaluator_core", +@@ -388,7 +388,7 @@ cc_test( + srcs = [ + "container_access_step_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":container_access_step", + ":container_backed_list_impl", +@@ -409,7 +409,7 @@ cc_test( + srcs = [ + "ident_step_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":ident_step", +@@ -425,7 +425,7 @@ cc_test( + srcs = [ + "function_step_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":expression_build_warning", +@@ -451,7 +451,7 @@ cc_test( + srcs = [ + "container_backed_map_impl_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":container_backed_map_impl", + "//eval/public:cel_value", +@@ -466,7 +466,7 @@ cc_test( + srcs = [ + "field_backed_list_impl_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":field_backed_list_impl", +@@ -482,7 +482,7 @@ cc_test( + srcs = [ + "field_backed_map_impl_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":evaluator_core", + ":field_backed_map_impl", +@@ -498,7 +498,7 @@ cc_test( + srcs = [ + "logic_step_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":ident_step", + ":logic_step", +@@ -515,7 +515,7 @@ cc_test( + srcs = [ + "select_step_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":container_backed_map_impl", + ":ident_step", +@@ -536,7 +536,7 @@ cc_test( + srcs = [ + "create_list_step_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":const_value_step", + ":create_list_step", +@@ -556,7 +556,7 @@ cc_test( + srcs = [ + "create_struct_step_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":container_backed_list_impl", + ":container_backed_map_impl", +@@ -579,7 +579,7 @@ cc_library( + hdrs = [ + "expression_build_warning.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_google_absl//absl/status", + ], +@@ -591,7 +591,7 @@ cc_test( + srcs = [ + "expression_build_warning_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":expression_build_warning", + "@com_github_google_googletest//:gtest_main", +@@ -603,7 +603,7 @@ cc_library( + name = "attribute_trail", + srcs = ["attribute_trail.cc"], + hdrs = ["attribute_trail.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//base:statusor", + "//eval/public:activation", +@@ -624,7 +624,7 @@ cc_test( + srcs = [ + "attribute_trail_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":attribute_trail", + "//eval/public:cel_attribute", +@@ -638,7 +638,7 @@ cc_library( + name = "unknowns_utility", + srcs = ["unknowns_utility.cc"], + hdrs = ["unknowns_utility.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":attribute_trail", + "//base:statusor", +@@ -661,7 +661,7 @@ cc_test( + srcs = [ + "unknowns_utility_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":unknowns_utility", + "//eval/public:cel_attribute", +diff --git a/eval/public/BUILD b/eval/public/BUILD +index 54ccfb5..266f49e 100644 +--- a/eval/public/BUILD ++++ b/eval/public/BUILD +@@ -9,7 +9,7 @@ cc_library( + hdrs = [ + "cel_value_internal.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_google_absl//absl/types:variant", + ], +@@ -23,7 +23,7 @@ cc_library( + hdrs = [ + "cel_value.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_value_internal", + "//base:statusor", +@@ -44,7 +44,7 @@ cc_library( + hdrs = [ + "cel_attribute.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_value", + ":cel_value_internal", +@@ -61,7 +61,7 @@ cc_library( + hdrs = [ + "cel_value_producer.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_value", + "@com_google_absl//absl/strings", +@@ -75,7 +75,7 @@ cc_library( + hdrs = [ + "unknown_attribute_set.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_attribute", + "@com_google_absl//absl/container:flat_hash_set", +@@ -90,7 +90,7 @@ cc_library( + hdrs = [ + "activation.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_attribute", + ":cel_function", +@@ -111,7 +111,7 @@ cc_library( + hdrs = [ + "activation_bind_helper.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":activation", + "//eval/eval:field_access", +@@ -129,7 +129,7 @@ cc_library( + hdrs = [ + "cel_function.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_value", + "@com_google_absl//absl/types:span", +@@ -144,7 +144,7 @@ cc_library( + hdrs = [ + "cel_function_adapter.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_function", + ":cel_function_registry", +@@ -163,7 +163,7 @@ cc_library( + hdrs = [ + "cel_function_provider.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":activation", + ":cel_function", +@@ -175,7 +175,7 @@ cc_library( + hdrs = [ + "cel_builtins.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ], + ) +@@ -188,7 +188,7 @@ cc_library( + hdrs = [ + "builtin_func_registrar.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_builtins", + ":cel_function", +@@ -211,7 +211,7 @@ cc_library( + hdrs = [ + "extension_func_registrar.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_function", + ":cel_function_adapter", +@@ -227,7 +227,7 @@ cc_library( + hdrs = [ + "cel_expression.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":activation", + ":cel_function", +@@ -242,7 +242,7 @@ cc_library( + name = "source_position", + srcs = ["source_position.cc"], + hdrs = ["source_position.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_google_googleapis//google/api/expr/v1alpha1:syntax_cc_proto", + "@com_google_protobuf//:protobuf_lite", +@@ -254,7 +254,7 @@ cc_library( + hdrs = [ + "ast_visitor.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":source_position", + "@com_google_absl//absl/strings", +@@ -267,7 +267,7 @@ cc_library( + hdrs = [ + "ast_visitor_base.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":ast_visitor", + "@com_google_googleapis//google/api/expr/v1alpha1:syntax_cc_proto", +@@ -282,7 +282,7 @@ cc_library( + hdrs = [ + "ast_traverse.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":ast_visitor", + ":source_position", +@@ -296,7 +296,7 @@ cc_library( + hdrs = [ + "cel_options.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_google_protobuf//:protobuf", + ], +@@ -310,7 +310,7 @@ cc_library( + hdrs = [ + "cel_expr_builder_factory.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_expression", + ":cel_options", +@@ -326,7 +326,7 @@ cc_library( + hdrs = [ + "value_export_util.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_value", + "@com_google_absl//absl/status", +@@ -339,7 +339,7 @@ cc_library( + name = "cel_function_registry", + srcs = ["cel_function_registry.cc"], + hdrs = ["cel_function_registry.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_function", + ":cel_function_provider", +@@ -356,7 +356,7 @@ cc_test( + srcs = [ + "cel_value_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_value", + ":unknown_attribute_set", +@@ -374,7 +374,7 @@ cc_test( + srcs = [ + "cel_attribute_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_attribute", + ":cel_value", +@@ -390,7 +390,7 @@ cc_test( + srcs = [ + "activation_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":activation", + ":cel_function", +@@ -404,7 +404,7 @@ cc_test( + srcs = [ + "ast_traverse_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":ast_traverse", + "@com_github_google_googletest//:gtest_main", +@@ -417,7 +417,7 @@ cc_test( + srcs = [ + "activation_bind_helper_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":activation", + ":activation_bind_helper", +@@ -434,7 +434,7 @@ cc_test( + srcs = [ + "cel_function_provider_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_function", + ":cel_function_provider", +@@ -448,7 +448,7 @@ cc_test( + srcs = [ + "cel_function_registry_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_function", + ":cel_function_provider", +@@ -464,7 +464,7 @@ cc_test( + srcs = [ + "cel_function_adapter_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_function", + ":cel_function_adapter", +@@ -480,7 +480,7 @@ cc_test( + srcs = [ + "builtin_func_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":activation", + ":builtin_func_registrar", +@@ -501,7 +501,7 @@ cc_test( + srcs = [ + "extension_func_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":builtin_func_registrar", + ":cel_function_registry", +@@ -520,7 +520,7 @@ cc_test( + srcs = [ + "source_position_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":source_position", + "@com_github_google_googletest//:gtest_main", +@@ -534,7 +534,7 @@ cc_test( + srcs = [ + "unknown_attribute_set_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_attribute", + ":cel_value", +@@ -549,7 +549,7 @@ cc_test( + srcs = [ + "value_export_util_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_value", + ":value_export_util", +@@ -568,7 +568,7 @@ cc_library( + name = "unknown_function_result_set", + srcs = ["unknown_function_result_set.cc"], + hdrs = ["unknown_function_result_set.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_function", + ":cel_options", +@@ -585,7 +585,7 @@ cc_test( + srcs = [ + "unknown_function_result_set_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_function", + ":cel_value", +@@ -602,7 +602,7 @@ cc_test( + cc_library( + name = "unknown_set", + hdrs = ["unknown_set.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":unknown_attribute_set", + ":unknown_function_result_set", +@@ -612,7 +612,7 @@ cc_library( + cc_test( + name = "unknown_set_test", + srcs = ["unknown_set_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_attribute", + ":unknown_attribute_set", +@@ -628,7 +628,7 @@ cc_library( + name = "set_util", + srcs = ["set_util.cc"], + hdrs = ["set_util.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = ["//eval/public:cel_value"], + ) + +@@ -638,7 +638,7 @@ cc_test( + srcs = [ + "set_util_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_value", + ":set_util", +diff --git a/eval/tests/BUILD b/eval/tests/BUILD +index ce8a808..ab52c89 100644 +--- a/eval/tests/BUILD ++++ b/eval/tests/BUILD +@@ -14,7 +14,7 @@ cc_test( + srcs = [ + "benchmark_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + tags = ["manual"], + deps = [ + ":request_context_cc_proto", +@@ -39,7 +39,7 @@ cc_test( + srcs = [ + "end_to_end_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//base:status_macros", + "//eval/public:activation", +@@ -60,7 +60,7 @@ cc_test( + srcs = [ + "unknowns_end_to_end_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//base:status_macros", + "//eval/public:activation", +@@ -94,7 +94,7 @@ cc_library( + name = "mock_cel_expression", + testonly = 1, + hdrs = ["mock_cel_expression.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//eval/public:activation", + "//eval/public:cel_expression", +diff --git a/internal/BUILD b/internal/BUILD +index c6d2c7f..05e29f6 100644 +--- a/internal/BUILD ++++ b/internal/BUILD +@@ -13,7 +13,7 @@ cc_library( + hdrs = [ + "ref_countable.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":holder", + ":specialize", +@@ -23,7 +23,7 @@ cc_library( + cc_test( + name = "ref_countable_test", + srcs = ["ref_countable_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":ref_countable", + "//testutil:util", +@@ -37,7 +37,7 @@ cc_library( + hdrs = [ + "handle.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":hash_util", + ":specialize", +@@ -47,7 +47,7 @@ cc_library( + cc_test( + name = "handle_test", + srcs = ["handle_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":handle", + "@com_github_google_googletest//:gtest_main", +@@ -60,7 +60,7 @@ cc_library( + hdrs = [ + "holder.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":port", + ":specialize", +@@ -72,7 +72,7 @@ cc_library( + cc_test( + name = "holder_test", + srcs = ["holder_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":holder", + ":types", +@@ -90,7 +90,7 @@ cc_library( + hdrs = [ + "hash_util.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":port", + ":specialize", +@@ -107,7 +107,7 @@ cc_library( + hdrs = [ + "status_util.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_google_absl//absl/strings", + "@com_google_googleapis//google/rpc:code_cc_proto", +@@ -120,7 +120,7 @@ cc_library( + hdrs = [ + "visitor_util.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":specialize", + ":types", +@@ -133,7 +133,7 @@ cc_library( + cc_test( + name = "visitor_util_test", + srcs = ["visitor_util_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":adapter_util", + ":visitor_util", +@@ -149,7 +149,7 @@ cc_library( + hdrs = [ + "adapter_util.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":visitor_util", + ], +@@ -161,7 +161,7 @@ cc_library( + hdrs = [ + "cel_printer.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":specialize", + ":types", +@@ -175,7 +175,7 @@ cc_library( + cc_test( + name = "cel_printer_test", + srcs = ["cel_printer_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cel_printer", + "@com_github_google_googletest//:gtest_main", +@@ -186,7 +186,7 @@ cc_library( + name = "proto_util", + srcs = ["proto_util.cc"], + hdrs = ["proto_util.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":status_util", + "//common:macros", +@@ -202,7 +202,7 @@ cc_library( + name = "map_impl", + srcs = ["map_impl.cc"], + hdrs = ["map_impl.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":status_util", + "//common:macros", +@@ -214,7 +214,7 @@ cc_library( + cc_library( + name = "list_impl", + hdrs = ["list_impl.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":holder", + "//common:macros", +@@ -225,7 +225,7 @@ cc_library( + cc_library( + name = "value_internal", + hdrs = ["value_internal.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":adapter_util", + ":cast", +@@ -244,7 +244,7 @@ cc_library( + cc_test( + name = "value_internal_test", + srcs = ["value_internal_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":value_internal", + "//testutil:util", +@@ -257,19 +257,19 @@ cc_test( + cc_library( + name = "port", + hdrs = ["port.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + ) + + cc_library( + name = "specialize", + hdrs = ["specialize.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + ) + + cc_library( + name = "cast", + hdrs = ["cast.h"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":port", + ":specialize", +@@ -282,7 +282,7 @@ cc_library( + cc_test( + name = "cast_test", + srcs = ["cast_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":cast", + "@com_github_google_googletest//:gtest_main", +@@ -294,7 +294,7 @@ cc_library( + hdrs = [ + "types.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":port", + ":specialize", +@@ -306,7 +306,7 @@ cc_library( + cc_test( + name = "types_test", + srcs = ["types_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":types", + "@com_github_google_googletest//:gtest_main", +diff --git a/parser/BUILD b/parser/BUILD +index c8516a8..dfd1593 100644 +--- a/parser/BUILD ++++ b/parser/BUILD +@@ -21,7 +21,7 @@ cc_library( + ], + copts = [ + "-fexceptions", +- "-std=c++14", ++ "-std=c++17", + ], + deps = [ + ":cel_cc_parser", +@@ -45,7 +45,7 @@ cc_library( + ], + copts = [ + "-fexceptions", +- "-std=c++14", ++ "-std=c++17", + ], + deps = [ + ":source_factory", +@@ -67,7 +67,7 @@ cc_library( + ], + copts = [ + "-fexceptions", +- "-std=c++14", ++ "-std=c++17", + ], + deps = [ + ":cel_cc_parser", +@@ -94,7 +94,7 @@ cc_library( + ], + copts = [ + "-fexceptions", +- "-std=c++14", ++ "-std=c++17", + ], + deps = [ + ":cel_cc_parser", +@@ -111,7 +111,7 @@ cc_library( + cc_test( + name = "parser_test", + srcs = ["parser_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":parser", + ":source_factory", +diff --git a/protoutil/BUILD b/protoutil/BUILD +index 0df1757..6993c8f 100644 +--- a/protoutil/BUILD ++++ b/protoutil/BUILD +@@ -13,7 +13,7 @@ cc_library( + hdrs = [ + "type_registry.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//common:macros", + "//common:parent_ref", +@@ -30,7 +30,7 @@ cc_library( + cc_test( + name = "type_registry_test", + srcs = ["type_registry_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":type_registry", + "//common:value", +@@ -50,7 +50,7 @@ cc_library( + hdrs = [ + "converters.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":type_registry", + "//common:macros", +@@ -73,7 +73,7 @@ cc_library( + cc_test( + name = "converters_test", + srcs = ["converters_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + data = [ + "@com_google_cel_spec//testdata", + ], +diff --git a/testutil/BUILD b/testutil/BUILD +index 0bf8e50..7305225 100644 +--- a/testutil/BUILD ++++ b/testutil/BUILD +@@ -15,7 +15,7 @@ cc_library( + hdrs = [ + "test_data_util.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//common:type", + "//common:value", +@@ -44,7 +44,7 @@ cc_library( + hdrs = [ + "test_data_io.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//internal:status_util", + "@com_github_google_googletest//:gtest_main", +@@ -69,7 +69,7 @@ cc_binary( + srcs = [ + "test_data_gen.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + ":test_data_io", + ":test_data_util", +@@ -87,7 +87,7 @@ cc_binary( + cc_test( + name = "test_data_test", + srcs = ["test_data_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + data = [ + "@com_google_cel_spec//testdata", + ], +@@ -105,7 +105,7 @@ cc_library( + hdrs = [ + "util.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "@com_github_google_googletest//:gtest_main", + "@com_google_protobuf//:protobuf", +diff --git a/tools/BUILD b/tools/BUILD +index 212207e..8a131bd 100644 +--- a/tools/BUILD ++++ b/tools/BUILD +@@ -17,7 +17,7 @@ cc_library( + hdrs = [ + "flatbuffers_backed_impl.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//eval/public:cel_value", + "@com_github_google_flatbuffers//:flatbuffers", +@@ -36,7 +36,7 @@ cc_library( + name = "flatbuffers_test_cc", + srcs = [":flatbuffers_test"], + hdrs = [":flatbuffers_test"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + features = ["-parse_headers"], + linkstatic = True, + deps = ["@com_github_google_flatbuffers//:runtime_cc"], +@@ -48,7 +48,7 @@ cc_test( + srcs = [ + "flatbuffers_backed_impl_test.cc", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + data = [ + ":flatbuffers_reflection_out", + ], +diff --git a/v1beta1/BUILD b/v1beta1/BUILD +index 41c64d6..2480b94 100644 +--- a/v1beta1/BUILD ++++ b/v1beta1/BUILD +@@ -15,7 +15,7 @@ cc_library( + hdrs = [ + "converters.h", + ], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + deps = [ + "//common:converters", + "//common:macros", +@@ -37,7 +37,7 @@ cc_library( + cc_test( + name = "converters_test", + srcs = ["converters_test.cc"], +- copts = ["-std=c++14"], ++ copts = ["-std=c++17"], + data = [ + "@com_google_cel_spec//testdata", + ], \ No newline at end of file diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 1603523e575c1..96afcfff68450 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -14,7 +14,7 @@ def envoy_copts(repository, test = False): "-Wformat", "-Wformat-security", "-Wvla", - "-std=c++14", + "-std=c++17", ] # Windows options for cleanest service compilation; @@ -25,7 +25,7 @@ def envoy_copts(repository, test = False): msvc_options = [ "-WX", "-Zc:__cplusplus", - "-std:c++14", + "-std:c++17", "-DWIN32", "-D_WIN32_WINNT=0x0A00", # _WIN32_WINNT_WIN10 "-DNTDDI_VERSION=0x0A000000", # NTDDI_WIN10 diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index baf22ea109dd2..d1580efb7bac1 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -371,7 +371,11 @@ def _net_zlib(): ) def _com_google_cel_cpp(): - _repository_impl("com_google_cel_cpp") + _repository_impl( + name = "com_google_cel_cpp", + patch_args = ["-p1"], + patches = ["@envoy//bazel:cel-cpp.patch"], + ) def _com_github_nghttp2_nghttp2(): location = _get_location("com_github_nghttp2_nghttp2") diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 7b1221ed82e0a..c82d4774348d0 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -224,6 +224,7 @@ elif [[ "$CI_TARGET" == "bazel.compile_time_options" ]]; then --define quiche=enabled \ --define path_normalization_by_default=true \ --define deprecated_features=disabled \ + --define --cxxopt=-std=c++14 \ " ENVOY_STDLIB="${ENVOY_STDLIB:-libstdc++}" setup_clang_toolchain diff --git a/source/common/grpc/google_async_client_impl.h b/source/common/grpc/google_async_client_impl.h index f2dc3eded14dc..75229bd5905fb 100644 --- a/source/common/grpc/google_async_client_impl.h +++ b/source/common/grpc/google_async_client_impl.h @@ -255,7 +255,7 @@ class GoogleAsyncStreamImpl : public RawAsyncStream, // End-of-stream with no additional message. PendingMessage() = default; - const absl::optional buf_; + const absl::optional buf_{}; const bool end_stream_{true}; }; diff --git a/source/common/upstream/outlier_detection_impl.h b/source/common/upstream/outlier_detection_impl.h index ff42473f3cc05..c51cb134bfbf9 100644 --- a/source/common/upstream/outlier_detection_impl.h +++ b/source/common/upstream/outlier_detection_impl.h @@ -41,7 +41,7 @@ class DetectorHostMonitorNullImpl : public DetectorHostMonitor { double successRate(SuccessRateMonitorType) const override { return -1; } private: - const absl::optional time_; + const absl::optional time_{}; }; /** diff --git a/source/extensions/common/aws/credentials_provider.h b/source/extensions/common/aws/credentials_provider.h index ed6bb312561cc..7e1da55fb1828 100644 --- a/source/extensions/common/aws/credentials_provider.h +++ b/source/extensions/common/aws/credentials_provider.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include "envoy/common/pure.h" diff --git a/source/extensions/filters/http/grpc_http1_reverse_bridge/filter.cc b/source/extensions/filters/http/grpc_http1_reverse_bridge/filter.cc index 955bf64168298..0705ccc621f37 100644 --- a/source/extensions/filters/http/grpc_http1_reverse_bridge/filter.cc +++ b/source/extensions/filters/http/grpc_http1_reverse_bridge/filter.cc @@ -137,7 +137,7 @@ Http::FilterHeadersStatus Filter::encodeHeaders(Http::ResponseHeaderMap& headers headers.setGrpcStatus(Envoy::Grpc::Status::WellKnownGrpcStatus::Unknown); headers.setStatus(enumToInt(Http::Code::OK)); - if (content_type != nullptr) { + if (content_type.size()) { headers.setContentType(content_type_); } diff --git a/tools/type_whisperer/api_type_db.h b/tools/type_whisperer/api_type_db.h index d5ee2dc7a3241..cec5627588ea3 100644 --- a/tools/type_whisperer/api_type_db.h +++ b/tools/type_whisperer/api_type_db.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include "absl/strings/string_view.h" From b8462a2be2aebb86960653ba21ee4100506baa0a Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 12 Jun 2020 17:24:51 +0000 Subject: [PATCH 02/34] Subject: fixing the CI builds Signed-off-by: Yifan Yang --- source/extensions/filters/http/cache/http_cache_utils.cc | 2 +- .../extensions/filters/http/grpc_http1_reverse_bridge/filter.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/extensions/filters/http/cache/http_cache_utils.cc b/source/extensions/filters/http/cache/http_cache_utils.cc index 43dd624d8563f..b93ed5f2f3a77 100644 --- a/source/extensions/filters/http/cache/http_cache_utils.cc +++ b/source/extensions/filters/http/cache/http_cache_utils.cc @@ -89,7 +89,7 @@ SystemTime::duration HttpCacheUtils::eatLeadingDuration(absl::string_view& s) { if (digits_length == 0) { return SystemTime::duration::zero(); } - const absl::string_view digits(s.begin(), digits_length); + const absl::string_view digits(s.data(), digits_length); s.remove_prefix(digits_length); uint64_t num; return absl::SimpleAtoi(digits, &num) ? std::chrono::seconds(num) : SystemTime::duration::max(); diff --git a/source/extensions/filters/http/grpc_http1_reverse_bridge/filter.cc b/source/extensions/filters/http/grpc_http1_reverse_bridge/filter.cc index 0705ccc621f37..faa6ae4650c68 100644 --- a/source/extensions/filters/http/grpc_http1_reverse_bridge/filter.cc +++ b/source/extensions/filters/http/grpc_http1_reverse_bridge/filter.cc @@ -137,7 +137,7 @@ Http::FilterHeadersStatus Filter::encodeHeaders(Http::ResponseHeaderMap& headers headers.setGrpcStatus(Envoy::Grpc::Status::WellKnownGrpcStatus::Unknown); headers.setStatus(enumToInt(Http::Code::OK)); - if (content_type.size()) { + if (!content_type.empty()) { headers.setContentType(content_type_); } From b38c8d94fd0137586964438c9c54f7eddd89c2f8 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Mon, 15 Jun 2020 15:27:54 +0000 Subject: [PATCH 03/34] fix of a bug (loss of precision when doing implicit conversion) Signed-off-by: Yifan Yang --- source/common/formatter/substitution_formatter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/formatter/substitution_formatter.cc b/source/common/formatter/substitution_formatter.cc index 4400ca3f65100..aedc72ad87e17 100644 --- a/source/common/formatter/substitution_formatter.cc +++ b/source/common/formatter/substitution_formatter.cc @@ -424,7 +424,7 @@ class StreamInfoDurationFieldExtractor : public StreamInfoFormatter::FieldExtrac } private: - absl::optional extractMillis(const StreamInfo::StreamInfo& stream_info) const { + absl::optional extractMillis(const StreamInfo::StreamInfo& stream_info) const { const auto time = field_extractor_(stream_info); if (time) { return std::chrono::duration_cast(time.value()).count(); From 1b352382fb0fa7da922491ba5600a7ef9b80a1d3 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Mon, 15 Jun 2020 19:45:56 +0000 Subject: [PATCH 04/34] added compiler flag to silence incorrect MSVC warning Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 96afcfff68450..a52a7c43f9516 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -34,6 +34,9 @@ def envoy_copts(repository, test = False): "-DNOMCX", "-DNOIME", "-DNOCRYPT", + # this is to silence the incorrect MSVC compiler warning when trying to convert between + # std::optional data types while conversions between primitive types are producing no error + "-wd4244", ] return select({ From 93991ef67a1a9fa88b3247ed3f63d509ee339a47 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Mon, 22 Jun 2020 17:27:31 +0000 Subject: [PATCH 05/34] trying to see if adding external dep in build solves linker issue Signed-off-by: Yifan Yang --- source/common/router/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/source/common/router/BUILD b/source/common/router/BUILD index 610cb0f10d75f..092926f99c0a0 100644 --- a/source/common/router/BUILD +++ b/source/common/router/BUILD @@ -347,6 +347,7 @@ envoy_cc_library( name = "header_parser_lib", srcs = ["header_parser.cc"], hdrs = ["header_parser.h"], + external_deps = ["abseil_optional"], deps = [ ":header_formatter_lib", "//include/envoy/http:header_map_interface", From 27075473527b43472da95a90fc111dfca3d7d638 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Mon, 22 Jun 2020 21:00:35 +0000 Subject: [PATCH 06/34] another attempt to fix msvc linkage problems Signed-off-by: Yifan Yang --- source/common/router/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/router/BUILD b/source/common/router/BUILD index 092926f99c0a0..a413798fa4ebc 100644 --- a/source/common/router/BUILD +++ b/source/common/router/BUILD @@ -347,7 +347,7 @@ envoy_cc_library( name = "header_parser_lib", srcs = ["header_parser.cc"], hdrs = ["header_parser.h"], - external_deps = ["abseil_optional"], + external_deps = ["abseil_str_format"], deps = [ ":header_formatter_lib", "//include/envoy/http:header_map_interface", From 09d2ed696902d60abd781092fb175937af05c219 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Tue, 23 Jun 2020 15:01:35 +0000 Subject: [PATCH 07/34] trying one last time Signed-off-by: Yifan Yang --- source/common/router/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common/router/BUILD b/source/common/router/BUILD index a413798fa4ebc..bb2973290ae28 100644 --- a/source/common/router/BUILD +++ b/source/common/router/BUILD @@ -347,7 +347,7 @@ envoy_cc_library( name = "header_parser_lib", srcs = ["header_parser.cc"], hdrs = ["header_parser.h"], - external_deps = ["abseil_str_format"], + external_deps = ["abseil_any"], deps = [ ":header_formatter_lib", "//include/envoy/http:header_map_interface", From 07a5d4498bf6a9e154d157e0172e1ee7f6aa6c50 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 26 Jun 2020 17:30:33 +0000 Subject: [PATCH 08/34] fixing the windows ci and get rid of the warnings Signed-off-by: Yifan Yang --- .bazelrc | 14 +++++++++++++- source/common/common/assert.cc | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 544fdd933a449..5640dc780a3f6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,10 +19,10 @@ build --action_env=BAZEL_LINKOPTS=-lm build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11 build --javabase=@bazel_tools//tools/jdk:remote_jdk11 build --enable_platform_specific_config -build --cxxopt=-std=c++17 # Enable position independent code, this option is not supported on Windows and default on on macOS. build:linux --copt=-fPIC +build:linux --cxxopt=-std=c++17 # We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace. build --define absl=1 @@ -38,10 +38,12 @@ build:sanitizer --define tcmalloc=disabled build:sanitizer --linkopt -ldl build:sanitizer --build_tag_filters=-no_san build:sanitizer --test_tag_filters=-no_san +build:sanitizer --cxxopt=-std=c++17 # Common flags for Clang build:clang --action_env=BAZEL_COMPILER=clang build:clang --linkopt=-fuse-ld=lld +build:clang --cxxopt=-std=c++17 # Basic ASAN/UBSAN that works for gcc build:asan --action_env=ENVOY_ASAN=1 @@ -60,6 +62,7 @@ build:asan --copt -D__SANITIZE_ADDRESS__ build:asan --test_env=ASAN_OPTIONS=handle_abort=1:allow_addr2line=true:check_initialization_order=true:strict_init_order=true:detect_odr_violation=1 build:asan --test_env=UBSAN_OPTIONS=halt_on_error=true:print_stacktrace=1 build:asan --test_env=ASAN_SYMBOLIZER_PATH +build:asan --cxxopt=-std=c++17 # Clang ASAN/UBSAN build:clang-asan --config=asan @@ -139,6 +142,7 @@ coverage:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper. build:rbe-toolchain --host_platform=@envoy_build_tools//toolchains:rbe_ubuntu_clang_platform build:rbe-toolchain --platforms=@envoy_build_tools//toolchains:rbe_ubuntu_clang_platform build:rbe-toolchain --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 +build:rbe-toolchain --cxxopt=-std=c++17 build:rbe-toolchain-clang --config=rbe-toolchain build:rbe-toolchain-clang --crosstool_top=@rbe_ubuntu_clang//cc:toolchain @@ -192,6 +196,8 @@ build:docker-sandbox --strategy=Genrule=docker build:docker-sandbox --define=EXECUTOR=remote build:docker-sandbox --experimental_docker_verbose build:docker-sandbox --experimental_enable_docker_sandbox +build:docker-sandbox --cxxopt=-std=c++17 + build:docker-clang --config=docker-sandbox build:docker-clang --config=rbe-toolchain-clang @@ -209,6 +215,7 @@ build:docker-msan --config=rbe-toolchain-msan # CI configurations build:remote-ci --remote_cache=grpcs://remotebuildexecution.googleapis.com build:remote-ci --remote_executor=grpcs://remotebuildexecution.googleapis.com +build:remote-ci --cxxopt=-std=c++17 # Fuzz builds build:asan-fuzzer --config=clang-asan @@ -223,6 +230,7 @@ build:asan-fuzzer --test_env=UBSAN_OPTIONS=print_stacktrace=1 build:plain-fuzzer --define=FUZZING_ENGINE=libfuzzer build:plain-fuzzer --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION build:plain-fuzzer --copt=-fsanitize=fuzzer-no-link +build:plain-fuzzer --cxxopt=-std=c++17 # Compile database generation config # We don't care about built binaries so always strip and use fastbuild. @@ -230,6 +238,7 @@ build:compdb -c fastbuild build:compdb --strip=always build:compdb --build_tag_filters=-nocompdb build:compdb --define=ENVOY_CONFIG_COMPILATION_DATABASE=1 +build:compdb --cxxopt=-std=c++17 # Windows build quirks build:windows --action_env=TMPDIR @@ -244,6 +253,7 @@ build:windows --define manual_stamp=manual_stamp build:windows --copt="-DCARES_STATICLIB" build:windows --copt="-DNGHTTP2_STATICLIB" build:windows --copt="-DCURL_STATICLIB" +build:windows --cxxopt="/std:c++17" # Required to work around build defects on Windows MSVC cl # Unguarded gcc pragmas in quiche are not recognized by MSVC @@ -252,6 +262,7 @@ build:msvc-cl --copt="/wd4068" build:msvc-cl --copt="/wd4834" # Allows inline functions to be undefined build:msvc-cl --copt="/wd4506" +build:msvc-cl --cxxopt="/std:c++17" build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING" # Required to work around Windows clang-cl build defects @@ -260,6 +271,7 @@ build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING" build:clang-cl --copt="-Wno-macro-redefined" build:clang-cl --copt="-Wno-builtin-macro-redefined" build:clang-cl --action_env=USE_CLANG_CL=1 +build:clang-cl--cxxopt="/std:c++17" # Defaults to 'auto' - Off for windows, so override to linux behavior build:windows --enable_runfiles=yes diff --git a/source/common/common/assert.cc b/source/common/common/assert.cc index ab4b1b8776a43..5299a700c3629 100644 --- a/source/common/common/assert.cc +++ b/source/common/common/assert.cc @@ -35,6 +35,9 @@ ActionRegistrationPtr setDebugAssertionFailureRecordAction(const std::function test_pair = {5, 3}; + auto& [key, val] = test_pair; + key = key + val; ActionRegistrationImpl::invokeAction(); } From f4773180655858015ac0d9da9d2bb775ccfa95c9 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 26 Jun 2020 18:11:54 +0000 Subject: [PATCH 09/34] api builds fix Signed-off-by: Yifan Yang --- .bazelrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bazelrc b/.bazelrc index 5640dc780a3f6..45826467be4ab 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,6 +19,7 @@ build --action_env=BAZEL_LINKOPTS=-lm build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11 build --javabase=@bazel_tools//tools/jdk:remote_jdk11 build --enable_platform_specific_config +build --cxxopt=-std=c++17 # Enable position independent code, this option is not supported on Windows and default on on macOS. build:linux --copt=-fPIC @@ -108,8 +109,11 @@ build:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++ build:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a:-lm build:libc++ --define force_libcpp=enabled + # Optimize build for binary size reduction. build:sizeopt -c opt --copt -Os +build:sizeopt --cxxopt=-std=c++17 + # Test options build --test_env=HEAPCHECK=normal --test_env=PPROF_PATH From 807d4c33814127ffe4d6bcf2f0c92bf5834197ae Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 26 Jun 2020 18:33:03 +0000 Subject: [PATCH 10/34] trying to fix api ci Signed-off-by: Yifan Yang --- .bazelrc | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.bazelrc b/.bazelrc index 45826467be4ab..ee9ca18606c61 100644 --- a/.bazelrc +++ b/.bazelrc @@ -23,7 +23,6 @@ build --cxxopt=-std=c++17 # Enable position independent code, this option is not supported on Windows and default on on macOS. build:linux --copt=-fPIC -build:linux --cxxopt=-std=c++17 # We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace. build --define absl=1 @@ -39,12 +38,10 @@ build:sanitizer --define tcmalloc=disabled build:sanitizer --linkopt -ldl build:sanitizer --build_tag_filters=-no_san build:sanitizer --test_tag_filters=-no_san -build:sanitizer --cxxopt=-std=c++17 # Common flags for Clang build:clang --action_env=BAZEL_COMPILER=clang build:clang --linkopt=-fuse-ld=lld -build:clang --cxxopt=-std=c++17 # Basic ASAN/UBSAN that works for gcc build:asan --action_env=ENVOY_ASAN=1 @@ -63,7 +60,6 @@ build:asan --copt -D__SANITIZE_ADDRESS__ build:asan --test_env=ASAN_OPTIONS=handle_abort=1:allow_addr2line=true:check_initialization_order=true:strict_init_order=true:detect_odr_violation=1 build:asan --test_env=UBSAN_OPTIONS=halt_on_error=true:print_stacktrace=1 build:asan --test_env=ASAN_SYMBOLIZER_PATH -build:asan --cxxopt=-std=c++17 # Clang ASAN/UBSAN build:clang-asan --config=asan @@ -112,7 +108,6 @@ build:libc++ --define force_libcpp=enabled # Optimize build for binary size reduction. build:sizeopt -c opt --copt -Os -build:sizeopt --cxxopt=-std=c++17 # Test options @@ -146,7 +141,6 @@ coverage:fuzz-coverage --run_under=@envoy//bazel/coverage:fuzz_coverage_wrapper. build:rbe-toolchain --host_platform=@envoy_build_tools//toolchains:rbe_ubuntu_clang_platform build:rbe-toolchain --platforms=@envoy_build_tools//toolchains:rbe_ubuntu_clang_platform build:rbe-toolchain --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 -build:rbe-toolchain --cxxopt=-std=c++17 build:rbe-toolchain-clang --config=rbe-toolchain build:rbe-toolchain-clang --crosstool_top=@rbe_ubuntu_clang//cc:toolchain @@ -200,7 +194,6 @@ build:docker-sandbox --strategy=Genrule=docker build:docker-sandbox --define=EXECUTOR=remote build:docker-sandbox --experimental_docker_verbose build:docker-sandbox --experimental_enable_docker_sandbox -build:docker-sandbox --cxxopt=-std=c++17 build:docker-clang --config=docker-sandbox @@ -219,7 +212,6 @@ build:docker-msan --config=rbe-toolchain-msan # CI configurations build:remote-ci --remote_cache=grpcs://remotebuildexecution.googleapis.com build:remote-ci --remote_executor=grpcs://remotebuildexecution.googleapis.com -build:remote-ci --cxxopt=-std=c++17 # Fuzz builds build:asan-fuzzer --config=clang-asan @@ -234,7 +226,6 @@ build:asan-fuzzer --test_env=UBSAN_OPTIONS=print_stacktrace=1 build:plain-fuzzer --define=FUZZING_ENGINE=libfuzzer build:plain-fuzzer --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION build:plain-fuzzer --copt=-fsanitize=fuzzer-no-link -build:plain-fuzzer --cxxopt=-std=c++17 # Compile database generation config # We don't care about built binaries so always strip and use fastbuild. @@ -242,7 +233,6 @@ build:compdb -c fastbuild build:compdb --strip=always build:compdb --build_tag_filters=-nocompdb build:compdb --define=ENVOY_CONFIG_COMPILATION_DATABASE=1 -build:compdb --cxxopt=-std=c++17 # Windows build quirks build:windows --action_env=TMPDIR @@ -275,7 +265,6 @@ build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING" build:clang-cl --copt="-Wno-macro-redefined" build:clang-cl --copt="-Wno-builtin-macro-redefined" build:clang-cl --action_env=USE_CLANG_CL=1 -build:clang-cl--cxxopt="/std:c++17" # Defaults to 'auto' - Off for windows, so override to linux behavior build:windows --enable_runfiles=yes From f7726fdc75cb4155c9bed9bed7c36e4754e9b7fe Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 26 Jun 2020 19:02:01 +0000 Subject: [PATCH 11/34] does this fix ci problem Signed-off-by: Yifan Yang --- .bazelrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index ee9ca18606c61..79645af1203f8 100644 --- a/.bazelrc +++ b/.bazelrc @@ -256,7 +256,6 @@ build:msvc-cl --copt="/wd4068" build:msvc-cl --copt="/wd4834" # Allows inline functions to be undefined build:msvc-cl --copt="/wd4506" -build:msvc-cl --cxxopt="/std:c++17" build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING" # Required to work around Windows clang-cl build defects From 713e3063b4818c955355c19cf5e96ae2682a7a7d Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Mon, 29 Jun 2020 16:07:39 +0000 Subject: [PATCH 12/34] get rid of the separate c++14 flag added to clang_tools.bzl Signed-off-by: Yifan Yang --- tools/clang_tools/support/clang_tools.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/clang_tools/support/clang_tools.bzl b/tools/clang_tools/support/clang_tools.bzl index 949903aaff055..398b80330b663 100644 --- a/tools/clang_tools/support/clang_tools.bzl +++ b/tools/clang_tools/support/clang_tools.bzl @@ -1,7 +1,6 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") _clang_tools_copts = [ - "-std=c++14", "-fno-exceptions", "-fno-rtti", ] From da4c5cc7a2988ac66b103e8981af0b080c5879fa Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Tue, 30 Jun 2020 14:29:06 +0000 Subject: [PATCH 13/34] getting rid of unnecessary c++ flag Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 2 -- 1 file changed, 2 deletions(-) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index a52a7c43f9516..2f892ae74bb5f 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -14,7 +14,6 @@ def envoy_copts(repository, test = False): "-Wformat", "-Wformat-security", "-Wvla", - "-std=c++17", ] # Windows options for cleanest service compilation; @@ -25,7 +24,6 @@ def envoy_copts(repository, test = False): msvc_options = [ "-WX", "-Zc:__cplusplus", - "-std:c++17", "-DWIN32", "-D_WIN32_WINNT=0x0A00", # _WIN32_WINNT_WIN10 "-DNTDDI_VERSION=0x0A000000", # NTDDI_WIN10 From c9c2799f06b101be49a1bd72aa109f0efdc6dc06 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Tue, 30 Jun 2020 15:05:54 +0000 Subject: [PATCH 14/34] getting rid of unnecessary c++ flag Signed-off-by: Yifan Yang --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 79645af1203f8..fdc2025937435 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,10 +19,10 @@ build --action_env=BAZEL_LINKOPTS=-lm build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11 build --javabase=@bazel_tools//tools/jdk:remote_jdk11 build --enable_platform_specific_config -build --cxxopt=-std=c++17 # Enable position independent code, this option is not supported on Windows and default on on macOS. build:linux --copt=-fPIC +build:linux --cxxopt=-std=c++17 # We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace. build --define absl=1 From 6a7a254c15faeb248c7e5d7ae7e6682251d12734 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Wed, 1 Jul 2020 16:00:25 +0000 Subject: [PATCH 15/34] getting ready for submission Signed-off-by: Yifan Yang --- .bazelrc | 3 --- source/common/common/assert.cc | 3 --- source/common/router/BUILD | 1 - 3 files changed, 7 deletions(-) diff --git a/.bazelrc b/.bazelrc index fdc2025937435..1f695bb4a7544 100644 --- a/.bazelrc +++ b/.bazelrc @@ -105,11 +105,9 @@ build:libc++ --action_env=BAZEL_CXXOPTS=-stdlib=libc++ build:libc++ --action_env=BAZEL_LINKLIBS=-l%:libc++.a:-l%:libc++abi.a:-lm build:libc++ --define force_libcpp=enabled - # Optimize build for binary size reduction. build:sizeopt -c opt --copt -Os - # Test options build --test_env=HEAPCHECK=normal --test_env=PPROF_PATH @@ -195,7 +193,6 @@ build:docker-sandbox --define=EXECUTOR=remote build:docker-sandbox --experimental_docker_verbose build:docker-sandbox --experimental_enable_docker_sandbox - build:docker-clang --config=docker-sandbox build:docker-clang --config=rbe-toolchain-clang diff --git a/source/common/common/assert.cc b/source/common/common/assert.cc index 5299a700c3629..ab4b1b8776a43 100644 --- a/source/common/common/assert.cc +++ b/source/common/common/assert.cc @@ -35,9 +35,6 @@ ActionRegistrationPtr setDebugAssertionFailureRecordAction(const std::function test_pair = {5, 3}; - auto& [key, val] = test_pair; - key = key + val; ActionRegistrationImpl::invokeAction(); } diff --git a/source/common/router/BUILD b/source/common/router/BUILD index bb2973290ae28..610cb0f10d75f 100644 --- a/source/common/router/BUILD +++ b/source/common/router/BUILD @@ -347,7 +347,6 @@ envoy_cc_library( name = "header_parser_lib", srcs = ["header_parser.cc"], hdrs = ["header_parser.h"], - external_deps = ["abseil_any"], deps = [ ":header_formatter_lib", "//include/envoy/http:header_map_interface", From 16f981f7b47ffdef75744121ed87415069dfcb28 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Wed, 1 Jul 2020 16:50:43 +0000 Subject: [PATCH 16/34] add macos flag Signed-off-by: Yifan Yang --- .bazelrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.bazelrc b/.bazelrc index 1f695bb4a7544..ed0c72871cb36 100644 --- a/.bazelrc +++ b/.bazelrc @@ -66,6 +66,7 @@ build:clang-asan --config=asan build:clang-asan --linkopt -fuse-ld=lld # macOS ASAN/UBSAN +build:macos --cxxopts=-std=c++17 build:macos-asan --config=asan # Workaround, see https://github.com/bazelbuild/bazel/issues/6932 build:macos-asan --copt -Wno-macro-redefined From 89e187279d3deb37a80828a11d036540b60ea8ea Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Wed, 1 Jul 2020 17:33:28 +0000 Subject: [PATCH 17/34] add the flag to macos build Signed-off-by: Yifan Yang --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index ed0c72871cb36..cdf4287949c92 100644 --- a/.bazelrc +++ b/.bazelrc @@ -66,7 +66,7 @@ build:clang-asan --config=asan build:clang-asan --linkopt -fuse-ld=lld # macOS ASAN/UBSAN -build:macos --cxxopts=-std=c++17 +build:macos -std=c++17 build:macos-asan --config=asan # Workaround, see https://github.com/bazelbuild/bazel/issues/6932 build:macos-asan --copt -Wno-macro-redefined From 9423af56861e1bf8d8f4b5705cc48bbe6656834d Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Wed, 1 Jul 2020 18:53:50 +0000 Subject: [PATCH 18/34] fixing macos c++17 flag Signed-off-by: Yifan Yang --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index cdf4287949c92..c2fc324e806c3 100644 --- a/.bazelrc +++ b/.bazelrc @@ -66,7 +66,7 @@ build:clang-asan --config=asan build:clang-asan --linkopt -fuse-ld=lld # macOS ASAN/UBSAN -build:macos -std=c++17 +build:macos --define --cxxopt=-std=c++17 build:macos-asan --config=asan # Workaround, see https://github.com/bazelbuild/bazel/issues/6932 build:macos-asan --copt -Wno-macro-redefined From 5c0b94fbf193a44c9614429900d8b76ec1ed35ab Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Wed, 1 Jul 2020 20:56:35 +0000 Subject: [PATCH 19/34] adding the flags in envoy_internal.bzl back because they are failing the windows and macOS build Signed-off-by: Yifan Yang --- .bazelrc | 2 +- bazel/envoy_internal.bzl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index c2fc324e806c3..ec8e9a2bfbbb4 100644 --- a/.bazelrc +++ b/.bazelrc @@ -66,7 +66,7 @@ build:clang-asan --config=asan build:clang-asan --linkopt -fuse-ld=lld # macOS ASAN/UBSAN -build:macos --define --cxxopt=-std=c++17 +build:macos --cxxopt=-std=c++17 build:macos-asan --config=asan # Workaround, see https://github.com/bazelbuild/bazel/issues/6932 build:macos-asan --copt -Wno-macro-redefined diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 2f892ae74bb5f..b2c669b5cd1ed 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -14,6 +14,7 @@ def envoy_copts(repository, test = False): "-Wformat", "-Wformat-security", "-Wvla", + "-std=c++17", ] # Windows options for cleanest service compilation; @@ -35,6 +36,7 @@ def envoy_copts(repository, test = False): # this is to silence the incorrect MSVC compiler warning when trying to convert between # std::optional data types while conversions between primitive types are producing no error "-wd4244", + "/std:c++17", ] return select({ From 711507a408dcef1fc55558d9d024ea59a2d4c171 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Thu, 2 Jul 2020 14:49:42 +0000 Subject: [PATCH 20/34] to force the rerun of CI Signed-off-by: Yifan Yang --- .bazelrc | 1 + bazel/envoy_internal.bzl | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index ec8e9a2bfbbb4..68154ec47f929 100644 --- a/.bazelrc +++ b/.bazelrc @@ -254,6 +254,7 @@ build:msvc-cl --copt="/wd4068" build:msvc-cl --copt="/wd4834" # Allows inline functions to be undefined build:msvc-cl --copt="/wd4506" +build:msvc-cl --cxxopt="/std:c++17" build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING" # Required to work around Windows clang-cl build defects diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index b2c669b5cd1ed..2f892ae74bb5f 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -14,7 +14,6 @@ def envoy_copts(repository, test = False): "-Wformat", "-Wformat-security", "-Wvla", - "-std=c++17", ] # Windows options for cleanest service compilation; @@ -36,7 +35,6 @@ def envoy_copts(repository, test = False): # this is to silence the incorrect MSVC compiler warning when trying to convert between # std::optional data types while conversions between primitive types are producing no error "-wd4244", - "/std:c++17", ] return select({ From 1fb29764ed81daff77f01b5a0b1e311cc01b1128 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Tue, 7 Jul 2020 22:59:50 +0000 Subject: [PATCH 21/34] revert the change manually Signed-off-by: Yifan Yang --- .bazelrc | 1 - bazel/envoy_internal.bzl | 2 ++ bazel/external/quiche.patch | 16 ++++++++++++++++ bazel/genrule_repository.bzl | 2 +- bazel/repositories.bzl | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 bazel/external/quiche.patch diff --git a/.bazelrc b/.bazelrc index 68154ec47f929..ec8e9a2bfbbb4 100644 --- a/.bazelrc +++ b/.bazelrc @@ -254,7 +254,6 @@ build:msvc-cl --copt="/wd4068" build:msvc-cl --copt="/wd4834" # Allows inline functions to be undefined build:msvc-cl --copt="/wd4506" -build:msvc-cl --cxxopt="/std:c++17" build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING" # Required to work around Windows clang-cl build defects diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 2f892ae74bb5f..b2c669b5cd1ed 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -14,6 +14,7 @@ def envoy_copts(repository, test = False): "-Wformat", "-Wformat-security", "-Wvla", + "-std=c++17", ] # Windows options for cleanest service compilation; @@ -35,6 +36,7 @@ def envoy_copts(repository, test = False): # this is to silence the incorrect MSVC compiler warning when trying to convert between # std::optional data types while conversions between primitive types are producing no error "-wd4244", + "/std:c++17", ] return select({ diff --git a/bazel/external/quiche.patch b/bazel/external/quiche.patch new file mode 100644 index 0000000000000..60ce77a1173ad --- /dev/null +++ b/bazel/external/quiche.patch @@ -0,0 +1,16 @@ +--- a/spdy/core/spdy_alt_svc_wire_format.cc ++++ b/spdy/core/spdy_alt_svc_wire_format.cc +@@ -196,9 +196,11 @@ bool SpdyAltSvcWireFormat::ParseHeaderFieldValue( + // hq=":443";quic=51303338 + // ... will be stored in |versions| as 0x51303338. + uint32_t quic_version; ++ ++ + if (!SpdyHexDecodeToUInt32( +- quiche::QuicheStringPiece(parameter_value_begin, +- c - parameter_value_begin), ++ quiche::QuicheStringPiece(&*parameter_value_begin, ++ &*c - &*parameter_value_begin), + &quic_version) || + quic_version == 0) { + return false; \ No newline at end of file diff --git a/bazel/genrule_repository.bzl b/bazel/genrule_repository.bzl index 28f37adfe55c7..4cf8f86d8b334 100644 --- a/bazel/genrule_repository.bzl +++ b/bazel/genrule_repository.bzl @@ -9,7 +9,7 @@ def _genrule_repository(ctx): for ii, patch in enumerate(ctx.attr.patches): patch_input = "patch-input-%d.patch" % (ii,) ctx.symlink(patch, patch_input) - patch_result = ctx.execute(["patch", "-p0", "--input", patch_input]) + patch_result = ctx.execute(["patch", "-p1", "--input", patch_input]) if patch_result.return_code != 0: fail("Failed to apply patch %r: %s" % (patch, patch_result.stderr)) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index d1580efb7bac1..65ee95833cb51 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -671,6 +671,7 @@ def _com_googlesource_quiche(): name = "com_googlesource_quiche", urls = location["urls"], sha256 = location["sha256"], + patches = ["@envoy//bazel/external:quiche.patch"], genrule_cmd_file = "@envoy//bazel/external:quiche.genrule_cmd", build_file = "@envoy//bazel/external:quiche.BUILD", ) From 3d39125c8423cd5c13bd9f0e4a3dc4c8f59c56e5 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Tue, 7 Jul 2020 23:02:27 +0000 Subject: [PATCH 22/34] manually revert the patches Signed-off-by: Yifan Yang --- bazel/genrule_repository.bzl | 2 +- bazel/repositories.bzl | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/bazel/genrule_repository.bzl b/bazel/genrule_repository.bzl index 4cf8f86d8b334..28f37adfe55c7 100644 --- a/bazel/genrule_repository.bzl +++ b/bazel/genrule_repository.bzl @@ -9,7 +9,7 @@ def _genrule_repository(ctx): for ii, patch in enumerate(ctx.attr.patches): patch_input = "patch-input-%d.patch" % (ii,) ctx.symlink(patch, patch_input) - patch_result = ctx.execute(["patch", "-p1", "--input", patch_input]) + patch_result = ctx.execute(["patch", "-p0", "--input", patch_input]) if patch_result.return_code != 0: fail("Failed to apply patch %r: %s" % (patch, patch_result.stderr)) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 65ee95833cb51..d1580efb7bac1 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -671,7 +671,6 @@ def _com_googlesource_quiche(): name = "com_googlesource_quiche", urls = location["urls"], sha256 = location["sha256"], - patches = ["@envoy//bazel/external:quiche.patch"], genrule_cmd_file = "@envoy//bazel/external:quiche.genrule_cmd", build_file = "@envoy//bazel/external:quiche.BUILD", ) From 38b3d65d4c09a376cd9a0db208a246260ef079ab Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Tue, 7 Jul 2020 23:05:05 +0000 Subject: [PATCH 23/34] manually revert the patch changes Signed-off-by: Yifan Yang --- bazel/external/quiche.patch | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 bazel/external/quiche.patch diff --git a/bazel/external/quiche.patch b/bazel/external/quiche.patch deleted file mode 100644 index 60ce77a1173ad..0000000000000 --- a/bazel/external/quiche.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/spdy/core/spdy_alt_svc_wire_format.cc -+++ b/spdy/core/spdy_alt_svc_wire_format.cc -@@ -196,9 +196,11 @@ bool SpdyAltSvcWireFormat::ParseHeaderFieldValue( - // hq=":443";quic=51303338 - // ... will be stored in |versions| as 0x51303338. - uint32_t quic_version; -+ -+ - if (!SpdyHexDecodeToUInt32( -- quiche::QuicheStringPiece(parameter_value_begin, -- c - parameter_value_begin), -+ quiche::QuicheStringPiece(&*parameter_value_begin, -+ &*c - &*parameter_value_begin), - &quic_version) || - quic_version == 0) { - return false; \ No newline at end of file From 4c69a005a6578b40342223b15228d63d4d2d8438 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Wed, 8 Jul 2020 15:59:31 +0000 Subject: [PATCH 24/34] silence the incorrect unused return value warning Signed-off-by: Yifan Yang --- test/common/json/json_loader_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/json/json_loader_test.cc b/test/common/json/json_loader_test.cc index 47c4094f7969c..14c29f7a9acac 100644 --- a/test/common/json/json_loader_test.cc +++ b/test/common/json/json_loader_test.cc @@ -198,7 +198,7 @@ TEST_F(JsonLoaderTest, Basic) { { ObjectSharedPtr json = Factory::loadFromString("{}"); - EXPECT_THROW(json->getObjectArray("hello").empty(), Exception); + EXPECT_THROW((void)json->getObjectArray("hello").empty(), Exception); } { From 49b22cbfd585909ecc79a52d90aeccd798679a59 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 10 Jul 2020 13:49:29 +0000 Subject: [PATCH 25/34] getting rid of the duplicate flags Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 2 -- 1 file changed, 2 deletions(-) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 50e40e3cdeefc..07dad501e5a40 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -14,7 +14,6 @@ def envoy_copts(repository, test = False): "-Wformat", "-Wformat-security", "-Wvla", - "-std=c++17", ] # Windows options for cleanest service compilation; @@ -36,7 +35,6 @@ def envoy_copts(repository, test = False): # this is to silence the incorrect MSVC compiler warning when trying to convert between # std::optional data types while conversions between primitive types are producing no error "-wd4244", - "/std:c++17", ] return select({ From f699973a66a8048662dd0d4280130aec4708d367 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 10 Jul 2020 17:09:33 +0000 Subject: [PATCH 26/34] rerun the CI Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 07dad501e5a40..8882e603c2e74 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -32,7 +32,7 @@ def envoy_copts(repository, test = False): "-DNOMCX", "-DNOIME", "-DNOCRYPT", - # this is to silence the incorrect MSVC compiler warning when trying to convert between + # this is to silence the incorrect MSVC compiler warning when trying to convert between # std::optional data types while conversions between primitive types are producing no error "-wd4244", ] From a79eab157809b936695016fd410ef6632b17138f Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 10 Jul 2020 17:29:37 +0000 Subject: [PATCH 27/34] rerun the CI Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 8882e603c2e74..07dad501e5a40 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -32,7 +32,7 @@ def envoy_copts(repository, test = False): "-DNOMCX", "-DNOIME", "-DNOCRYPT", - # this is to silence the incorrect MSVC compiler warning when trying to convert between + # this is to silence the incorrect MSVC compiler warning when trying to convert between # std::optional data types while conversions between primitive types are producing no error "-wd4244", ] From 567698901f116708b1733f3ec1d45ee4d8fe6201 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 10 Jul 2020 19:12:56 +0000 Subject: [PATCH 28/34] rerun the CI Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 07dad501e5a40..1bc13b6ac3b15 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -33,7 +33,7 @@ def envoy_copts(repository, test = False): "-DNOIME", "-DNOCRYPT", # this is to silence the incorrect MSVC compiler warning when trying to convert between - # std::optional data types while conversions between primitive types are producing no error + # std::optional data types while conversion between primitive types are producing no error "-wd4244", ] From a4ff8701d5e4151316561827f1fb0d555aeec20d Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Fri, 10 Jul 2020 22:14:46 +0000 Subject: [PATCH 29/34] fix gcc compiler warning Signed-off-by: Yifan Yang --- test/extensions/filters/network/kafka/serialization_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/extensions/filters/network/kafka/serialization_test.cc b/test/extensions/filters/network/kafka/serialization_test.cc index 3d8a5af14e53b..19c0f5a3f26a1 100644 --- a/test/extensions/filters/network/kafka/serialization_test.cc +++ b/test/extensions/filters/network/kafka/serialization_test.cc @@ -323,7 +323,7 @@ TEST(NullableBytesDeserializer, ShouldDeserialize) { } TEST(NullableBytesDeserializer, ShouldDeserializeEmptyBytes) { - const NullableBytes value{{}}; + const NullableBytes value{}; serializeThenDeserializeAndCheckEquality(value); } From b55046891cf773f179f52b5a4a4383b59ca82347 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Sat, 11 Jul 2020 00:57:51 +0000 Subject: [PATCH 30/34] previous run was failing a flaky test Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 1bc13b6ac3b15..07dad501e5a40 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -33,7 +33,7 @@ def envoy_copts(repository, test = False): "-DNOIME", "-DNOCRYPT", # this is to silence the incorrect MSVC compiler warning when trying to convert between - # std::optional data types while conversion between primitive types are producing no error + # std::optional data types while conversions between primitive types are producing no error "-wd4244", ] From 576f5d7bc5a6a6c5dc7f3a06d9a07acd991109d6 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Sat, 11 Jul 2020 03:11:49 +0000 Subject: [PATCH 31/34] more flaky tests Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 07dad501e5a40..1bc13b6ac3b15 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -33,7 +33,7 @@ def envoy_copts(repository, test = False): "-DNOIME", "-DNOCRYPT", # this is to silence the incorrect MSVC compiler warning when trying to convert between - # std::optional data types while conversions between primitive types are producing no error + # std::optional data types while conversion between primitive types are producing no error "-wd4244", ] From 0e22d6e8f1ca6051f019de48b0393748df4580e0 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Mon, 13 Jul 2020 15:21:43 +0000 Subject: [PATCH 32/34] a workaround on the behavorial difference between gcc and clang Signed-off-by: Yifan Yang --- test/extensions/filters/network/kafka/serialization_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/extensions/filters/network/kafka/serialization_test.cc b/test/extensions/filters/network/kafka/serialization_test.cc index 19c0f5a3f26a1..2cc656926d645 100644 --- a/test/extensions/filters/network/kafka/serialization_test.cc +++ b/test/extensions/filters/network/kafka/serialization_test.cc @@ -323,7 +323,8 @@ TEST(NullableBytesDeserializer, ShouldDeserialize) { } TEST(NullableBytesDeserializer, ShouldDeserializeEmptyBytes) { - const NullableBytes value{}; + // gcc refuses to initialize optional with empty vector with value{{}} + const NullableBytes value = {{}}; serializeThenDeserializeAndCheckEquality(value); } From 19cb15274c48a65e269da47872c413fcede4bdfb Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Mon, 13 Jul 2020 17:55:43 +0000 Subject: [PATCH 33/34] previous CI results in weird abrupted status Signed-off-by: Yifan Yang --- bazel/envoy_internal.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/envoy_internal.bzl b/bazel/envoy_internal.bzl index 1bc13b6ac3b15..07dad501e5a40 100644 --- a/bazel/envoy_internal.bzl +++ b/bazel/envoy_internal.bzl @@ -33,7 +33,7 @@ def envoy_copts(repository, test = False): "-DNOIME", "-DNOCRYPT", # this is to silence the incorrect MSVC compiler warning when trying to convert between - # std::optional data types while conversion between primitive types are producing no error + # std::optional data types while conversions between primitive types are producing no error "-wd4244", ] From e4aa7be8f2d6e5b61b56e05e78c4271a33849a76 Mon Sep 17 00:00:00 2001 From: Yifan Yang Date: Tue, 14 Jul 2020 19:15:05 +0000 Subject: [PATCH 34/34] use the updated upstream to remove the duplicates in cel-cpp patch Signed-off-by: Yifan Yang --- bazel/cel-cpp.patch | 1360 -------------------------------- bazel/repositories.bzl | 6 +- bazel/repository_locations.bzl | 8 +- 3 files changed, 5 insertions(+), 1369 deletions(-) delete mode 100644 bazel/cel-cpp.patch diff --git a/bazel/cel-cpp.patch b/bazel/cel-cpp.patch deleted file mode 100644 index 4511503966a22..0000000000000 --- a/bazel/cel-cpp.patch +++ /dev/null @@ -1,1360 +0,0 @@ -diff --git a/base/BUILD b/base/BUILD -index 2ddce9f..f6c1d58 100644 ---- a/base/BUILD -+++ b/base/BUILD -@@ -13,7 +13,7 @@ cc_library( - "statusor.h", - "statusor_internals.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_google_absl//absl/base:core_headers", - "@com_google_absl//absl/meta:type_traits", -@@ -26,5 +26,5 @@ cc_library( - hdrs = [ - "status_macros.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - ) -diff --git a/common/BUILD b/common/BUILD -index d561461..a08de81 100644 ---- a/common/BUILD -+++ b/common/BUILD -@@ -12,7 +12,7 @@ cc_library( - hdrs = [ - "macros.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [], - ) - -@@ -21,7 +21,7 @@ cc_library( - hdrs = [ - "id.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//internal:cel_printer", - "//internal:handle", -@@ -35,7 +35,7 @@ cc_library( - hdrs = [ - "type.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//internal:handle", - "@com_google_absl//absl/memory", -@@ -51,7 +51,7 @@ cc_library( - hdrs = [ - "enum.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":type", - "//internal:cel_printer", -@@ -66,7 +66,7 @@ cc_library( - hdrs = [ - "error.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//internal:cel_printer", - "//internal:hash_util", -@@ -84,7 +84,7 @@ cc_library( - hdrs = [ - "unknown.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":id", - ":macros", -@@ -100,7 +100,7 @@ cc_library( - hdrs = [ - "parent_ref.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//internal:ref_countable", - "@com_google_absl//absl/types:optional", -@@ -115,7 +115,7 @@ cc_library( - hdrs = [ - "custom_object.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":value", - ], -@@ -129,7 +129,7 @@ cc_library( - hdrs = [ - "operators.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_google_absl//absl/strings", - "@com_google_absl//absl/types:optional", -@@ -145,7 +145,7 @@ cc_library( - hdrs = [ - "escaping.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_google_absl//absl/strings", - "@com_google_absl//absl/strings:str_format", -@@ -156,7 +156,7 @@ cc_library( - cc_test( - name = "escaping_test", - srcs = ["escaping_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":escaping", - "@com_github_google_googletest//:gtest_main", -@@ -171,7 +171,7 @@ cc_library( - hdrs = [ - "value.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":enum", - ":error", -@@ -202,7 +202,7 @@ cc_library( - cc_test( - name = "value_test", - srcs = ["value_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":custom_object", - ":value", -@@ -226,7 +226,7 @@ cc_library( - hdrs = [ - "converters.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":parent_ref", - ":value", -@@ -239,7 +239,7 @@ cc_library( - cc_test( - name = "converters_test", - srcs = ["converters_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":converters", - ":value", -diff --git a/conformance/BUILD b/conformance/BUILD -index 2aacf82..0e680ba 100644 ---- a/conformance/BUILD -+++ b/conformance/BUILD -@@ -31,7 +31,7 @@ cc_binary( - name = "server", - testonly = 1, - srcs = ["server.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//base:statusor", - "//eval/eval:container_backed_list_impl", -diff --git a/eval/compiler/BUILD b/eval/compiler/BUILD -index 93eaf84..456eb73 100644 ---- a/eval/compiler/BUILD -+++ b/eval/compiler/BUILD -@@ -14,7 +14,7 @@ cc_library( - hdrs = [ - "flat_expr_builder.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":constant_folding", - "//base:status_macros", -@@ -45,7 +45,7 @@ cc_test( - srcs = [ - "flat_expr_builder_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":flat_expr_builder", - "//base:status_macros", -@@ -71,7 +71,7 @@ cc_test( - srcs = [ - "flat_expr_builder_comprehensions_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":flat_expr_builder", - "//base:status_macros", -@@ -100,7 +100,7 @@ cc_library( - hdrs = [ - "constant_folding.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//eval/eval:const_value_step", - "//eval/eval:container_backed_list_impl", -@@ -119,7 +119,7 @@ cc_test( - srcs = [ - "constant_folding_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":constant_folding", - "//base:status_macros", -diff --git a/eval/eval/BUILD b/eval/eval/BUILD -index 36df103..537f82a 100644 ---- a/eval/eval/BUILD -+++ b/eval/eval/BUILD -@@ -14,7 +14,7 @@ cc_library( - hdrs = [ - "evaluator_core.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":attribute_trail", - ":unknowns_utility", -@@ -37,7 +37,7 @@ cc_library( - hdrs = [ - "expression_step_base.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - "//eval/public:activation", -@@ -57,7 +57,7 @@ cc_library( - hdrs = [ - "const_value_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":expression_step_base", -@@ -78,7 +78,7 @@ cc_library( - hdrs = [ - "container_access_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":expression_step_base", -@@ -99,7 +99,7 @@ cc_library( - hdrs = [ - "ident_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":expression_step_base", -@@ -119,7 +119,7 @@ cc_library( - hdrs = [ - "function_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":attribute_trail", - ":evaluator_core", -@@ -149,7 +149,7 @@ cc_library( - hdrs = [ - "field_access.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//eval/public:cel_value", - "//internal:proto_util", -@@ -166,7 +166,7 @@ cc_library( - hdrs = [ - "container_backed_list_impl.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//eval/public:cel_value", - "@com_google_absl//absl/strings", -@@ -182,7 +182,7 @@ cc_library( - hdrs = [ - "container_backed_map_impl.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//eval/public:cel_value", - "@com_google_absl//absl/container:node_hash_map", -@@ -198,7 +198,7 @@ cc_library( - hdrs = [ - "field_backed_list_impl.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":field_access", - "//eval/public:cel_value", -@@ -214,7 +214,7 @@ cc_library( - hdrs = [ - "field_backed_map_impl.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":field_access", - "//eval/public:cel_value", -@@ -231,7 +231,7 @@ cc_library( - hdrs = [ - "select_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":expression_step_base", -@@ -252,7 +252,7 @@ cc_library( - hdrs = [ - "create_list_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":container_backed_list_impl", - ":evaluator_core", -@@ -273,7 +273,7 @@ cc_library( - hdrs = [ - "create_struct_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":container_backed_map_impl", - ":evaluator_core", -@@ -294,7 +294,7 @@ cc_library( - hdrs = [ - "jump_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":expression_step_base", -@@ -313,7 +313,7 @@ cc_library( - hdrs = [ - "logic_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":expression_step_base", -@@ -334,7 +334,7 @@ cc_library( - hdrs = [ - "comprehension_step.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":expression_step_base", -@@ -353,7 +353,7 @@ cc_test( - srcs = [ - "evaluator_core_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - "//base:status_macros", -@@ -372,7 +372,7 @@ cc_test( - srcs = [ - "const_value_step_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":const_value_step", - ":evaluator_core", -@@ -388,7 +388,7 @@ cc_test( - srcs = [ - "container_access_step_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":container_access_step", - ":container_backed_list_impl", -@@ -409,7 +409,7 @@ cc_test( - srcs = [ - "ident_step_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":ident_step", -@@ -425,7 +425,7 @@ cc_test( - srcs = [ - "function_step_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":expression_build_warning", -@@ -451,7 +451,7 @@ cc_test( - srcs = [ - "container_backed_map_impl_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":container_backed_map_impl", - "//eval/public:cel_value", -@@ -466,7 +466,7 @@ cc_test( - srcs = [ - "field_backed_list_impl_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":field_backed_list_impl", -@@ -482,7 +482,7 @@ cc_test( - srcs = [ - "field_backed_map_impl_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":evaluator_core", - ":field_backed_map_impl", -@@ -498,7 +498,7 @@ cc_test( - srcs = [ - "logic_step_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":ident_step", - ":logic_step", -@@ -515,7 +515,7 @@ cc_test( - srcs = [ - "select_step_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":container_backed_map_impl", - ":ident_step", -@@ -536,7 +536,7 @@ cc_test( - srcs = [ - "create_list_step_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":const_value_step", - ":create_list_step", -@@ -556,7 +556,7 @@ cc_test( - srcs = [ - "create_struct_step_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":container_backed_list_impl", - ":container_backed_map_impl", -@@ -579,7 +579,7 @@ cc_library( - hdrs = [ - "expression_build_warning.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_google_absl//absl/status", - ], -@@ -591,7 +591,7 @@ cc_test( - srcs = [ - "expression_build_warning_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":expression_build_warning", - "@com_github_google_googletest//:gtest_main", -@@ -603,7 +603,7 @@ cc_library( - name = "attribute_trail", - srcs = ["attribute_trail.cc"], - hdrs = ["attribute_trail.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//base:statusor", - "//eval/public:activation", -@@ -624,7 +624,7 @@ cc_test( - srcs = [ - "attribute_trail_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":attribute_trail", - "//eval/public:cel_attribute", -@@ -638,7 +638,7 @@ cc_library( - name = "unknowns_utility", - srcs = ["unknowns_utility.cc"], - hdrs = ["unknowns_utility.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":attribute_trail", - "//base:statusor", -@@ -661,7 +661,7 @@ cc_test( - srcs = [ - "unknowns_utility_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":unknowns_utility", - "//eval/public:cel_attribute", -diff --git a/eval/public/BUILD b/eval/public/BUILD -index 54ccfb5..266f49e 100644 ---- a/eval/public/BUILD -+++ b/eval/public/BUILD -@@ -9,7 +9,7 @@ cc_library( - hdrs = [ - "cel_value_internal.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_google_absl//absl/types:variant", - ], -@@ -23,7 +23,7 @@ cc_library( - hdrs = [ - "cel_value.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_value_internal", - "//base:statusor", -@@ -44,7 +44,7 @@ cc_library( - hdrs = [ - "cel_attribute.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_value", - ":cel_value_internal", -@@ -61,7 +61,7 @@ cc_library( - hdrs = [ - "cel_value_producer.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_value", - "@com_google_absl//absl/strings", -@@ -75,7 +75,7 @@ cc_library( - hdrs = [ - "unknown_attribute_set.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_attribute", - "@com_google_absl//absl/container:flat_hash_set", -@@ -90,7 +90,7 @@ cc_library( - hdrs = [ - "activation.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_attribute", - ":cel_function", -@@ -111,7 +111,7 @@ cc_library( - hdrs = [ - "activation_bind_helper.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":activation", - "//eval/eval:field_access", -@@ -129,7 +129,7 @@ cc_library( - hdrs = [ - "cel_function.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_value", - "@com_google_absl//absl/types:span", -@@ -144,7 +144,7 @@ cc_library( - hdrs = [ - "cel_function_adapter.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_function", - ":cel_function_registry", -@@ -163,7 +163,7 @@ cc_library( - hdrs = [ - "cel_function_provider.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":activation", - ":cel_function", -@@ -175,7 +175,7 @@ cc_library( - hdrs = [ - "cel_builtins.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ], - ) -@@ -188,7 +188,7 @@ cc_library( - hdrs = [ - "builtin_func_registrar.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_builtins", - ":cel_function", -@@ -211,7 +211,7 @@ cc_library( - hdrs = [ - "extension_func_registrar.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_function", - ":cel_function_adapter", -@@ -227,7 +227,7 @@ cc_library( - hdrs = [ - "cel_expression.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":activation", - ":cel_function", -@@ -242,7 +242,7 @@ cc_library( - name = "source_position", - srcs = ["source_position.cc"], - hdrs = ["source_position.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_google_googleapis//google/api/expr/v1alpha1:syntax_cc_proto", - "@com_google_protobuf//:protobuf_lite", -@@ -254,7 +254,7 @@ cc_library( - hdrs = [ - "ast_visitor.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":source_position", - "@com_google_absl//absl/strings", -@@ -267,7 +267,7 @@ cc_library( - hdrs = [ - "ast_visitor_base.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":ast_visitor", - "@com_google_googleapis//google/api/expr/v1alpha1:syntax_cc_proto", -@@ -282,7 +282,7 @@ cc_library( - hdrs = [ - "ast_traverse.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":ast_visitor", - ":source_position", -@@ -296,7 +296,7 @@ cc_library( - hdrs = [ - "cel_options.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_google_protobuf//:protobuf", - ], -@@ -310,7 +310,7 @@ cc_library( - hdrs = [ - "cel_expr_builder_factory.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_expression", - ":cel_options", -@@ -326,7 +326,7 @@ cc_library( - hdrs = [ - "value_export_util.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_value", - "@com_google_absl//absl/status", -@@ -339,7 +339,7 @@ cc_library( - name = "cel_function_registry", - srcs = ["cel_function_registry.cc"], - hdrs = ["cel_function_registry.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_function", - ":cel_function_provider", -@@ -356,7 +356,7 @@ cc_test( - srcs = [ - "cel_value_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_value", - ":unknown_attribute_set", -@@ -374,7 +374,7 @@ cc_test( - srcs = [ - "cel_attribute_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_attribute", - ":cel_value", -@@ -390,7 +390,7 @@ cc_test( - srcs = [ - "activation_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":activation", - ":cel_function", -@@ -404,7 +404,7 @@ cc_test( - srcs = [ - "ast_traverse_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":ast_traverse", - "@com_github_google_googletest//:gtest_main", -@@ -417,7 +417,7 @@ cc_test( - srcs = [ - "activation_bind_helper_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":activation", - ":activation_bind_helper", -@@ -434,7 +434,7 @@ cc_test( - srcs = [ - "cel_function_provider_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_function", - ":cel_function_provider", -@@ -448,7 +448,7 @@ cc_test( - srcs = [ - "cel_function_registry_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_function", - ":cel_function_provider", -@@ -464,7 +464,7 @@ cc_test( - srcs = [ - "cel_function_adapter_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_function", - ":cel_function_adapter", -@@ -480,7 +480,7 @@ cc_test( - srcs = [ - "builtin_func_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":activation", - ":builtin_func_registrar", -@@ -501,7 +501,7 @@ cc_test( - srcs = [ - "extension_func_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":builtin_func_registrar", - ":cel_function_registry", -@@ -520,7 +520,7 @@ cc_test( - srcs = [ - "source_position_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":source_position", - "@com_github_google_googletest//:gtest_main", -@@ -534,7 +534,7 @@ cc_test( - srcs = [ - "unknown_attribute_set_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_attribute", - ":cel_value", -@@ -549,7 +549,7 @@ cc_test( - srcs = [ - "value_export_util_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_value", - ":value_export_util", -@@ -568,7 +568,7 @@ cc_library( - name = "unknown_function_result_set", - srcs = ["unknown_function_result_set.cc"], - hdrs = ["unknown_function_result_set.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_function", - ":cel_options", -@@ -585,7 +585,7 @@ cc_test( - srcs = [ - "unknown_function_result_set_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_function", - ":cel_value", -@@ -602,7 +602,7 @@ cc_test( - cc_library( - name = "unknown_set", - hdrs = ["unknown_set.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":unknown_attribute_set", - ":unknown_function_result_set", -@@ -612,7 +612,7 @@ cc_library( - cc_test( - name = "unknown_set_test", - srcs = ["unknown_set_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_attribute", - ":unknown_attribute_set", -@@ -628,7 +628,7 @@ cc_library( - name = "set_util", - srcs = ["set_util.cc"], - hdrs = ["set_util.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = ["//eval/public:cel_value"], - ) - -@@ -638,7 +638,7 @@ cc_test( - srcs = [ - "set_util_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_value", - ":set_util", -diff --git a/eval/tests/BUILD b/eval/tests/BUILD -index ce8a808..ab52c89 100644 ---- a/eval/tests/BUILD -+++ b/eval/tests/BUILD -@@ -14,7 +14,7 @@ cc_test( - srcs = [ - "benchmark_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - tags = ["manual"], - deps = [ - ":request_context_cc_proto", -@@ -39,7 +39,7 @@ cc_test( - srcs = [ - "end_to_end_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//base:status_macros", - "//eval/public:activation", -@@ -60,7 +60,7 @@ cc_test( - srcs = [ - "unknowns_end_to_end_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//base:status_macros", - "//eval/public:activation", -@@ -94,7 +94,7 @@ cc_library( - name = "mock_cel_expression", - testonly = 1, - hdrs = ["mock_cel_expression.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//eval/public:activation", - "//eval/public:cel_expression", -diff --git a/internal/BUILD b/internal/BUILD -index c6d2c7f..05e29f6 100644 ---- a/internal/BUILD -+++ b/internal/BUILD -@@ -13,7 +13,7 @@ cc_library( - hdrs = [ - "ref_countable.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":holder", - ":specialize", -@@ -23,7 +23,7 @@ cc_library( - cc_test( - name = "ref_countable_test", - srcs = ["ref_countable_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":ref_countable", - "//testutil:util", -@@ -37,7 +37,7 @@ cc_library( - hdrs = [ - "handle.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":hash_util", - ":specialize", -@@ -47,7 +47,7 @@ cc_library( - cc_test( - name = "handle_test", - srcs = ["handle_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":handle", - "@com_github_google_googletest//:gtest_main", -@@ -60,7 +60,7 @@ cc_library( - hdrs = [ - "holder.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":port", - ":specialize", -@@ -72,7 +72,7 @@ cc_library( - cc_test( - name = "holder_test", - srcs = ["holder_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":holder", - ":types", -@@ -90,7 +90,7 @@ cc_library( - hdrs = [ - "hash_util.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":port", - ":specialize", -@@ -107,7 +107,7 @@ cc_library( - hdrs = [ - "status_util.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_google_absl//absl/strings", - "@com_google_googleapis//google/rpc:code_cc_proto", -@@ -120,7 +120,7 @@ cc_library( - hdrs = [ - "visitor_util.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":specialize", - ":types", -@@ -133,7 +133,7 @@ cc_library( - cc_test( - name = "visitor_util_test", - srcs = ["visitor_util_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":adapter_util", - ":visitor_util", -@@ -149,7 +149,7 @@ cc_library( - hdrs = [ - "adapter_util.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":visitor_util", - ], -@@ -161,7 +161,7 @@ cc_library( - hdrs = [ - "cel_printer.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":specialize", - ":types", -@@ -175,7 +175,7 @@ cc_library( - cc_test( - name = "cel_printer_test", - srcs = ["cel_printer_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cel_printer", - "@com_github_google_googletest//:gtest_main", -@@ -186,7 +186,7 @@ cc_library( - name = "proto_util", - srcs = ["proto_util.cc"], - hdrs = ["proto_util.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":status_util", - "//common:macros", -@@ -202,7 +202,7 @@ cc_library( - name = "map_impl", - srcs = ["map_impl.cc"], - hdrs = ["map_impl.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":status_util", - "//common:macros", -@@ -214,7 +214,7 @@ cc_library( - cc_library( - name = "list_impl", - hdrs = ["list_impl.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":holder", - "//common:macros", -@@ -225,7 +225,7 @@ cc_library( - cc_library( - name = "value_internal", - hdrs = ["value_internal.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":adapter_util", - ":cast", -@@ -244,7 +244,7 @@ cc_library( - cc_test( - name = "value_internal_test", - srcs = ["value_internal_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":value_internal", - "//testutil:util", -@@ -257,19 +257,19 @@ cc_test( - cc_library( - name = "port", - hdrs = ["port.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - ) - - cc_library( - name = "specialize", - hdrs = ["specialize.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - ) - - cc_library( - name = "cast", - hdrs = ["cast.h"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":port", - ":specialize", -@@ -282,7 +282,7 @@ cc_library( - cc_test( - name = "cast_test", - srcs = ["cast_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":cast", - "@com_github_google_googletest//:gtest_main", -@@ -294,7 +294,7 @@ cc_library( - hdrs = [ - "types.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":port", - ":specialize", -@@ -306,7 +306,7 @@ cc_library( - cc_test( - name = "types_test", - srcs = ["types_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":types", - "@com_github_google_googletest//:gtest_main", -diff --git a/parser/BUILD b/parser/BUILD -index c8516a8..dfd1593 100644 ---- a/parser/BUILD -+++ b/parser/BUILD -@@ -21,7 +21,7 @@ cc_library( - ], - copts = [ - "-fexceptions", -- "-std=c++14", -+ "-std=c++17", - ], - deps = [ - ":cel_cc_parser", -@@ -45,7 +45,7 @@ cc_library( - ], - copts = [ - "-fexceptions", -- "-std=c++14", -+ "-std=c++17", - ], - deps = [ - ":source_factory", -@@ -67,7 +67,7 @@ cc_library( - ], - copts = [ - "-fexceptions", -- "-std=c++14", -+ "-std=c++17", - ], - deps = [ - ":cel_cc_parser", -@@ -94,7 +94,7 @@ cc_library( - ], - copts = [ - "-fexceptions", -- "-std=c++14", -+ "-std=c++17", - ], - deps = [ - ":cel_cc_parser", -@@ -111,7 +111,7 @@ cc_library( - cc_test( - name = "parser_test", - srcs = ["parser_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":parser", - ":source_factory", -diff --git a/protoutil/BUILD b/protoutil/BUILD -index 0df1757..6993c8f 100644 ---- a/protoutil/BUILD -+++ b/protoutil/BUILD -@@ -13,7 +13,7 @@ cc_library( - hdrs = [ - "type_registry.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//common:macros", - "//common:parent_ref", -@@ -30,7 +30,7 @@ cc_library( - cc_test( - name = "type_registry_test", - srcs = ["type_registry_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":type_registry", - "//common:value", -@@ -50,7 +50,7 @@ cc_library( - hdrs = [ - "converters.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":type_registry", - "//common:macros", -@@ -73,7 +73,7 @@ cc_library( - cc_test( - name = "converters_test", - srcs = ["converters_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - data = [ - "@com_google_cel_spec//testdata", - ], -diff --git a/testutil/BUILD b/testutil/BUILD -index 0bf8e50..7305225 100644 ---- a/testutil/BUILD -+++ b/testutil/BUILD -@@ -15,7 +15,7 @@ cc_library( - hdrs = [ - "test_data_util.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//common:type", - "//common:value", -@@ -44,7 +44,7 @@ cc_library( - hdrs = [ - "test_data_io.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//internal:status_util", - "@com_github_google_googletest//:gtest_main", -@@ -69,7 +69,7 @@ cc_binary( - srcs = [ - "test_data_gen.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - ":test_data_io", - ":test_data_util", -@@ -87,7 +87,7 @@ cc_binary( - cc_test( - name = "test_data_test", - srcs = ["test_data_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - data = [ - "@com_google_cel_spec//testdata", - ], -@@ -105,7 +105,7 @@ cc_library( - hdrs = [ - "util.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "@com_github_google_googletest//:gtest_main", - "@com_google_protobuf//:protobuf", -diff --git a/tools/BUILD b/tools/BUILD -index 212207e..8a131bd 100644 ---- a/tools/BUILD -+++ b/tools/BUILD -@@ -17,7 +17,7 @@ cc_library( - hdrs = [ - "flatbuffers_backed_impl.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//eval/public:cel_value", - "@com_github_google_flatbuffers//:flatbuffers", -@@ -36,7 +36,7 @@ cc_library( - name = "flatbuffers_test_cc", - srcs = [":flatbuffers_test"], - hdrs = [":flatbuffers_test"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - features = ["-parse_headers"], - linkstatic = True, - deps = ["@com_github_google_flatbuffers//:runtime_cc"], -@@ -48,7 +48,7 @@ cc_test( - srcs = [ - "flatbuffers_backed_impl_test.cc", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - data = [ - ":flatbuffers_reflection_out", - ], -diff --git a/v1beta1/BUILD b/v1beta1/BUILD -index 41c64d6..2480b94 100644 ---- a/v1beta1/BUILD -+++ b/v1beta1/BUILD -@@ -15,7 +15,7 @@ cc_library( - hdrs = [ - "converters.h", - ], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - deps = [ - "//common:converters", - "//common:macros", -@@ -37,7 +37,7 @@ cc_library( - cc_test( - name = "converters_test", - srcs = ["converters_test.cc"], -- copts = ["-std=c++14"], -+ copts = ["-std=c++17"], - data = [ - "@com_google_cel_spec//testdata", - ], \ No newline at end of file diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index ad220e1d3da33..cb7b3bfea5d9d 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -377,11 +377,7 @@ def _net_zlib(): ) def _com_google_cel_cpp(): - _repository_impl( - name = "com_google_cel_cpp", - patch_args = ["-p1"], - patches = ["@envoy//bazel:cel-cpp.patch"], - ) + _repository_impl("com_google_cel_cpp") def _com_github_nghttp2_nghttp2(): location = _get_location("com_github_nghttp2_nghttp2") diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 40b6ed7d33e71..3453074b7fdb2 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -425,10 +425,10 @@ DEPENDENCY_REPOSITORIES = dict( cpe = "N/A", ), com_google_cel_cpp = dict( - sha256 = "1b283f93619b130504880d2f400bd449de9ab6be94ef26ecd2bb96921f48dd6c", - strip_prefix = "cel-cpp-50196761917300bbd47b59bd162e84817b67b7ab", - # 2020-06-08 - urls = ["https://github.com/google/cel-cpp/archive/50196761917300bbd47b59bd162e84817b67b7ab.tar.gz"], + sha256 = "cad7d01139947d78e413d112cb8f7431fbb33cf66b0adf9c280824803fc2a72e", + strip_prefix = "cel-cpp-b9453a09b28a1531c4917e8792b3ea61f6b1a447", + # 2020-07-14 + urls = ["https://github.com/google/cel-cpp/archive/b9453a09b28a1531c4917e8792b3ea61f6b1a447.tar.gz"], use_category = ["dataplane"], cpe = "N/A", ),