Skip to content

Commit f617e71

Browse files
authored
cleanup: shorten Bazel project name (googleapis#10207)
Using a shorter project name will avoid problems on Windows, where Bazel can create paths exceeding the MSVC hardcoded limits (260 characters). Note that, AFAICT, this is a bug in the compiler. Windows supports longer paths, but the compiler cannot use them for some reason. Bazel does not help either, by creating deeply nested names for the object files.
1 parent 22ecaf5 commit f617e71

199 files changed

Lines changed: 319 additions & 310 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

WORKSPACE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
workspace(name = "com_github_googleapis_google_cloud_cpp")
15+
workspace(name = "google_cloud_cpp")
1616

1717
load("//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
1818

ci/kokoro/windows/builds/quickstart-bazel.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ function Get-Released-Quickstarts {
4040

4141
Push-Location "${project_root}/google/cloud/bigtable/quickstart"
4242
bazelisk $bazel_common_flags version | Out-Null
43-
bazelisk $bazel_common_flags query --noshow_progress --noshow_loading_progress "filter(/quickstart:quickstart$, kind(cc_binary, @com_github_googleapis_google_cloud_cpp//google/...))" |
44-
ForEach-Object { $_.replace("@com_github_googleapis_google_cloud_cpp//google/cloud/", "").replace("/quickstart:quickstart", "") } |
43+
bazelisk $bazel_common_flags query --noshow_progress --noshow_loading_progress "filter(/quickstart:quickstart$, kind(cc_binary, @google_cloud_cpp//google/...))" |
44+
ForEach-Object { $_.replace("@google_cloud_cpp//google/cloud/", "").replace("/quickstart:quickstart", "") } |
4545
# The following quickstarts have problems building on Windows:
4646
# TODO(#8145) - asset (TRUE/FALSE macros)
4747
# TODO(#10067) - batch (awaiting non-experimental target)
48-
# TODO(#9340) - beyondcorp (long pathnames)
4948
# TODO(#8125) - channel (DOMAIN macro)
5049
# TODO(#8785) - storagetransfer (UID_MAX/GID_MAX macros)
51-
Where-Object { -not ("asset", "batch", "beyondcorp", "channel", "storagetransfer" -contains $_) } |
50+
Where-Object { -not ("asset", "batch", "channel", "storagetransfer" -contains $_) } |
5251
# TODO(#9923) - compiling all quickstarts on Windows is too slow
5352
Get-Random -Count 10
5453
Pop-Location

ci/verify_current_targets/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ CURRENT_TARGETS = [
3434
"verify_current_targets.cc",
3535
],
3636
deps = [
37-
"@com_github_googleapis_google_cloud_cpp//" + target,
37+
"@google_cloud_cpp//" + target,
3838
],
3939
) for target in CURRENT_TARGETS]

ci/verify_current_targets/WORKSPACE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
workspace(name = "com_github_googleapis_google_cloud_cpp_verify_current_targets")
15+
workspace(name = "verify_current_targets")
1616

1717
# Add the necessary Starlark functions to fetch google-cloud-cpp.
1818
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1919

2020
local_repository(
21-
name = "com_github_googleapis_google_cloud_cpp",
21+
name = "google_cloud_cpp",
2222
path = "../../",
2323
)
2424

2525
# Load indirect dependencies due to
2626
# https://github.com/bazelbuild/bazel/issues/1943
27-
load("@com_github_googleapis_google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
27+
load("@google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
2828

2929
google_cloud_cpp_deps()
3030

ci/verify_deprecated_targets/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ DEPRECATED_TARGETS = [
3838
"verify_deprecated_targets.cc",
3939
],
4040
deps = [
41-
"@com_github_googleapis_google_cloud_cpp//" + target,
41+
"@google_cloud_cpp//" + target,
4242
],
4343
) for target in DEPRECATED_TARGETS]

ci/verify_deprecated_targets/WORKSPACE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414

1515
# A minimal WORKSPACE file showing how to use the Google Cloud Bigtable C++
1616
# client library in Bazel-based projects.
17-
workspace(name = "com_github_googleapis_google_cloud_cpp_verify_deprecated_targets")
17+
workspace(name = "verify_deprecated_targets")
1818

1919
# Add the necessary Starlark functions to fetch google-cloud-cpp.
2020
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2121

2222
local_repository(
23-
name = "com_github_googleapis_google_cloud_cpp",
23+
name = "google_cloud_cpp",
2424
path = "../../",
2525
)
2626

2727
# Load indirect dependencies due to
2828
# https://github.com/bazelbuild/bazel/issues/1943
29-
load("@com_github_googleapis_google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
29+
load("@google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
3030

3131
google_cloud_cpp_deps()
3232

generator/internal/scaffold_generator.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,15 +978,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
978978
# Fetch the Google Cloud C++ libraries.
979979
# NOTE: Update this version and SHA256 as needed.
980980
http_archive(
981-
name = "com_github_googleapis_google_cloud_cpp",
981+
name = "google_cloud_cpp",
982982
sha256 = "e8d904bbff788a26aa9cd67d6c0725f9798448fcf73ab809ec2d7b80f89a1dc5",
983983
strip_prefix = "google-cloud-cpp-2.2.0",
984984
url = "https://github.com/googleapis/google-cloud-cpp/archive/v2.2.0.tar.gz",
985985
)
986986
987987
# Load indirect dependencies due to
988988
# https://github.com/bazelbuild/bazel/issues/1943
989-
load("@com_github_googleapis_google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
989+
load("@google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
990990
991991
google_cloud_cpp_deps()
992992
@@ -1035,7 +1035,7 @@ cc_binary(
10351035
"quickstart.cc",
10361036
],
10371037
deps = [
1038-
"@com_github_googleapis_google_cloud_cpp//:$library_prefix$$library$",
1038+
"@google_cloud_cpp//:$library_prefix$$library$",
10391039
],
10401040
)
10411041
)""";

google/cloud/accessapproval/quickstart/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ cc_binary(
2020
"quickstart.cc",
2121
],
2222
deps = [
23-
"@com_github_googleapis_google_cloud_cpp//:accessapproval",
23+
"@google_cloud_cpp//:accessapproval",
2424
],
2525
)

google/cloud/accessapproval/quickstart/WORKSPACE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2222
# Fetch the Google Cloud C++ libraries.
2323
# NOTE: Update this version and SHA256 as needed.
2424
http_archive(
25-
name = "com_github_googleapis_google_cloud_cpp",
25+
name = "google_cloud_cpp",
2626
sha256 = "245e198e29c4ec19734cc99ef631daaefbdb874307fc3743e22514ee8bcb36c4",
2727
strip_prefix = "google-cloud-cpp-2.4.0",
2828
url = "https://github.com/googleapis/google-cloud-cpp/archive/v2.4.0.tar.gz",
2929
)
3030

3131
# Load indirect dependencies due to
3232
# https://github.com/bazelbuild/bazel/issues/1943
33-
load("@com_github_googleapis_google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
33+
load("@google_cloud_cpp//bazel:google_cloud_cpp_deps.bzl", "google_cloud_cpp_deps")
3434

3535
google_cloud_cpp_deps()
3636

google/cloud/accesscontextmanager/quickstart/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ cc_binary(
2020
"quickstart.cc",
2121
],
2222
deps = [
23-
"@com_github_googleapis_google_cloud_cpp//:accesscontextmanager",
23+
"@google_cloud_cpp//:accesscontextmanager",
2424
],
2525
)

0 commit comments

Comments
 (0)