Skip to content

HashState::HashStateBase doesn't resolve in MSVC + Cuda 13.4 #2185

Open

Description

@hmaarrfk

Describe the issue

It seems that

friend class HashState::HashStateBase

and 

friend class MixingHashState::HashStateBase;

Fails with

tmpxft_00001e10_00000000-7_range_impl.compute_120a.cudafe1.cpp
absl/hash/internal/hash.h(1428): error C3856: 'HashStateBase': symbol is not a class template
absl/hash/internal/hash.h(1428): error C2098: unexpected token after data member 'MixingHashState'
absl/hash/internal/hash.h(1428): error C2059: syntax error: '>'
absl/hash/hash.h(371): error C3856: 'HashStateBase': symbol is not a class template
absl/hash/hash.h(371): error C2098: unexpected token after data member 'HashState'
absl/hash/hash.h(371): error C2059: syntax error: '>'
absl/container/flat_hash_map.h(141): error C2248: 'absl::lts_20260526::container_internal::raw_hash_map<T>::Hash': cannot access private typedef declared in class 'absl::lts_20260526::container_internal::raw_hash_map<T>'

Steps to reproduce the problem

build onnxruntime 1.30.0's CUDA execution provider on Windows against the installed abseil; any .cu file that reaches absl/hash/hash.h or absl/container/flat_hash_map.h fails. There is no minimal standalone reproducer yet, only the CI logs.

feedstock (recipe) at the time of failure https://github.com/hmaarrfk/onnxruntime-feedstock/tree/70e25022c8580a0a60a54453fa436961de6633f0/recipe

One caveat worth stating in the report: onnxruntime hit the friend error
job-logs_failure.txt

What version of Abseil are you using?

LTS 20260526.0 (inline namespace absl::lts_20260526), consumed as the conda-forge libabseil 20260526.0 package, build cxx17_h04e5de1_2 (shared library, built as C++17).

claude take The same declarations are unchanged on current master (d2d245b) and in LTS 20260817.0 and 20250814.0, so I expect them to be affected too, but I have only reproduced this with 20260526.0.

What operating system and version are you using?

Windows (GitHub Actions hosted Windows runner, x64). I did not find the exact image version in the log.

What compiler and version are you using?

NVCC from CUDA 13.4 (cuda-nvcc 13.4.92) with MSVC as host compiler (vs2022_win-64 19.44.35207, VC runtime 14.51.36247). The failing translation units are compiled with -std=c++20.

What build system are you using?

CMake 3.31.8 with Ninja 1.13.2. Abseil is found as an installed package (find_package(absl)), not built in-tree; the consumer defines ABSL_CONSUME_DLL.

Additional context

No response

Activity

  1. hmaarrfk commented on Oct 5, 2026

    @hmaarrfk
    Author

    we worked around this by patching it ourselves conda-forge/abseil-cpp-feedstock#117

  2. hmaarrfk commented on Oct 5, 2026

    @hmaarrfk
    Author

    maybe related #2075

  3. h-vetinari commented on Oct 6, 2026

    @h-vetinari
    Contributor

    Thanks for opening @hmaarrfk!

    we worked around this by patching it ourselves conda-forge/abseil-cpp-feedstock#117

    To help readers, the patch in question is quite minimal

    diff --git a/absl/hash/hash.h b/absl/hash/hash.h
    index 7a76771..2e09896 100644
    --- a/absl/hash/hash.h
    +++ b/absl/hash/hash.h
    @@ -367,7 +367,7 @@ class HashState : public hash_internal::HashStateBase<HashState> {
      private:
       HashState() = default;
     
    -  friend class HashState::HashStateBase;
    +  friend class hash_internal::HashStateBase<HashState>;
       friend struct hash_internal::CombineRaw;
     
       template <typename T>
    diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h
    index 9463746..b139397 100644
    --- a/absl/hash/internal/hash.h
    +++ b/absl/hash/internal/hash.h
    @@ -1475,7 +1475,7 @@ class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
       }
     
      private:
    -  friend class MixingHashState::HashStateBase;
    +  friend class HashStateBase<MixingHashState>;
       template <typename H>
       friend H absl::hash_internal::hash_weakly_mixed_integer(H,
                                                               WeaklyMixedInteger);

    Windows (GitHub Actions hosted Windows runner, x64). I did not find the exact image version in the log.

    FWIW, it's contained not in the main build logs, but in the logs of the very first step in GHA logs

  4. hmaarrfk commented on Oct 6, 2026

    @hmaarrfk
    Author

    Thank you @h-vetinari for the improvement in terms of wholistic context!

    We may need more patches even

    still a draft, but xref: conda-forge/abseil-cpp-feedstock#118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions