[Bug 294601] misc/py-pytorch fails to build using poudriere on stable 15 amd64 with error ambiguous conditional expression

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 17 Apr 2026 23:53:55 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294601

            Bug ID: 294601
           Summary: misc/py-pytorch fails to build using poudriere on
                    stable 15 amd64 with error ambiguous conditional
                    expression
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: yuri@freebsd.org
          Reporter: transitive@gmail.com
          Assignee: yuri@freebsd.org
             Flags: maintainer-feedback?(yuri@freebsd.org)

The port misc/py-pytorch fails to build for me with an ambiguous conditional
error when building python_arg_parser.cpp:763:7:

Below is the excerpt of the failing build log:

[100%] Building CXX object
caffe2/torch/CMakeFiles/torch_python.dir/csrc/jit/runtime/register_distributed_ops.cpp.o
[100%] Building CXX object
caffe2/torch/CMakeFiles/torch_python.dir/csrc/distributed/c10d/control_plane/PythonHandlers.cpp.o
[1m/wrkdirs/usr/ports/misc/py-pytorch/work-py311/pytorch-v2.10.0/torch/csrc/utils/python_arg_parser.cpp:763:7:
[0m[0;1;31merror: [0m[1mconditional expression is ambiguous; 'Tuple<[2 *
...], [0;1;36m(no argument)[0m[1m>' can be converted to 'Tuple<[2 * ...],
[0;1;36mpybind11::handle[0m[1m>' and vice versa[0m
  763 |       ? py::make_tuple(py::handle(self), py::handle(index))[0m
      | [0;1;32m      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[0m  764 |       : py::make_tuple(py::handle(self), py::handle(index),
py::handle(val));[0m
      | [0;1;32m       
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[0m1 error generated.
gmake[2]: *** [caffe2/torch/CMakeFiles/torch_python.dir/build.make:1997:
caffe2/torch/CMakeFiles/torch_python.dir/csrc/utils/python_arg_parser.cpp.o]
Error 1
gmake[2]: *** Waiting for unfinished jobs....
[1m/wrkdirs/usr/ports/misc/py-pytorch/work-py311/pytorch-v2.10.0/torch/csrc/jit/python/init.cpp:1833:11:
[0m[0;1;31merror: [0m[1mreturn type 'Tuple<[0;1;36mpybind11::cpp_function
&[0m[1m, [0;1;36mpybind11::list &[0m[1m>' must match previous return type
'Tuple<[0;1;36mpybind11::none[0m[1m, [0;1;36mpybind11::none[0m[1m>' when
lambda expression has unspecified explicit return type[0m
 1833 |           [0;34mreturn[0m py::make_tuple(func, overload_names);[0m
      | [0;1;32m          ^
[0m[1m/wrkdirs/usr/ports/misc/py-pytorch/work-py311/pytorch-v2.10.0/torch/csrc/jit/python/init.cpp:1860:11:
[0m[0;1;31merror: [0m[1mreturn type 'Tuple<[...],
[0;1;36mpybind11::none[0m[1m>' must match previous return type 'Tuple<[...],
[0;1;36mpybind11::object &[0m[1m>' when lambda expression has unspecified
explicit return type[0m
 1860 |           [0;34mreturn[0m py::make_tuple([0;32mfalse[0m,
py::none());[0m
      | [0;1;32m          ^
[0m2 errors generated.
gmake[2]: *** [caffe2/torch/CMakeFiles/torch_python.dir/build.make:1227:
caffe2/torch/CMakeFiles/torch_python.dir/csrc/jit/python/init.cpp.o] Error 1
[1m/wrkdirs/usr/ports/misc/py-pytorch/work-py311/pytorch-v2.10.0/torch/csrc/distributed/c10d/init.cpp:897:15:
[0m[0;1;31merror: [0m[1mreturn type 'Tuple<[...], [0;1;36mconst double
&[0m[1m>' must match previous return type 'Tuple<[...],
[0;1;36mpybind11::none[0m[1m>' when lambda expression has unspecified
explicit return type[0m
  897 |               [0;34mreturn[0m py::make_tuple(r.op_,
preMulSupplement->double_factor);[0m
      | [0;1;32m              ^
[0m1 error generated.
gmake[2]: *** [caffe2/torch/CMakeFiles/torch_python.dir/build.make:2333:
caffe2/torch/CMakeFiles/torch_python.dir/csrc/distributed/c10d/init.cpp.o]
Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2599:
caffe2/torch/CMakeFiles/torch_python.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

ERROR Backend subprocess exited when trying to invoke build_wheel
*** Error code 1

-- 
You are receiving this mail because:
You are the assignee for the bug.