Skip to content

Commit

Permalink
[CI] Updated Buildtools to 7.3.1 (grpc#38397)
Browse files Browse the repository at this point in the history
This is a prerequisite to getting a upcoming buildifier release.

Closes grpc#38397

PiperOrigin-RevId: 713341592
  • Loading branch information
veblush authored and pawbhard committed Jan 9, 2025
1 parent 363ad7d commit f2f5c07
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bazel/cc_grpc_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def cc_grpc_library(
proto_only = False,
well_known_protos = False,
generate_mocks = False,
use_external = False,
use_external = False, # @unused
grpc_only = False,
**kwargs):
"""Generates C++ grpc classes for services defined in a proto file.
Expand Down
2 changes: 1 addition & 1 deletion bazel/grpc_build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def grpc_cc_library(
defines = [],
deps = [],
select_deps = None,
standalone = False,
standalone = False, # @unused
language = "C++",
testonly = False,
visibility = None,
Expand Down
2 changes: 1 addition & 1 deletion examples/python/observability/csm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

load("@grpc_python_dependencies//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_python//python:defs.bzl", "py_binary")
load("//bazel:python_rules.bzl", "py_grpc_library", "py_proto_library")

# TODO(xuanwn): Instead of using Bazel build, we should pip install all dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/objective-c/grpc_objc_internal_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def proto_library_objc_wrapper(
name,
srcs,
deps = [],
use_well_known_protos = False):
use_well_known_protos = False): # @unused
"""proto_library for adding dependencies to google/protobuf protos.
Args:
Expand Down
2 changes: 1 addition & 1 deletion test/core/bad_client/generate_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def grpc_bad_client_tests():
"//:grpc_http_filters",
],
)
for t, topt in BAD_CLIENT_TESTS.items():
for t, _ in BAD_CLIENT_TESTS.items():
grpc_cc_test(
name = "%s_bad_client_test" % t,
srcs = ["tests/%s.cc" % t],
Expand Down
12 changes: 11 additions & 1 deletion test/core/test_util/grpc_fuzzer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@ with grpc_fuzz_test.

load("//bazel:grpc_build_system.bzl", "grpc_cc_proto_library", "grpc_cc_test", "grpc_internal_proto_library")

def grpc_fuzzer(name, corpus, owner = "grpc", srcs = [], tags = [], external_deps = [], deps = [], data = [], size = "large", **kwargs):
def grpc_fuzzer(
name,
corpus,
owner = "grpc", # @unused
srcs = [],
tags = [],
external_deps = [],
deps = [],
data = [],
size = "large",
**kwargs):
"""Instantiates a fuzzer test.
Args:
Expand Down
12 changes: 10 additions & 2 deletions tools/bazelify_tests/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
Contains macros used for running bazelified tests.
"""

load(":dockerimage_current_versions.bzl", "DOCKERIMAGE_CURRENT_VERSIONS")
load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict")
load(":dockerimage_current_versions.bzl", "DOCKERIMAGE_CURRENT_VERSIONS")

def _dockerized_sh_test(name, srcs = [], args = [], data = [], size = "medium", timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None, docker_run_as_root = False, env = {}):
"""Runs sh_test under docker either via RBE or via docker sandbox."""
Expand Down Expand Up @@ -245,7 +245,15 @@ def grpc_run_simple_command_test(name, args = [], data = [], size = "medium", ti
env = {}
_dockerized_sh_test(name = name, srcs = srcs, args = args, data = data, size = size, timeout = timeout, tags = tags, exec_compatible_with = exec_compatible_with, flaky = flaky, docker_image_version = docker_image_version, env = env, docker_run_as_root = False)

def grpc_build_artifact_task(name, timeout = None, artifact_deps = [], tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None, build_script = None):
def grpc_build_artifact_task(
name,
timeout = None, # @unused
artifact_deps = [],
tags = [],
exec_compatible_with = [],
flaky = None,
docker_image_version = None,
build_script = None):
"""Execute a build artifact task and a corresponding 'build test'.
The artifact is built by a genrule that always succeeds (Even if the underlying build fails)
Expand Down
2 changes: 1 addition & 1 deletion tools/bazelify_tests/test/bazel_distribtests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
Generates portability tests.
"""

load("supported_bazel_versions.bzl", "SUPPORTED_BAZEL_VERSIONS")
load("//tools/bazelify_tests:build_defs.bzl", "grpc_run_bazel_distribtest_test")
load("supported_bazel_versions.bzl", "SUPPORTED_BAZEL_VERSIONS")

_TEST_SHARDS = [
"buildtest",
Expand Down
14 changes: 8 additions & 6 deletions tools/distrib/buildifier_format_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,26 @@

set -e

BUILDIFIER_VERSION="4.2.2"
BUILDIFIER_VERSION="7.3.1"
TEMP_BUILDIFIER_PATH="/tmp/buildifier"
EXTRA_BUILDIFIER_FLAGS="$*"

function error_handling() {
error=$1
if [[ -x "$error" ]]; then
if [[ -n "$error" ]]; then
echo "${error}"
exit 1
fi
}

function download_buildifier() {
platform="$(uname -s)"
platform="$(uname -sm)"
case "${platform}" in
Linux*) download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDIFIER_VERSION}/buildifier";;
Darwin*) download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDIFIER_VERSION}/buildifier.mac";;
*) error_handling "Unsupported platform: ${platform}";;
"Linux x86_64") download_link="https://github.com/bazelbuild/buildtools/releases/download/v${BUILDIFIER_VERSION}/buildifier-linux-amd64";;
"Linux aarch64") download_link="https://github.com/bazelbuild/buildtools/releases/download/v${BUILDIFIER_VERSION}/buildifier-linux-arm64";;
"Darwin x86_64") download_link="https://github.com/bazelbuild/buildtools/releases/download/v${BUILDIFIER_VERSION}/buildifier-darwin-amd64";;
"Darwin arm64") download_link="https://github.com/bazelbuild/buildtools/releases/download/v${BUILDIFIER_VERSION}/buildifier-darwin-arm64";;
*) error_handling "Unsupported platform: ${platform}";;
esac

if [ -x "$(command -v curl)" ]; then
Expand Down
12 changes: 6 additions & 6 deletions tools/distrib/buildozer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

set -e

BUILDOZER_VERSION="4.2.2"
BUILDOZER_VERSION="7.3.1"
TEMP_BUILDOZER_PATH="/tmp/buildozer-for-grpc"

MAX_DOWNLOAD_RETRY=5
Expand All @@ -32,11 +32,11 @@ function error_handling() {
function download_buildozer() {
platform="$(uname -sm)"
case "${platform}" in
"Linux x86_64") download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-linux-amd64";;
"Linux aarch64") download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-linux-arm64";;
"Darwin x86_64") download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-darwin-amd64";;
"Darwin arm64") download_link="https://github.com/bazelbuild/buildtools/releases/download/${BUILDOZER_VERSION}/buildozer-darwin-arm64";;
*) error_handling "Unsupported platform: ${platform}";;
"Linux x86_64") download_link="https://github.com/bazelbuild/buildtools/releases/download/v${BUILDOZER_VERSION}/buildozer-linux-amd64";;
"Linux aarch64") download_link="https://github.com/bazelbuild/buildtools/releases/download/v${BUILDOZER_VERSION}/buildozer-linux-arm64";;
"Darwin x86_64") download_link="https://github.com/bazelbuild/buildtools/releases/download/v${BUILDOZER_VERSION}/buildozer-darwin-amd64";;
"Darwin arm64") download_link="https://github.com/bazelbuild/buildtools/releases/download/v${BUILDOZER_VERSION}/buildozer-darwin-arm64";;
*) error_handling "Unsupported platform: ${platform}";;
esac

download_success=0
Expand Down
1 change: 0 additions & 1 deletion tools/distrib/python/grpcio_tools/grpcio_tools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def _generate_copied_files_impl(ctx):
strip_prefix,
))
destination_path = dest + destination_path[len(strip_prefix):]
destination_dir = destination_path.rfind("/")
out_file = ctx.actions.declare_file(destination_path)
outs.append(out_file)
ctx.actions.run_shell(
Expand Down

0 comments on commit f2f5c07

Please sign in to comment.