Skip to content

Commit

Permalink
fix(compute): build with Bazel and MSVC (#12877)
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan authored Oct 11, 2023
1 parent 5862f09 commit ff11eda
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions ci/gha/builds/windows-bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ io::log_h1 "Get target list for: " "$@"
# on Windows. We need to clean things up before feeding them through bash.
#
# I (coryan@) do not understand why: `//examples` gets converted to `/examples`
# somewhere in the `printf ... | xargs -n 64 bazelisk ...` call. Using `///`
# seems to work.
mapfile -t targets < <(bazelisk "${args[@]}" query -- "$@" | tr -d '\r' | sed 's;//examples;///examples;g' | sort)
# somewhere in the `printf ... | xargs -n 64 bazelisk ...` call. Ditto for
# `//protos`. Using `///` seems to work.
mapfile -t targets < <(bazelisk "${args[@]}" query -- "$@" | tr -d '\r' | sed -e 's;//examples;///examples;g' -e 's;//protos;///protos;g' | sort)

io::log_h1 "Starting Build"
TIMEFORMAT="==> 🕑 bazel test done in %R seconds"
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/compute/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ load(":service_dirs.bzl", "operation_service_dirs", "service_dirs")
hdrs = [":" + service.replace("/v1/", "_hdrs")],
visibility = ["//:__pkg__"],
deps = [
"//protos/google/cloud/compute:google_cloud_cpp_compute_" + service.replace("/v1/", "") + "_cc_proto",
"//protos/google/cloud/compute:" + service.replace("/v1/", "") + "_cc_proto",
"//:common",
"//:grpc_utils",
"//google/cloud:google_cloud_cpp_rest_internal",
Expand All @@ -76,7 +76,7 @@ load(":service_dirs.bzl", "operation_service_dirs", "service_dirs")
":google_cloud_cpp_compute_global_organization_operations",
":google_cloud_cpp_compute_region_operations",
":google_cloud_cpp_compute_zone_operations",
"//protos/google/cloud/compute:google_cloud_cpp_compute_" + service.replace("/v1/", "") + "_cc_proto",
"//protos/google/cloud/compute:" + service.replace("/v1/", "") + "_cc_proto",
"//:common",
"//:grpc_utils",
"//google/cloud:google_cloud_cpp_rest_internal",
Expand Down
14 changes: 7 additions & 7 deletions protos/google/cloud/compute/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ filegroup(
)

proto_library(
name = "google_cloud_cpp_compute_internal_proto",
name = "internal_proto",
srcs = [":internal_protos"],
strip_import_prefix = "/protos",
visibility = [
Expand All @@ -44,12 +44,12 @@ proto_library(
)

cc_proto_library(
name = "google_cloud_cpp_compute_internal_cc_proto",
name = "internal_cc_proto",
visibility = [
"//:__pkg__",
"//google/cloud/compute:__pkg__",
],
deps = [":google_cloud_cpp_compute_internal_proto"],
deps = [":internal_proto"],
)

# Service proto targets
Expand All @@ -59,15 +59,15 @@ cc_proto_library(
srcs = glob([service + "*.proto"]),
),
proto_library(
name = "google_cloud_cpp_compute_" + service.replace("/v1/", "_proto"),
name = service.replace("/v1/", "_proto"),
srcs = [":" + service.replace("/v1/", "_proto_srcs")],
strip_import_prefix = "/protos",
visibility = [
"//:__pkg__",
"//google/cloud/compute:__pkg__",
],
deps = [
":google_cloud_cpp_compute_internal_proto",
":internal_proto",
"@com_google_googleapis//google/api:annotations_proto",
"@com_google_googleapis//google/api:client_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
Expand All @@ -79,11 +79,11 @@ cc_proto_library(
],
),
cc_proto_library(
name = "google_cloud_cpp_compute_" + service.replace("/v1/", "_cc_proto"),
name = service.replace("/v1/", "_cc_proto"),
visibility = [
"//:__pkg__",
"//google/cloud/compute:__pkg__",
],
deps = [":google_cloud_cpp_compute_" + service.replace("/v1/", "_proto")],
deps = [":" + service.replace("/v1/", "_proto")],
),
] for service in service_dirs + operation_service_dirs]

0 comments on commit ff11eda

Please sign in to comment.