-
Notifications
You must be signed in to change notification settings - Fork 15.7k
[v30.0-rc2 regression] src/google/protobuf/compiler/java/context.h
causes compile error C2079 in MSVC with /std:c++20
and /Zc:__cplusplus
#20331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@sbenzaquen I think using forward declaration should be fine right? Is there something we can do here? |
No, we should not use incomplete types in the container. |
Due to the build failure on Windows that happens when using protobuf with abseil 20250127.0 [1], we cannot yet update abseil. This commit updates the bzlmod depencencies as follows. abseil: 20240722.0.bcr.2 re2: 2024-07-02.bcr.1 googletest: 1.15.2 [1]: protocolbuffers/protobuf#20331
Due to the build failure on Windows that happens when using protobuf with abseil 20250127.0 [1], we cannot yet update abseil. This commit updates the bzlmod depencencies as follows. abseil: 20240722.0.bcr.2 re2: 2024-07-02.bcr.1 protobuf: 29.3 googletest: 1.15.2 [1]: protocolbuffers/protobuf#20331
Due to the build failure on Windows that happens when using protobuf with abseil 20250127.0 [1], we cannot yet update abseil. This commit updates the bzlmod depencencies as follows. abseil: 20240722.0.bcr.2 re2: 2024-07-02.bcr.1 protobuf: 29.3 googletest: 1.15.2 [1]: protocolbuffers/protobuf#20331
* To fix build failures on Windows with Bazel. + protocolbuffers/protobuf#20331 * abseil-cpp: 20240722.0.bcr.2 * re2: 2024-07-02.bcr.1 * protobuf: 29.3 * googletest: 1.15.2 PiperOrigin-RevId: 729343696
With this commit we start using 'clang-cl' to build Mozc for Windows with Bazel. While the original motivation of switching to 'clang-cl' is that protobuf is planning to stop supporting cl.exe with bazel build in protobuf v34 [1], but there is also an on-going build breakage that happens when combining protobuf and abseil-cpp 20250127.0, which is not yet fixed [2]. The latter one is more critical for us because more and more bzlmod dependencies start requiring abseil-cpp 20250127.0 or higher. There must be no impact on Windows GYP build. Closes google#1179. [1]: protocolbuffers/protobuf#20085 [2]: protocolbuffers/protobuf#20331
With this commit we start using 'clang-cl' to build Mozc for Windows with Bazel. While the original motivation of switching to 'clang-cl' is that protobuf is planning to stop supporting cl.exe with bazel build in protobuf v34 [1], but there is also an on-going build breakage that happens when combining protobuf and abseil-cpp 20250127.0, which is not yet fixed [2]. The latter one is more critical for us because more and more bzlmod dependencies start requiring abseil-cpp 20250127.0 or higher. There must be no impact on Windows GYP build. Closes google#1179. [1]: protocolbuffers/protobuf#20085 [2]: protocolbuffers/protobuf#20331
With this commit we start using 'clang-cl' to build Mozc for Windows with Bazel. While the original motivation of switching to 'clang-cl' is that protobuf is planning to stop supporting cl.exe with bazel build in protobuf v34 [1], but there is also an on-going build breakage that happens when combining protobuf and abseil-cpp 20250127.0, which is not yet fixed [2]. The latter one is more critical for us because more and more bzlmod dependencies start requiring abseil-cpp 20250127.0 or higher. There must be no impact on Windows GYP build. Closes google#1179. [1]: protocolbuffers/protobuf#20085 [2]: protocolbuffers/protobuf#20331
src/google/protobuf/compiler/java/context.h
causes compile error C2079 in MSVC with /std:c++20
and /Zc:__cplusplus
src/google/protobuf/compiler/java/context.h
causes compile error C2079 in MSVC with /std:c++20
and /Zc:__cplusplus
Updating the title to make it clear that this is now obvious in v30.0-rc2, which starts requiring abseil-cpp 20250127.0. |
With this commit we start using 'clang-cl' to build Mozc for Windows with Bazel. While the original motivation of switching to 'clang-cl' is that protobuf is planning to stop supporting cl.exe with bazel build in protobuf v34 [1], there is also an on-going build breakage that happens when combining protobuf and abseil-cpp 20250127.0, which is not yet fixed [2]. The latter one is more critical for us because more and more bzlmod dependencies start requiring abseil-cpp 20250127.0 or higher. There must be no impact on Windows GYP build. Closes google#1179. [1]: protocolbuffers/protobuf#20085 [2]: protocolbuffers/protobuf#20331
With this commit we start using 'clang-cl' to build Mozc for Windows with Bazel. While the original motivation of switching to 'clang-cl' is that protobuf is planning to stop supporting cl.exe with bazel build in protobuf v34 [1], there is also an on-going build breakage that happens when combining protobuf and abseil-cpp 20250127.0, which is not yet fixed [2]. The latter one is more critical for us because more and more bzlmod dependencies start requiring abseil-cpp 20250127.0 or higher. There must be no impact on Windows GYP build. Closes #1179. [1]: protocolbuffers/protobuf#20085 [2]: protocolbuffers/protobuf#20331 PiperOrigin-RevId: 736417401
As discussed in google#1208, protobuf 30.0 does not compile on macOS, which impiles that clang 16 shipped with Xcode 16.2 is also affected by the following issue. * protocolbuffers/protobuf#20645 Let's update comments in 'MODULE.bazel' to refer to the above issue before closing google#1177. Note that the following open issue is no longer the case as we have finally migrated to 'clang-cl' (google#1179). * protocolbuffers/protobuf#20331
As discussed in google#1208, protobuf 30.0 does not compile on macOS, which implies that clang 16 shipped with Xcode 16.2 is also affected by the following issue. * protocolbuffers/protobuf#20645 Let's update comments in 'MODULE.bazel' to refer to the above issue before closing google#1177. Note that the following open issue is no longer the case as we have finally migrated to 'clang-cl' (google#1179). * protocolbuffers/protobuf#20331
Now that Windows Bazel build uses 'clang-cl' (google#1179), we should be able to switch to update 'abseil-cpp' to 20250127.0 without worrying about the following issue. * protocolbuffers/protobuf#20331 Note that GYP build remain unchanged until the corresponding abseil git submodule is updated. No observable behavior change is intended in the final artifacts. Closes google#1172.
Now that Windows Bazel build uses 'clang-cl' (google#1179), we should be able to switch to update 'abseil-cpp' to 20250127.0 without worrying about the following issue. * protocolbuffers/protobuf#20331 Note that GYP build remain unchanged until the corresponding abseil git submodule is updated. No observable behavior change is intended in the final artifacts. Closes google#1172.
As discussed in google#1208, protobuf 30.0 does not compile on macOS, which implies that clang 16 shipped with Xcode 16.2 is also affected by the following issue. * protocolbuffers/protobuf#20645 Let's update comments in 'MODULE.bazel' to refer to the above issue before closing google#1177. Note that the following open issue is no longer the case as we have finally migrated to 'clang-cl' (google#1179). * protocolbuffers/protobuf#20331
As discussed in #1208, protobuf 30.0 does not compile on macOS, which implies that clang 16 shipped with Xcode 16.2 is also affected by the following issue. * protocolbuffers/protobuf#20645 Let's update comments in 'MODULE.bazel' to refer to the above issue before closing #1177. Note that the following open issue is no longer the case as we have finally migrated to 'clang-cl' (#1179). * protocolbuffers/protobuf#20331 PiperOrigin-RevId: 736914763
There is a KI, protocolbuffers/protobuf#20331, when using protobuf + newer versions of abseil that causes builds to fail on MSVC. This change uses full structs instead of forward declarations to work around this. I expect that this patch can be removed in the future when protobuf fixes this issue. Bug: 340578705 Change-Id: I54c3938ba098845587d7f7206e32c87af61283c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6427203 Auto-Submit: Ryan Harrison <[email protected]> Reviewed-by: Steven Holte <[email protected]> Commit-Queue: Steven Holte <[email protected]> Cr-Commit-Position: refs/heads/main@{#1441759}
What version of protobuf and what language are you using?
Version: 40ec76e
Language: C++
What operating system (Linux, Windows, ...) and version?
Windows 11 24H2
What runtime / compiler are you using (e.g., python version or gcc version)
Microsoft (R) C/C++ Optimizing Compiler Version 19.42.34438 for x64
What did you do?
Steps to reproduce the behavior:
What did you expect to see
The build succeeds.
What did you see instead?
Anything else we should know about your project / environment
Here is the relevant error message.
Here are the lines in question.
protobuf/src/google/protobuf/compiler/java/context.h
Lines 39 to 40 in 40ec76e
protobuf/src/google/protobuf/compiler/java/context.h
Lines 80 to 83 in 40ec76e
src/google/protobuf/compiler/java/context.h
looks to be trying to pass a forward declared type to the second type parameter ofabsl::flat_hash_map
, which I'm not quite sure if it's really supported or not.Other observations
/Zc:__cplusplus
compiler option.The text was updated successfully, but these errors were encountered: