diff --git a/Rakefile b/Rakefile index d383cb5ff2fe0..05b92b457be3b 100755 --- a/Rakefile +++ b/Rakefile @@ -184,7 +184,7 @@ task 'gem:native', [:plat] do |t, args| run_rake_compiler(plat, <<~EOT) #{prepare_ccache_cmd} && \ gem update --system --no-document && \ - bundle && \ + bundle update && \ bundle exec rake clean && \ bundle exec rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \ RUBY_CC_VERSION=#{ruby_cc_versions} \ @@ -216,7 +216,7 @@ task 'gem:native', [:plat] do |t, args| run_rake_compiler(plat, <<~EOT) #{prepare_ccache_cmd} && \ gem update --system --no-document && \ - bundle && \ + bundle update && \ bundle exec rake clean && \ export GRPC_RUBY_DEBUG_SYMBOLS_OUTPUT_DIR=#{debug_symbols_dir} && \ bundle exec rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem pkg/#{spec.full_name}.gem \ diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 71fba238ec523..5f3b33e2657e2 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -320,43 +320,26 @@ def grpc_deps(): ], ) - # TODO(stanleycheung): remove this when prometheus-cpp AND - # opentelemetry-cpp cut a new release - # This override is needed because this fix - # https://github.com/jupp0r/prometheus-cpp/pull/626 - # has not been included in the latest prometheus-cpp release yet. - # We also need opentelemetry-cpp to update their dependency on - # prometheus-cpp after that fix is released. - # Without the fix, we cannot build the prometheus exporter with bazel 6 - if "com_github_jupp0r_prometheus_cpp" not in native.existing_rules(): - http_archive( - name = "com_github_jupp0r_prometheus_cpp", - sha256 = "cdf03ee63fcb1d9e113f7bd525e043c254729dddf19d80396489f5b92c83c18d", - strip_prefix = "prometheus-cpp-b1234816facfdda29845c46696a02998a4af115a", - urls = [ - "https://github.com/jupp0r/prometheus-cpp/archive/b123481.zip", - ], - ) - if "io_opentelemetry_cpp" not in native.existing_rules(): http_archive( name = "io_opentelemetry_cpp", - sha256 = "4b822a2f137b8c2ea403c5ec9a661addcc048aa8ba3afebffd58cbcf218457bc", - strip_prefix = "opentelemetry-cpp-a388e87d72b8321c189c8d41edb746ffa687ce3c", + sha256 = "fb7c38e82ce5a5dcad70be7eafe0d3d4f439e3ef822b414a99db7514580ddac4", + strip_prefix = "opentelemetry-cpp-955a807c0461544560429c2414b8967f6023e590", urls = [ - "https://storage.googleapis.com/grpc-bazel-mirror/github.com/open-telemetry/opentelemetry-cpp/archive/a388e87d72b8321c189c8d41edb746ffa687ce3c.tar.gz", - "https://github.com/open-telemetry/opentelemetry-cpp/archive/a388e87d72b8321c189c8d41edb746ffa687ce3c.tar.gz", + # v1.18.0 + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/open-telemetry/opentelemetry-cpp/archive/955a807c0461544560429c2414b8967f6023e590.tar.gz", + "https://github.com/open-telemetry/opentelemetry-cpp/archive/955a807c0461544560429c2414b8967f6023e590.tar.gz", ], ) if "google_cloud_cpp" not in native.existing_rules(): http_archive( name = "google_cloud_cpp", - sha256 = "7ca7f583b60d2aa1274411fed3b9fb3887119b2e84244bb3fc69ea1db819e4e5", - strip_prefix = "google-cloud-cpp-2.16.0", + sha256 = "e53ba3799c052d97acac9a6a6b27af24ce822dbde7bfde973bac9e5da714e6b2", + strip_prefix = "google-cloud-cpp-2.33.0", urls = [ - "https://storage.googleapis.com/grpc-bazel-mirror/github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.16.0.tar.gz", - "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.16.0.tar.gz", + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.33.0.tar.gz", + "https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v2.33.0.tar.gz", ], ) diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index 4c6310b1ce004..1e7f453280a8c 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -105,7 +105,7 @@ test_tags: [resource_quota_test] - name: local_connector_secure description: Local security connector uses TSI_SECURITY_NONE for LOCAL_TCP connections. - expiry: 2024/12/30 + expiry: 2025/01/30 owner: mattstev@google.com test_tags: ["core_end2end_test"] - name: max_pings_wo_data_throttle @@ -113,7 +113,7 @@ Experiment to throttle pings to a period of 1 min when GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA limit has reached (instead of completely blocking). - expiry: 2024/01/30 + expiry: 2025/01/30 owner: yashkt@google.com test_tags: [] - name: monitoring_experiment @@ -214,6 +214,6 @@ Have the work serializer dispatch work to event engine for every callback, instead of running things inline in the first thread that successfully enqueues work. - expiry: 2024/12/31 + expiry: 2025/01/30 owner: ysseung@google.com test_tags: ["core_end2end_test", "cpp_end2end_test", "xds_end2end_test", "lb_unit_test"] diff --git a/test/core/experiments/fixtures/test_experiments.yaml b/test/core/experiments/fixtures/test_experiments.yaml index 5be0e1c9e003c..e5044341ebc5b 100644 --- a/test/core/experiments/fixtures/test_experiments.yaml +++ b/test/core/experiments/fixtures/test_experiments.yaml @@ -14,18 +14,18 @@ - name: test_experiment_1 description: Test Experiment 1 - expiry: 2023/08/01 + expiry: 2023/08/30 owner: blah@abc.com test_tags: [experiments_tag_test] - name: test_experiment_2 description: Test Experiment 2 - expiry: 2023/01/01 + expiry: 2023/01/30 owner: blah1@abc.com - name: test_experiment_3 description: Test Experiment 3 - expiry: 2024/01/01 + expiry: 2024/01/30 owner: blah2@abc.com - name: test_experiment_4 description: Test Experiment 4 - expiry: 2022/01/01 + expiry: 2022/01/30 owner: blah3@abc.com diff --git a/test/distrib/bazel/test_single_bazel_version.sh b/test/distrib/bazel/test_single_bazel_version.sh index ecbb8a82f7ad0..e3e8d63af9d95 100755 --- a/test/distrib/bazel/test_single_bazel_version.sh +++ b/test/distrib/bazel/test_single_bazel_version.sh @@ -63,7 +63,7 @@ EXCLUDED_TARGETS=( # Analyzing windows toolchains when running on linux results in an error. # Since bazel distribtests are run on linux, we exclude the windows RBE toolchains. - "-//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/..." + "-//third_party/toolchains/rbe_windows_vs2022_bazel7/..." "-//third_party/toolchains:rbe_windows_default_toolchain_suite" # Exclude bazelified tests as they contain some bazel hackery diff --git a/third_party/opentelemetry-cpp b/third_party/opentelemetry-cpp index a388e87d72b83..955a807c04615 160000 --- a/third_party/opentelemetry-cpp +++ b/third_party/opentelemetry-cpp @@ -1 +1 @@ -Subproject commit a388e87d72b8321c189c8d41edb746ffa687ce3c +Subproject commit 955a807c0461544560429c2414b8967f6023e590 diff --git a/third_party/toolchains/BUILD b/third_party/toolchains/BUILD index 6f81bfc6ce300..a15ed3817d261 100644 --- a/third_party/toolchains/BUILD +++ b/third_party/toolchains/BUILD @@ -21,13 +21,13 @@ package(default_visibility = ["//visibility:public"]) # The default toolchain suite for RBE linux, pass it to --crosstool_top alias( name = "rbe_linux_default_toolchain_suite", - actual = "//third_party/toolchains/rbe_ubuntu2004/cc:toolchain", + actual = "//third_party/toolchains/rbe_ubuntu2004_bazel7/cc:toolchain", ) # The default CC toolchain suite for RBE linux alias( name = "rbe_linux_default_cc_toolchain", - actual = "//third_party/toolchains/rbe_ubuntu2004/config:cc-toolchain", + actual = "//third_party/toolchains/rbe_ubuntu2004_bazel7/config:cc-toolchain", ) # The default platform for RBE Linux @@ -46,19 +46,19 @@ platform( os_family = "Linux", ), # Inherit from the platform target generated by 'rbe_configs_gen'. - parents = ["//third_party/toolchains/rbe_ubuntu2004/config:platform"], + parents = ["//third_party/toolchains/rbe_ubuntu2004_bazel7/config:platform"], ) # The default toolchain suite for RBE windows, pass it to --crosstool_top alias( name = "rbe_windows_default_toolchain_suite", - actual = "//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc:toolchain", + actual = "//third_party/toolchains/rbe_windows_vs2022_bazel7/cc:toolchain", ) # The default CC toolchain suite for RBE windows alias( name = "rbe_windows_default_cc_toolchain", - actual = "//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/config:cc-toolchain", + actual = "//third_party/toolchains/rbe_windows_vs2022_bazel7/config:cc-toolchain", ) # The default platform for RBE windows @@ -73,5 +73,5 @@ platform( os_family = "Windows", ), # Inherit from the platform target generated by 'rbe_configs_gen'. - parents = ["//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/config:platform"], + parents = ["//third_party/toolchains/rbe_windows_vs2022_bazel7/config:platform"], ) diff --git a/third_party/toolchains/README.md b/third_party/toolchains/README.md index b776d8c85fc26..7c661b209b420 100644 --- a/third_party/toolchains/README.md +++ b/third_party/toolchains/README.md @@ -1,12 +1,13 @@ # RBE toolchain configuration (Linux and Windows) ## Linux -The `rbe_ubuntu2004` directory contains the autogenerated toolchain configuration for linux RBE. + +The `rbe_ubuntu2004_bazel7` directory contains the autogenerated toolchain configuration for linux RBE. Run `generate_linux_rbe_configs.sh` to regenerate. ## Windows -The `rbe_windows_bazel_7.3.1_vs2022` directory contains the autogenerated toolchain configuration for windows RBE. +The `rbe_windows_vs2022_bazel7` directory contains the autogenerated toolchain configuration for windows RBE. The configuration was generated by the `rbe_configs_gen` tool (just as the linux RBE config), but since it's a windows configuration, it needs to be run on a windows machine. diff --git a/third_party/toolchains/generate_linux_rbe_configs.sh b/third_party/toolchains/generate_linux_rbe_configs.sh index b1a5ad022c136..1faa69d8f6c47 100755 --- a/third_party/toolchains/generate_linux_rbe_configs.sh +++ b/third_party/toolchains/generate_linux_rbe_configs.sh @@ -42,12 +42,12 @@ LINUX_RBE_DOCKER_IMAGE=$(cat ${LINUX_RBE_DOCKERFILE_DIR}.current_version) # Bazel version used for configuring # Needs to be the oldest of the versions from bazel/supported_versions.txt chosen # so that the result is compatible with other supported bazel versions. -BAZEL_VERSION=7.3.1 +BAZEL_VERSION=7.4.1 # TODO(jtattermusch): experiment with --cpp_env_json to simplify bazel build configuration. # Where to store the generated configs (relative to repo root) -CONFIG_OUTPUT_PATH=third_party/toolchains/rbe_ubuntu2004 +CONFIG_OUTPUT_PATH=third_party/toolchains/rbe_ubuntu2004_bazel7 # Delete old generated configs. rm -rf "${REPO_ROOT}/${CONFIG_OUTPUT_PATH}" diff --git a/third_party/toolchains/generate_windows_rbe_configs.sh b/third_party/toolchains/generate_windows_rbe_configs.sh index 4a74480c646c4..31a4d915665a9 100755 --- a/third_party/toolchains/generate_windows_rbe_configs.sh +++ b/third_party/toolchains/generate_windows_rbe_configs.sh @@ -33,10 +33,10 @@ WINDOWS_RBE_DOCKER_IMAGE=us-docker.pkg.dev/grpc-testing/testing-images-public/rb # Bazel version used for configuring # Needs to be one of the versions from bazel/supported_versions.txt chosen so that the result is compatible # with other supported bazel versions. -BAZEL_VERSION=7.3.1 +BAZEL_VERSION=7.4.1 # Where to store the generated configs (relative to repo root) -CONFIG_OUTPUT_PATH=third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022 +CONFIG_OUTPUT_PATH=third_party/toolchains/rbe_windows_vs2022_bazel7 # Delete old generated configs. rm -rf "${REPO_ROOT}/${CONFIG_OUTPUT_PATH}" diff --git a/third_party/toolchains/rbe_ubuntu2004/LICENSE b/third_party/toolchains/rbe_ubuntu2004_bazel7/LICENSE similarity index 100% rename from third_party/toolchains/rbe_ubuntu2004/LICENSE rename to third_party/toolchains/rbe_ubuntu2004_bazel7/LICENSE diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/BUILD b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/BUILD similarity index 70% rename from third_party/toolchains/rbe_ubuntu2004/cc/BUILD rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/BUILD index f993e63333e0f..4398be4d0eb62 100644 --- a/third_party/toolchains/rbe_ubuntu2004/cc/BUILD +++ b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/BUILD @@ -14,9 +14,9 @@ # This becomes the BUILD file for @local_config_cc// under non-BSD unixes. -load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite") -load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") load(":cc_toolchain_config.bzl", "cc_toolchain_config") +load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") +load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite") package(default_visibility = ["//visibility:public"]) @@ -54,15 +54,16 @@ filegroup( srcs = ["cc_wrapper.sh"], ) +filegroup( + name = "validate_static_library", + srcs = ["validate_static_library.sh"], +) + filegroup( name = "compiler_deps", - srcs = glob( - ["extra_tools/**"], - allow_empty = True, - ) + [ - ":builtin_include_directory_paths", - ":cc_wrapper", - ], + srcs = glob(["extra_tools/**"], allow_empty = True) + [":builtin_include_directory_paths", + ":cc_wrapper", + ":validate_static_library"], ) # This is the entry point for --crosstool_top. Toolchains are found @@ -80,87 +81,42 @@ cc_toolchain_suite( cc_toolchain( name = "cc-compiler-k8", + toolchain_identifier = "linux_gnu_x86", + toolchain_config = ":linux_gnu_x86", all_files = ":compiler_deps", ar_files = ":compiler_deps", as_files = ":compiler_deps", compiler_files = ":compiler_deps", dwp_files = ":empty", linker_files = ":compiler_deps", - module_map = ":module.modulemap", objcopy_files = ":empty", strip_files = ":empty", supports_header_parsing = 1, supports_param_files = 1, - toolchain_config = ":linux_gnu_x86", - toolchain_identifier = "linux_gnu_x86", + module_map = ":module.modulemap", ) cc_toolchain_config( name = "linux_gnu_x86", - abi_libc_version = "glibc_2.19", - abi_version = "clang", - compile_flags = [ - "-fstack-protector", - "-Wall", - "-Wthread-safety", - "-Wself-assign", - "-Wunused-but-set-parameter", - "-Wno-free-nonheap-object", - "-fcolor-diagnostics", - "-fno-omit-frame-pointer", - ], - compiler = "clang", - conly_flags = [], - coverage_compile_flags = ["--coverage"], - coverage_link_flags = ["--coverage"], cpu = "k8", - cxx_builtin_include_directories = [ - "/usr/local/lib/clang/19/include", - "/usr/local/include", - "/usr/include/x86_64-linux-gnu", - "/usr/include", - "/usr/local/lib/clang/19/share", - "/usr/include/c++/9", - "/usr/include/x86_64-linux-gnu/c++/9", - "/usr/include/c++/9/backward", - "/usr/local/include/c++/v1", - "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk", - ], - cxx_flags = ["-std=c++14"], - dbg_compile_flags = ["-g"], - extra_flags_per_feature = {"use_module_maps": [ - "-Xclang", - "-fno-cxx-modules", - ]}, + compiler = "clang", + toolchain_identifier = "linux_gnu_x86", host_system_name = "i686-unknown-linux-gnu", - link_flags = [ - "-fuse-ld=/usr/local/bin/ld.lld", - "-B/usr/local/bin", - "-Wl,-no-as-needed", - "-Wl,-z,relro,-z,now", - ], - link_libs = [ - "-Wl,--push-state,-as-needed", - "-lstdc++", - "-Wl,--pop-state", - "-Wl,--push-state,-as-needed", - "-lm", - "-Wl,--pop-state", - ], - opt_compile_flags = [ - "-g0", - "-O2", - "-D_FORTIFY_SOURCE=1", - "-DNDEBUG", - "-ffunction-sections", - "-fdata-sections", - ], - opt_link_flags = ["-Wl,--gc-sections"], - supports_start_end_lib = True, - target_libc = "glibc_2.19", target_system_name = "x86_64-unknown-linux-gnu", - tool_paths = { - "ar": "/usr/bin/ar", + target_libc = "glibc_2.19", + abi_version = "clang", + abi_libc_version = "glibc_2.19", + cxx_builtin_include_directories = ["/usr/local/lib/clang/19/include", + "/usr/local/include", + "/usr/include/x86_64-linux-gnu", + "/usr/include", + "/usr/local/lib/clang/19/share", + "/usr/include/c++/9", + "/usr/include/x86_64-linux-gnu/c++/9", + "/usr/include/c++/9/backward", + "/usr/local/include/c++/v1", + "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk"], + tool_paths = {"ar": "/usr/bin/ar", "ld": "/usr/bin/ld", "llvm-cov": "/usr/local/bin/llvm-cov", "llvm-profdata": "/usr/local/bin/llvm-profdata", @@ -172,21 +128,53 @@ cc_toolchain_config( "objcopy": "/usr/bin/objcopy", "objdump": "/usr/bin/objdump", "strip": "/usr/bin/strip", + "c++filt": "/usr/bin/c++filt", "parse_headers": "cc_wrapper.sh", - }, - toolchain_identifier = "linux_gnu_x86", - unfiltered_compile_flags = [ - "-no-canonical-prefixes", - "-Wno-builtin-macro-redefined", - "-D__DATE__=\"redacted\"", - "-D__TIMESTAMP__=\"redacted\"", - "-D__TIME__=\"redacted\"", - ], + "validate_static_library": "validate_static_library.sh"}, + compile_flags = ["-fstack-protector", + "-Wall", + "-Wthread-safety", + "-Wself-assign", + "-Wunused-but-set-parameter", + "-Wno-free-nonheap-object", + "-fcolor-diagnostics", + "-fno-omit-frame-pointer"], + opt_compile_flags = ["-g0", + "-O2", + "-D_FORTIFY_SOURCE=1", + "-DNDEBUG", + "-ffunction-sections", + "-fdata-sections"], + dbg_compile_flags = ["-g"], + conly_flags = [], + cxx_flags = ["-std=c++14"], + link_flags = ["-fuse-ld=/usr/local/bin/ld.lld", + "-B/usr/local/bin", + "-Wl,-no-as-needed", + "-Wl,-z,relro,-z,now"], + link_libs = ["-Wl,--push-state,-as-needed", + "-lstdc++", + "-Wl,--pop-state", + "-Wl,--push-state,-as-needed", + "-lm", + "-Wl,--pop-state"], + opt_link_flags = ["-Wl,--gc-sections"], + unfiltered_compile_flags = ["-no-canonical-prefixes", + "-Wno-builtin-macro-redefined", + "-D__DATE__=\"redacted\"", + "-D__TIMESTAMP__=\"redacted\"", + "-D__TIME__=\"redacted\""], + coverage_compile_flags = ["--coverage"], + coverage_link_flags = ["--coverage"], + supports_start_end_lib = True, + extra_flags_per_feature = {"use_module_maps": ["-Xclang", "-fno-cxx-modules"]}, ) # Android tooling requires a default toolchain for the armeabi-v7a cpu. cc_toolchain( name = "cc-compiler-armeabi-v7a", + toolchain_identifier = "stub_armeabi-v7a", + toolchain_config = ":stub_armeabi-v7a", all_files = ":empty", ar_files = ":empty", as_files = ":empty", @@ -196,8 +184,6 @@ cc_toolchain( objcopy_files = ":empty", strip_files = ":empty", supports_param_files = 1, - toolchain_config = ":stub_armeabi-v7a", - toolchain_identifier = "stub_armeabi-v7a", ) armeabi_cc_toolchain_config(name = "stub_armeabi-v7a") diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/REPO.bazel b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/REPO.bazel old mode 100755 new mode 100644 similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/REPO.bazel rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/REPO.bazel diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/WORKSPACE b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/WORKSPACE similarity index 100% rename from third_party/toolchains/rbe_ubuntu2004/cc/WORKSPACE rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/WORKSPACE diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/armeabi_cc_toolchain_config.bzl b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/armeabi_cc_toolchain_config.bzl similarity index 100% rename from third_party/toolchains/rbe_ubuntu2004/cc/armeabi_cc_toolchain_config.bzl rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/armeabi_cc_toolchain_config.bzl diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/builtin_include_directory_paths b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/builtin_include_directory_paths similarity index 100% rename from third_party/toolchains/rbe_ubuntu2004/cc/builtin_include_directory_paths rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/builtin_include_directory_paths diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/cc_toolchain_config.bzl b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/cc_toolchain_config.bzl similarity index 84% rename from third_party/toolchains/rbe_ubuntu2004/cc/cc_toolchain_config.bzl rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/cc_toolchain_config.bzl index b25f26e4e0655..1dd0e7a6e7ad0 100644 --- a/third_party/toolchains/rbe_ubuntu2004/cc/cc_toolchain_config.bzl +++ b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/cc_toolchain_config.bzl @@ -222,6 +222,8 @@ def _sanitizer_feature(name = "", specific_compile_flags = [], specific_link_fla ) def _impl(ctx): + is_linux = ctx.attr.target_libc != "macosx" + tool_paths = [ tool_path(name = name, path = path) for name, path in ctx.attr.tool_paths.items() @@ -249,6 +251,25 @@ def _impl(ctx): action_configs.append(llvm_cov_action) action_configs.append(objcopy_action) + validate_static_library = ctx.attr.tool_paths.get("validate_static_library") + if validate_static_library: + validate_static_library_action = action_config( + action_name = ACTION_NAMES.validate_static_library, + tools = [ + tool( + path = validate_static_library, + ), + ], + ) + action_configs.append(validate_static_library_action) + + symbol_check = feature( + name = "symbol_check", + implies = [ACTION_NAMES.validate_static_library], + ) + else: + symbol_check = None + supports_pic_feature = feature( name = "supports_pic", enabled = True, @@ -593,69 +614,134 @@ def _impl(ctx): provides = ["profile"], ) - runtime_library_search_directories_feature = feature( - name = "runtime_library_search_directories", - flag_sets = [ - flag_set( - actions = all_link_actions + lto_index_actions, - flag_groups = [ - flag_group( - iterate_over = "runtime_library_search_directories", - flag_groups = [ - flag_group( - flags = [ - "-Xlinker", - "-rpath", - "-Xlinker", - "$EXEC_ORIGIN/%{runtime_library_search_directories}", - ], - expand_if_true = "is_cc_test", - ), - flag_group( - flags = [ - "-Xlinker", - "-rpath", - "-Xlinker", - "$ORIGIN/%{runtime_library_search_directories}", - ], - expand_if_false = "is_cc_test", - ), - ], - expand_if_available = - "runtime_library_search_directories", - ), - ], - with_features = [ - with_feature_set(features = ["static_link_cpp_runtimes"]), - ], - ), - flag_set( - actions = all_link_actions + lto_index_actions, - flag_groups = [ - flag_group( - iterate_over = "runtime_library_search_directories", - flag_groups = [ - flag_group( - flags = [ - "-Xlinker", - "-rpath", - "-Xlinker", - "$ORIGIN/%{runtime_library_search_directories}", - ], - ), - ], - expand_if_available = - "runtime_library_search_directories", - ), - ], - with_features = [ - with_feature_set( - not_features = ["static_link_cpp_runtimes"], - ), - ], - ), - ], - ) + if is_linux: + runtime_library_search_directories_feature = feature( + name = "runtime_library_search_directories", + flag_sets = [ + flag_set( + actions = all_link_actions + lto_index_actions, + flag_groups = [ + flag_group( + iterate_over = "runtime_library_search_directories", + flag_groups = [ + flag_group( + flags = [ + "-Xlinker", + "-rpath", + "-Xlinker", + "$EXEC_ORIGIN/%{runtime_library_search_directories}", + ], + expand_if_true = "is_cc_test", + ), + flag_group( + flags = [ + "-Xlinker", + "-rpath", + "-Xlinker", + "$ORIGIN/%{runtime_library_search_directories}", + ], + expand_if_false = "is_cc_test", + ), + ], + expand_if_available = + "runtime_library_search_directories", + ), + ], + with_features = [ + with_feature_set(features = ["static_link_cpp_runtimes"]), + ], + ), + flag_set( + actions = all_link_actions + lto_index_actions, + flag_groups = [ + flag_group( + iterate_over = "runtime_library_search_directories", + flag_groups = [ + flag_group( + flags = [ + "-Xlinker", + "-rpath", + "-Xlinker", + "$ORIGIN/%{runtime_library_search_directories}", + ], + ), + ], + expand_if_available = + "runtime_library_search_directories", + ), + ], + with_features = [ + with_feature_set( + not_features = ["static_link_cpp_runtimes"], + ), + ], + ), + ], + ) + set_install_name_feature = feature( + name = "set_soname", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ], + flag_groups = [ + flag_group( + flags = [ + "-Wl,-soname,%{runtime_solib_name}", + ], + expand_if_available = "runtime_solib_name", + ), + ], + ), + ], + ) + else: + runtime_library_search_directories_feature = feature( + name = "runtime_library_search_directories", + flag_sets = [ + flag_set( + actions = all_link_actions + lto_index_actions, + flag_groups = [ + flag_group( + iterate_over = "runtime_library_search_directories", + flag_groups = [ + flag_group( + flags = [ + "-Xlinker", + "-rpath", + "-Xlinker", + "@loader_path/%{runtime_library_search_directories}", + ], + ), + ], + expand_if_available = "runtime_library_search_directories", + ), + ], + ), + ], + ) + set_install_name_feature = feature( + name = "set_install_name", + enabled = ctx.fragments.cpp.do_not_use_macos_set_install_name, + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ], + flag_groups = [ + flag_group( + flags = [ + "-Wl,-install_name,@rpath/%{runtime_solib_name}", + ], + expand_if_available = "runtime_solib_name", + ), + ], + ), + ], + ) fission_support_feature = feature( name = "fission_support", @@ -884,11 +970,77 @@ def _impl(ctx): ], ) + libraries_to_link_common_flag_groups = [ + flag_group( + flags = ["-Wl,-whole-archive"], + expand_if_true = + "libraries_to_link.is_whole_archive", + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "static_library", + ), + ), + flag_group( + flags = ["%{libraries_to_link.object_files}"], + iterate_over = "libraries_to_link.object_files", + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "object_file_group", + ), + ), + flag_group( + flags = ["%{libraries_to_link.name}"], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "object_file", + ), + ), + flag_group( + flags = ["%{libraries_to_link.name}"], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "interface_library", + ), + ), + flag_group( + flags = ["%{libraries_to_link.name}"], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "static_library", + ), + ), + flag_group( + flags = ["-l%{libraries_to_link.name}"], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "dynamic_library", + ), + ), + flag_group( + flags = ["-l:%{libraries_to_link.name}"], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "versioned_dynamic_library", + ), + ), + flag_group( + flags = ["-Wl,-no-whole-archive"], + expand_if_true = "libraries_to_link.is_whole_archive", + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "static_library", + ), + ), + ] + libraries_to_link_feature = feature( name = "libraries_to_link", flag_sets = [ flag_set( - actions = all_link_actions + lto_index_actions, + actions = [ + ACTION_NAMES.cpp_link_executable, + ACTION_NAMES.cpp_link_dynamic_library, + ] + lto_index_actions, flag_groups = [ flag_group( iterate_over = "libraries_to_link", @@ -900,66 +1052,7 @@ def _impl(ctx): value = "object_file_group", ), ), - flag_group( - flags = ["-Wl,-whole-archive"], - expand_if_true = - "libraries_to_link.is_whole_archive", - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "static_library", - ), - ), - flag_group( - flags = ["%{libraries_to_link.object_files}"], - iterate_over = "libraries_to_link.object_files", - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "object_file_group", - ), - ), - flag_group( - flags = ["%{libraries_to_link.name}"], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "object_file", - ), - ), - flag_group( - flags = ["%{libraries_to_link.name}"], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "interface_library", - ), - ), - flag_group( - flags = ["%{libraries_to_link.name}"], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "static_library", - ), - ), - flag_group( - flags = ["-l%{libraries_to_link.name}"], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "dynamic_library", - ), - ), - flag_group( - flags = ["-l:%{libraries_to_link.name}"], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "versioned_dynamic_library", - ), - ), - flag_group( - flags = ["-Wl,-no-whole-archive"], - expand_if_true = "libraries_to_link.is_whole_archive", - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "static_library", - ), - ), + ] + libraries_to_link_common_flag_groups + [ flag_group( flags = ["-Wl,--end-lib"], expand_if_equal = variable_with_value( @@ -976,6 +1069,22 @@ def _impl(ctx): ), ], ), + # Object file groups may contain symbols that aren't referenced in the same target that + # produces the object files and must thus not be wrapped in --start-lib/--end-lib when + # linking a nodeps dynamic library. + flag_set( + actions = [ACTION_NAMES.cpp_link_nodeps_dynamic_library], + flag_groups = [ + flag_group( + iterate_over = "libraries_to_link", + flag_groups = libraries_to_link_common_flag_groups, + ), + flag_group( + flags = ["-Wl,@%{thinlto_param_file}"], + expand_if_true = "thinlto_param_file", + ), + ], + ), ], ) @@ -1044,7 +1153,6 @@ def _impl(ctx): ], ) - is_linux = ctx.attr.target_libc != "macosx" libtool_feature = feature( name = "libtool", enabled = not is_linux, @@ -1486,6 +1594,7 @@ def _impl(ctx): unfiltered_compile_flags_feature, treat_warnings_as_errors_feature, archive_param_file_feature, + set_install_name_feature, ] + layering_check_features(ctx.attr.compiler, ctx.attr.extra_flags_per_feature, is_macos = False) else: # macOS artifact name patterns differ from the defaults only for dynamic @@ -1500,6 +1609,8 @@ def _impl(ctx): features = [ macos_minimum_os_feature, macos_default_link_flags_feature, + runtime_library_search_directories_feature, + set_install_name_feature, libtool_feature, archiver_flags_feature, asan_feature, @@ -1535,6 +1646,9 @@ def _impl(ctx): action_configs += parse_headers_action_configs features += parse_headers_features + if symbol_check: + features.append(symbol_check) + return cc_common.create_cc_toolchain_config_info( ctx = ctx, features = features, @@ -1586,6 +1700,6 @@ cc_toolchain_config = rule( name = "xcode_config_label", )), }, - fragments = ["apple"], + fragments = ["apple", "cpp"], provides = [CcToolchainConfigInfo], ) diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/cc_wrapper.sh b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/cc_wrapper.sh similarity index 100% rename from third_party/toolchains/rbe_ubuntu2004/cc/cc_wrapper.sh rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/cc_wrapper.sh diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/module.modulemap b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/module.modulemap similarity index 100% rename from third_party/toolchains/rbe_ubuntu2004/cc/module.modulemap rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/module.modulemap diff --git a/third_party/toolchains/rbe_ubuntu2004/cc/tools/cpp/empty.cc b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/tools/cpp/empty.cc similarity index 100% rename from third_party/toolchains/rbe_ubuntu2004/cc/tools/cpp/empty.cc rename to third_party/toolchains/rbe_ubuntu2004_bazel7/cc/tools/cpp/empty.cc diff --git a/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/validate_static_library.sh b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/validate_static_library.sh new file mode 100644 index 0000000000000..6c959e4a57f47 --- /dev/null +++ b/third_party/toolchains/rbe_ubuntu2004_bazel7/cc/validate_static_library.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# +# Copyright 2023 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -euo pipefail + +# Find all duplicate symbols in the given static library: +# 1. Use nm to list all global symbols in the library in POSIX format: +# libstatic.a[my_object.o]: my_function T 1234 abcd +# 2. Use sed to transform the output to a format that can be sorted by symbol +# name and is readable by humans: +# my_object.o: T my_function +# By using the `t` and `d` commands, lines for symbols of type U (undefined) +# as well as V and W (weak) and their local lowercase variants are removed. +# 3. Use sort to sort the lines by symbol name. +# 4. Use uniq to only keep the lines corresponding to duplicate symbols. +# 5. Use c++filt to demangle the symbol names. +# c++filt is applied to the duplicated symbols instead of using the -C flag +# of nm because it is not in POSIX and demangled names may not be unique +# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35201). +DUPLICATE_SYMBOLS=$( + "/usr/bin/nm" -A -g -P "$1" | + sed -E -e 's/.*\[([^][]+)\]: (.+) ([A-TX-Z]) [a-f0-9]+ [a-f0-9]+/\1: \3 \2/g' -e t -e d | + LC_ALL=C sort -k 3 | + LC_ALL=C uniq -D -f 2 | + "/usr/bin/c++filt") +if [[ -n "$DUPLICATE_SYMBOLS" ]]; then + >&2 echo "Duplicate symbols found in $1:" + >&2 echo "$DUPLICATE_SYMBOLS" + exit 1 +else + touch "$2" +fi diff --git a/third_party/toolchains/rbe_ubuntu2004/config/BUILD b/third_party/toolchains/rbe_ubuntu2004_bazel7/config/BUILD similarity index 94% rename from third_party/toolchains/rbe_ubuntu2004/config/BUILD rename to third_party/toolchains/rbe_ubuntu2004_bazel7/config/BUILD index 6e61e647c17f4..12136e5a68040 100755 --- a/third_party/toolchains/rbe_ubuntu2004/config/BUILD +++ b/third_party/toolchains/rbe_ubuntu2004_bazel7/config/BUILD @@ -17,6 +17,7 @@ package(default_visibility = ["//visibility:public"]) + toolchain( name = "cc-toolchain", exec_compatible_with = [ @@ -28,12 +29,13 @@ toolchain( "@platforms//os:linux", "@platforms//cpu:x86_64", ], - toolchain = "//third_party/toolchains/rbe_ubuntu2004/cc:cc-compiler-k8", + toolchain = "//third_party/toolchains/rbe_ubuntu2004_bazel7/cc:cc-compiler-k8", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", ) platform( name = "platform", + parents = ["@local_config_platform//:host"], constraint_values = [ "@platforms//os:linux", "@platforms//cpu:x86_64", @@ -43,5 +45,4 @@ platform( "container-image": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rbe_ubuntu2004@sha256:b3eb1a17b7b091e3c5648a803076b2c40601242ff91c04d55997af6641305f68", "OSFamily": "Linux", }, - parents = ["@local_config_platform//:host"], ) diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/LICENSE b/third_party/toolchains/rbe_windows_vs2022_bazel7/LICENSE similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/LICENSE rename to third_party/toolchains/rbe_windows_vs2022_bazel7/LICENSE diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/BUILD b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/BUILD similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/BUILD rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/BUILD diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/WORKSPACE b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/REPO.bazel similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/WORKSPACE rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/REPO.bazel diff --git a/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/WORKSPACE b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/WORKSPACE new file mode 100755 index 0000000000000..e69de29bb2d1d diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/armeabi_cc_toolchain_config.bzl b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/armeabi_cc_toolchain_config.bzl similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/armeabi_cc_toolchain_config.bzl rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/armeabi_cc_toolchain_config.bzl diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/builtin_include_directory_paths_clangcl b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/builtin_include_directory_paths_clangcl similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/builtin_include_directory_paths_clangcl rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/builtin_include_directory_paths_clangcl diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/builtin_include_directory_paths_mingw b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/builtin_include_directory_paths_mingw similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/builtin_include_directory_paths_mingw rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/builtin_include_directory_paths_mingw diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/builtin_include_directory_paths_msvc b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/builtin_include_directory_paths_msvc similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/builtin_include_directory_paths_msvc rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/builtin_include_directory_paths_msvc diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/clang_installation_error.bat b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/clang_installation_error.bat similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/clang_installation_error.bat rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/clang_installation_error.bat diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/get_env.bat b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/get_env.bat similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/get_env.bat rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/get_env.bat diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/msys_gcc_installation_error.bat b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/msys_gcc_installation_error.bat similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/msys_gcc_installation_error.bat rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/msys_gcc_installation_error.bat diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/vc_installation_error_arm.bat b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/vc_installation_error_arm.bat similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/vc_installation_error_arm.bat rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/vc_installation_error_arm.bat diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/vc_installation_error_arm64.bat b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/vc_installation_error_arm64.bat similarity index 100% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/vc_installation_error_arm64.bat rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/vc_installation_error_arm64.bat diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/windows_cc_toolchain_config.bzl b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/windows_cc_toolchain_config.bzl similarity index 99% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/windows_cc_toolchain_config.bzl rename to third_party/toolchains/rbe_windows_vs2022_bazel7/cc/windows_cc_toolchain_config.bzl index 183fedad041c9..5a470eabda8af 100755 --- a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc/windows_cc_toolchain_config.bzl +++ b/third_party/toolchains/rbe_windows_vs2022_bazel7/cc/windows_cc_toolchain_config.bzl @@ -1124,6 +1124,17 @@ def _impl(ctx): ], implies = ["msvc_compile_env", "msvc_link_env"], ) + + symbol_check_feature = feature( + name = "symbol_check", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.cpp_link_static_library], + flag_groups = [flag_group(flags = ["/WX:4006"])], + ), + ], + ) + features = [ no_legacy_features_feature, nologo_feature, @@ -1174,6 +1185,7 @@ def _impl(ctx): no_windows_export_all_symbols_feature, supports_dynamic_linker_feature, supports_interface_shared_libraries_feature, + symbol_check_feature, ] else: targets_windows_feature = feature( diff --git a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/config/BUILD b/third_party/toolchains/rbe_windows_vs2022_bazel7/config/BUILD similarity index 93% rename from third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/config/BUILD rename to third_party/toolchains/rbe_windows_vs2022_bazel7/config/BUILD index ac4134bb465c8..7c0f6165d6a48 100755 --- a/third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/config/BUILD +++ b/third_party/toolchains/rbe_windows_vs2022_bazel7/config/BUILD @@ -28,7 +28,7 @@ toolchain( "@platforms//os:windows", "@platforms//cpu:x86_64", ], - toolchain = "//third_party/toolchains/rbe_windows_bazel_7.3.1_vs2022/cc:cc-compiler-x64_windows", + toolchain = "//third_party/toolchains/rbe_windows_vs2022_bazel7/cc:cc-compiler-x64_windows", toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", ) diff --git a/tools/codegen/core/experiments_compiler.py b/tools/codegen/core/experiments_compiler.py index 3d3cc2ee13d44..743a5bd38d2d8 100644 --- a/tools/codegen/core/experiments_compiler.py +++ b/tools/codegen/core/experiments_compiler.py @@ -218,16 +218,27 @@ def __init__(self, attributes): def IsValid(self, check_expiry=False): if self._error: return False - if not check_expiry: - return True if ( self._name == "monitoring_experiment" and self._expiry == "never-ever" ): return True + expiry = datetime.datetime.strptime(self._expiry, "%Y/%m/%d").date() + if ( + expiry.month == 11 + or expiry.month == 12 + or (expiry.month == 1 and expiry.day < 15) + ): + print( + "For experiment %s: Experiment expiration is not allowed between Nov 1 and Jan 15 (experiment lists %s)." + % (self._name, self._expiry) + ) + self._error = True + return False + if not check_expiry: + return True today = datetime.date.today() two_quarters_from_now = today + datetime.timedelta(days=180) - expiry = datetime.datetime.strptime(self._expiry, "%Y/%m/%d").date() if expiry < today: print( "WARNING: experiment %s expired on %s" diff --git a/tools/run_tests/sanity/check_bazel_workspace.py b/tools/run_tests/sanity/check_bazel_workspace.py index cc825901aaeb9..e6ebd880cf102 100755 --- a/tools/run_tests/sanity/check_bazel_workspace.py +++ b/tools/run_tests/sanity/check_bazel_workspace.py @@ -59,8 +59,6 @@ "com_google_fuzztest", "io_opencensus_cpp", "io_opentelemetry_cpp", - # TODO(stanleycheung): remove when prometheus-cpp has new release - "com_github_jupp0r_prometheus_cpp", "envoy_api", _BAZEL_SKYLIB_DEP_NAME, _BAZEL_TOOLCHAINS_DEP_NAME, @@ -91,8 +89,6 @@ "com_google_absl", "com_google_fuzztest", "io_opencensus_cpp", - # TODO(stanleycheung): remove when prometheus-cpp has new release - "com_github_jupp0r_prometheus_cpp", _BAZEL_SKYLIB_DEP_NAME, _BAZEL_TOOLCHAINS_DEP_NAME, _BAZEL_COMPDB_DEP_NAME, @@ -191,6 +187,10 @@ def grpc_python_deps(self): for dep_name in _GRPC_BAZEL_ONLY_DEPS: names_without_bazel_only_deps.remove(dep_name) archive_urls = [names_and_urls[name] for name in names_without_bazel_only_deps] +for url in archive_urls: + if re.search(git_hash_pattern, url) is None: + print("Cannot find the hash value from url", url) + sys.exit(1) workspace_git_hashes = { re.search(git_hash_pattern, url).group() for url in archive_urls } diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh index fd6c9bd82ecc6..d0568a8a249b7 100755 --- a/tools/run_tests/sanity/check_submodules.sh +++ b/tools/run_tests/sanity/check_submodules.sh @@ -35,7 +35,7 @@ third_party/googleapis fe8ba054ad4f7eca946c2d14a63c3f07c0b586a0 third_party/googletest 2dd1c131950043a8ad5ab0d2dda0e0970596586a third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89 third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df -third_party/opentelemetry-cpp a388e87d72b8321c189c8d41edb746ffa687ce3c +third_party/opentelemetry-cpp 955a807c0461544560429c2414b8967f6023e590 third_party/protobuf 2d4414f384dc499af113b5991ce3eaa9df6dd931 third_party/protoc-gen-validate 32c2415389a3538082507ae537e7edd9578c64ed third_party/re2 0c5616df9c0aaa44c9440d87422012423d91c7d1