Skip to content

Commit c6ba697

Browse files
mkruskal-googlecopybara-github
authored andcommitted
Remove the flag requirement for Bazel+MSVC users.
As discussed in #20085, we were originally intending to drop support for this combination. With Bazel's recent changes to virtual includes on windows though, we now have ~90 extra characters of runway. This should be more than enough to continue supporting MSVC into the forseeable future. Clang-cl support will be kept in place as an alternative on windows PiperOrigin-RevId: 783798673
1 parent 9a49efc commit c6ba697

File tree

7 files changed

+1
-49
lines changed

7 files changed

+1
-49
lines changed

.github/workflows/test_cpp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ jobs:
427427
- name: Windows Bazel
428428
os: windows-2022
429429
cache_key: windows-2022-msvc-cl
430-
bazel: test //src/... --config=msvc-cl --test_tag_filters=-conformance --build_tag_filters=-conformance --define=protobuf_allow_msvc=true
430+
bazel: test //src/... --config=msvc-cl --test_tag_filters=-conformance --build_tag_filters=-conformance
431431
- name: Windows Bazel clang-cl
432432
os: windows-2022
433433
cache_key: windows-2022-clang-cl

examples/.bazelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ common --enable_platform_specific_config
33
build:linux --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
44
build:macos --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
55

6-
build:windows --extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl --extra_execution_platforms=//:x64_windows-clang-cl
76
common:windows --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --enable_runfiles
87

98
build --experimental_remote_cache_eviction_retries=5

examples/BUILD.bazel

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,3 @@ pkg_files(
193193
strip_prefix = strip_prefix.from_root(""),
194194
visibility = ["//visibility:public"],
195195
)
196-
197-
platform(
198-
name = "x64_windows-clang-cl",
199-
constraint_values = [
200-
"@platforms//cpu:x86_64",
201-
"@platforms//os:windows",
202-
# This is necessary for Bazel 7 compatibility with a MODULE.bazel file that still works in
203-
# Bazel 8. Using cc_configure_extension from rules_cc produces a @local_config_cc
204-
# repository that's not compatible with @bazel_tools//tools/cpp:clang-cl from before
205-
# Bazel 8. See https://github.com/bazelbuild/rules_cc/issues/330.
206-
"@rules_cc//cc/private/toolchain:clang-cl",
207-
],
208-
)

examples/MODULE.bazel

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ local_path_override(
1919
)
2020

2121
bazel_dep(name = "bazel_skylib", version = "1.7.1")
22-
bazel_dep(name = "platforms", version = "0.0.10")
2322
bazel_dep(name = "rules_cc", version = "0.0.17")
2423
bazel_dep(name = "rules_java", version = "8.6.1")
2524
bazel_dep(name = "rules_pkg", version = "1.0.1")
2625
bazel_dep(name = "rules_python", version = "1.4.1")
27-
28-
# For clang-cl configuration
29-
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
30-
use_repo(cc_configure, "local_config_cc")

examples/WORKSPACE

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ local_repository(
3333
path = "..",
3434
)
3535

36-
# Bazel platform rules, for clang-cl.
37-
http_archive(
38-
name = "platforms",
39-
sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee",
40-
urls = [
41-
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
42-
"https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz",
43-
],
44-
)
45-
4636
load("@com_google_protobuf//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
4737

4838
protobuf_deps()
@@ -59,12 +49,6 @@ load("@rules_python//python:repositories.bzl", "py_repositories")
5949

6050
py_repositories()
6151

62-
load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains")
63-
64-
rules_cc_dependencies()
65-
66-
rules_cc_toolchains()
67-
6852
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
6953

7054
rules_jvm_external_deps()

src/google/protobuf/stubs/BUILD.bazel

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ cc_library(
2222
"status_macros.h",
2323
],
2424
copts = COPTS,
25-
defines = ["GOOGLE_PROTOBUF_USING_BAZEL=1"] + select({
26-
"//build_defs:protobuf_allow_msvc": [
27-
"GOOGLE_PROTOBUF_MSVC_BAZEL_OVERRIDE=1",
28-
],
29-
"//conditions:default": [],
30-
}),
3125
linkopts = LINK_OPTS,
3226
strip_include_prefix = "/src",
3327
deps = [

src/google/protobuf/stubs/port.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@
3131
#include <byteswap.h> // IWYU pragma: export
3232
#endif
3333

34-
#if defined(_MSC_VER) && !defined(__clang__) && \
35-
defined(GOOGLE_PROTOBUF_USING_BAZEL) && \
36-
!defined(GOOGLE_PROTOBUF_MSVC_BAZEL_OVERRIDE)
37-
#error \
38-
"Protobuf will be dropping support for MSVC + Bazel in 34.0. To continue using it until then, use the flag --define=protobuf_allow_msvc=true. For feedback or discussion, see github.com/protocolbuffers/protobuf/issues/20085."
39-
#endif
40-
4134
// Legacy: some users reference these (internal-only) macros even though we
4235
// don't need them any more.
4336
#if defined(_MSC_VER) && defined(PROTOBUF_USE_DLLS)

0 commit comments

Comments
 (0)