Skip to content
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

Update third_party/abseil-cpp to 20250127.0 or later #1172

Open
yukawa opened this issue Feb 5, 2025 · 4 comments
Open

Update third_party/abseil-cpp to 20250127.0 or later #1172

yukawa opened this issue Feb 5, 2025 · 4 comments

Comments

@yukawa
Copy link
Collaborator

yukawa commented Feb 5, 2025

Description

Abseil LTS 20250127.0 has been released on February 5, 2025. Let's update third_party/abseil-cpp to it (or later).

By updating to this version, we can remove the following workarounds.

mozc/src/MODULE.bazel

Lines 5 to 14 in 879ad43

# abseil-cpp with patches for Bazel 8.0.0 is used instead of the local Abseil in third_party/.
# Otherwise, `bazel fetch` will fail with the error: "cc_configure_extension no longer available".
# References
# * https://github.com/bazelbuild/bazel/issues/24426
# * https://github.com/bazelbuild/bazel-central-registry/pull/3320
bazel_dep(
name = "abseil-cpp",
version = "20240722.0.bcr.2",
repo_name = "com_google_absl",
)

mozc/src/.bazelrc

Lines 25 to 26 in 879ad43

# Temporarily disable this definition to work around the build failure on Linux.
# build:release_build --copt=-DABSL_MIN_LOG_LEVEL=100

Version or commit-id

879ad43

Environment

  • OS: All
@yukawa
Copy link
Collaborator Author

yukawa commented Feb 11, 2025

Completed with the following commits.

@yukawa yukawa closed this as completed Feb 11, 2025
@yukawa
Copy link
Collaborator Author

yukawa commented Feb 12, 2025

Seems that the combination of protobuf v29.x/v30.0, abseil 20250127.0 and msvc results in the following compile error. We need to stay in abseil 20240722.0 until the issue is fixed in upstream and/or we migrate to clang-cl (#1179).

https://github.com/google/mozc/actions/runs/13279655889/job/37077918543

ERROR: C:/x/external/protobuf+/src/google/protobuf/compiler/java/BUILD.bazel:66:11: Compiling src/google/protobuf/compiler/java/internal_helpers.cc [for tool] failed: (Exit 2): cl.exe failed: error executing CppCompile command (from target @@protobuf+//src/google/protobuf/compiler/java:internal_helpers) C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\cl.exe ... (remaining 1 argument skipped)
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\include\utility(470): error C2079: 'std::pair<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo>::second' uses undefined struct 'google::protobuf::compiler::java::FieldGeneratorInfo'
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\include\utility(470): note: the template instantiation context (the oldest one first) is
bazel-out/x64_windows-opt-exec-ST-d57f47055a04/bin/external/protobuf+/src/google/protobuf/compiler/java/_virtual_includes/helpers\google/protobuf/compiler/java/context.h(81): note: see reference to class template instantiation 'absl::lts_20250127::flat_hash_map<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo,absl::lts_20250127::container_internal::HashEq<K,void>::Hash,absl::lts_20250127::container_internal::HashEq<K,void>::Eq,std::allocator<std::pair<const K,V>>>' being compiled
        with
        [
            K=const google::protobuf::FieldDescriptor *,
            V=google::protobuf::compiler::java::FieldGeneratorInfo
        ]
external/abseil-cpp+\absl/container/flat_hash_map.h(129): note: see reference to class template instantiation 'absl::lts_20250127::container_internal::raw_hash_map<absl::lts_20250127::container_internal::FlatHashMapPolicy<K,V>,Hash,Eq,Allocator>' being compiled
        with
        [
            K=const google::protobuf::FieldDescriptor *,
            V=google::protobuf::compiler::java::FieldGeneratorInfo,
            Hash=absl::lts_20250127::container_internal::HashEq<const google::protobuf::FieldDescriptor *,void>::Hash,
            Eq=absl::lts_20250127::container_internal::HashEq<const google::protobuf::FieldDescriptor *,void>::Eq,
            Allocator=std::allocator<std::pair<const google::protobuf::FieldDescriptor *const ,google::protobuf::compiler::java::FieldGeneratorInfo>>
        ]
external/abseil-cpp+\absl/container/internal/raw_hash_map.h(33): note: see reference to class template instantiation 'absl::lts_20250127::container_internal::raw_hash_set<Policy,Hash,Eq,Alloc>' being compiled
        with
        [
            Policy=absl::lts_20250127::container_internal::FlatHashMapPolicy<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo>,
            Hash=absl::lts_20250127::container_internal::HashEq<const google::protobuf::FieldDescriptor *,void>::Hash,
            Eq=absl::lts_20250127::container_internal::HashEq<const google::protobuf::FieldDescriptor *,void>::Eq,
            Alloc=std::allocator<std::pair<const google::protobuf::FieldDescriptor *const ,google::protobuf::compiler::java::FieldGeneratorInfo>>
        ]
external/abseil-cpp+\absl/container/internal/raw_hash_set.h(3030): note: see reference to class template instantiation 'absl::lts_20250127::conjunction<std::integral_constant<bool,true>,absl::lts_20250127::type_traits_internal::IsOwner<std::pair<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo>>,absl::lts_20250127::type_traits_internal::IsView<std::pair<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo>>>' being compiled
external/abseil-cpp+\absl/meta/type_traits.h(147): note: see reference to class template instantiation 'absl::lts_20250127::conjunction<absl::lts_20250127::type_traits_internal::IsOwner<std::pair<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo>>,absl::lts_20250127::type_traits_internal::IsView<std::pair<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo>>>' being compiled
external/abseil-cpp+\absl/meta/type_traits.h(147): note: see reference to class template instantiation 'absl::lts_20250127::type_traits_internal::IsOwner<std::pair<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo>>' being compiled
external/abseil-cpp+\absl/meta/type_traits.h(607): note: see reference to class template instantiation 'std::pair<const google::protobuf::FieldDescriptor *,google::protobuf::compiler::java::FieldGeneratorInfo>' being compiled
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\include\utility(470): error C2079: 'std::pair<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo>::second' uses undefined struct 'google::protobuf::compiler::java::OneofGeneratorInfo'
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\include\utility(470): note: the template instantiation context (the oldest one first) is
bazel-out/x64_windows-opt-exec-ST-d57f47055a04/bin/external/protobuf+/src/google/protobuf/compiler/java/_virtual_includes/helpers\google/protobuf/compiler/java/context.h(83): note: see reference to class template instantiation 'absl::lts_20250127::flat_hash_map<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo,absl::lts_20250127::container_internal::HashEq<K,void>::Hash,absl::lts_20250127::container_internal::HashEq<K,void>::Eq,std::allocator<std::pair<const K,V>>>' being compiled
        with
        [
            K=const google::protobuf::OneofDescriptor *,
            V=google::protobuf::compiler::java::OneofGeneratorInfo
        ]
external/abseil-cpp+\absl/container/flat_hash_map.h(129): note: see reference to class template instantiation 'absl::lts_20250127::container_internal::raw_hash_map<absl::lts_20250127::container_internal::FlatHashMapPolicy<K,V>,Hash,Eq,Allocator>' being compiled
        with
        [
            K=const google::protobuf::OneofDescriptor *,
            V=google::protobuf::compiler::java::OneofGeneratorInfo,
            Hash=absl::lts_20250127::container_internal::HashEq<const google::protobuf::OneofDescriptor *,void>::Hash,
            Eq=absl::lts_20250127::container_internal::HashEq<const google::protobuf::OneofDescriptor *,void>::Eq,
            Allocator=std::allocator<std::pair<const google::protobuf::OneofDescriptor *const ,google::protobuf::compiler::java::OneofGeneratorInfo>>
        ]
external/abseil-cpp+\absl/container/internal/raw_hash_map.h(33): note: see reference to class template instantiation 'absl::lts_20250127::container_internal::raw_hash_set<Policy,Hash,Eq,Alloc>' being compiled
        with
        [
            Policy=absl::lts_20250127::container_internal::FlatHashMapPolicy<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo>,
            Hash=absl::lts_20250127::container_internal::HashEq<const google::protobuf::OneofDescriptor *,void>::Hash,
            Eq=absl::lts_20250127::container_internal::HashEq<const google::protobuf::OneofDescriptor *,void>::Eq,
            Alloc=std::allocator<std::pair<const google::protobuf::OneofDescriptor *const ,google::protobuf::compiler::java::OneofGeneratorInfo>>
        ]
external/abseil-cpp+\absl/container/internal/raw_hash_set.h(3030): note: see reference to class template instantiation 'absl::lts_20250127::conjunction<std::integral_constant<bool,true>,absl::lts_20250127::type_traits_internal::IsOwner<std::pair<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo>>,absl::lts_20250127::type_traits_internal::IsView<std::pair<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo>>>' being compiled
external/abseil-cpp+\absl/meta/type_traits.h(147): note: see reference to class template instantiation 'absl::lts_20250127::conjunction<absl::lts_20250127::type_traits_internal::IsOwner<std::pair<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo>>,absl::lts_20250127::type_traits_internal::IsView<std::pair<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo>>>' being compiled
external/abseil-cpp+\absl/meta/type_traits.h(147): note: see reference to class template instantiation 'absl::lts_20250127::type_traits_internal::IsOwner<std::pair<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo>>' being compiled
external/abseil-cpp+\absl/meta/type_traits.h(607): note: see reference to class template instantiation 'std::pair<const google::protobuf::OneofDescriptor *,google::protobuf::compiler::java::OneofGeneratorInfo>' being compiled
Target //:package failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: D:/a/mozc/mozc/src/protocol/BUILD.bazel:143:14 Compiling protocol/user_dictionary_storage.pb.cc failed: (Exit 2): cl.exe failed: error executing CppCompile command (from target @@protobuf+//src/google/protobuf/compiler/java:internal_helpers) C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\cl.exe ... (remaining 1 argument skipped)

Reopening to take care of the rollback process.

@yukawa yukawa reopened this Feb 12, 2025
@yukawa
Copy link
Collaborator Author

yukawa commented Feb 12, 2025

Note that we also need to rollback googletest to 1.15.2, because 1.16.0 requires abseil 20250127.0.

https://github.com/google/googletest/blob/4a00a24fff3cf82254de382437bf840cab1d3993/MODULE.bazel#L42-L45

bazel_dep(
    name = "abseil-cpp",
    version = "20250127.0",
)

@yukawa
Copy link
Collaborator Author

yukawa commented Feb 12, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant