Skip to content

[Bug] build error: attr.cast<Function>().CallExpected<Optional<VisitInterrupt>> #20042

Description

@petersktang

Encounter below error during pip install .

      In file included from ....tvm/3rdparty/tvm-ffi/src/ffi/extra/structural_visit.cc:23:
      In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/container/array.h:29:
      In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/any.h:27:
      In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/string.h:28:
      In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/error.h:29:
      In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/memory.h:26:
      In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/object.h:28:
      In file included from ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/type_traits.h:29:

      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:900:7: error: satisfaction of constraint 'is_constructible_v<_Tp, _Up>' depends on itself
        900 |           && is_constructible_v<_Tp, _Up>
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/type_traits:3683:70: note: while checking constraint satisfaction for template 'optional<const tvm::ffi::Optional<tvm::ffi::VisitInterrupt> &>' required here
       3683 |   inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...);
            |                                                                      ^~~~~
      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/type_traits:3683:70: note: while substituting deduced template arguments into function template 'optional' [with _Up = const tvm::ffi::Optional<tvm::ffi::VisitInterrupt> &]
      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:900:7: note: in instantiation of variable template specialization 'std::is_constructible_v<tvm::ffi::VisitInterrupt, const tvm::ffi::Optional<tvm::ffi::VisitInterrupt> &>' requested here
        900 |           && is_constructible_v<_Tp, _Up>
            |              ^
      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:900:7: note: while substituting template arguments into constraint expression here
        900 |           && is_constructible_v<_Tp, _Up>
            |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/type_traits:3718:41: note: while checking constraint satisfaction for template 'optional<const tvm::ffi::Optional<tvm::ffi::VisitInterrupt> &>' required here
       3718 |     = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
            |                                         ^~~~~~~~~~~~~~~~
      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/type_traits:3718:41: note: while substituting deduced template arguments into function template 'optional' [with _Up = const tvm::ffi::Optional<tvm::ffi::VisitInterrupt> &]
      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:499:12: note: in instantiation of variable template specialization 'std::is_trivially_copy_constructible_v<tvm::ffi::Optional<tvm::ffi::VisitInterrupt>>' requested here
        499 |            bool = is_trivially_copy_constructible_v<_Tp>,
            |                   ^
      /usr/lib/gcc/x86_64-linux-gnu/16/../../../../include/c++/16/optional:806:15: note: in instantiation of default argument for '_Optional_base<tvm::ffi::Optional<tvm::ffi::VisitInterrupt>>' required here
        806 |     : private _Optional_base<_Tp>,
            |               ^~~~~~~~~~~~~~~~~~~
      ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/function.h:678:40: note: in instantiation of template class 'std::optional<tvm::ffi::Optional<tvm::ffi::VisitInterrupt>>' requested here
        678 |         if (auto val = result.template try_cast<T>()) {
            |                                        ^
      ....tvm/3rdparty/tvm-ffi/include/tvm/ffi/extra/structural_visit.h:195:36: note: in instantiation of function template specialization 'tvm::ffi::Function::CallExpected<tvm::ffi::Optional<tvm::ffi::VisitInterrupt>, tvm::ffi::StructuralVisitorObj *, tvm::ffi::AnyView &>' requested here
        195 |       return attr.cast<Function>().CallExpected<Optional<VisitInterrupt>>(this, value);
            |                                    ^
      2 errors generated.

Environment

Ubuntu 26.04 LTS (Linux 7.0.0-28-generic 28-Ubuntu SMP PREEMPT_DYNAMIC Sun Jun 21 01:01:36 UTC 2026 x86_64 GNU/Linux)

  • AMD Ryzen AI 9 HX 370
  • conda virtual environment [python 3.12.13]
  • cuda-toolkit 13.0.3.0
  • ROCM 7.14
USE_CUDA = "ON"
USE_ROCM = "ON"
USE_LLVM = "ON"
# USE_CUBLAS = "ON"
# USE_HIPBLAS = "ON"
# USE_CUDNN = "ON"
CMAKE_C_COMPILER = "/opt/rocm/llvm/bin/clang"
CMAKE_CXX_COMPILER = "/opt/rocm/llvm/bin/clang++"
/usr/include/x86_64-linux-gnu/c++$ ll
total 20
drwxr-xr-x 5 root root 4096 Jul 21 23:41 ./
drwxr-xr-x 7 root root 4096 Jul 28 06:39 ../
drwxr-xr-x 4 root root 4096 Jul 17 22:13 11/
drwxr-xr-x 6 root root 4096 Jul 17 22:13 15/
drwxr-xr-x 4 root root 4096 Jul 21 23:41 16/
  • needs-triage

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions