build failed using gcc 12.1.1.
Created attachment 799079 [details] build.log.gz build.log
Created attachment 799081 [details] emerge-info.txt.gz emerge --info
I don't think the failure is necc. GCC 12 related.
https://gitweb.gentoo.org/repo/gentoo.git/commit/sci-libs/caffe2?id=7dd94587118b7333242a46b4f97c22ed69d6fc0d has incorrect change for PYTHON_COMPAT: > -PYTHON_COMPAT=( python3_{8..10} ) > +PYTHON_COMPAT=( python3_{8..11} ) In attached build log: > /var/tmp/portage/sci-libs/caffe2-1.12.0/work/pytorch-1.12.0/torch/csrc/autograd/profiler_python.cpp: In member function ‘void torch::autograd::profiler::python_tracer::{anonymous}::PythonTracer::start(size_t)’: > /var/tmp/portage/sci-libs/caffe2-1.12.0/work/pytorch-1.12.0/torch/csrc/autograd/profiler_python.cpp:376:20: error: invalid use of incomplete type ‘struct _frame’ > 376 | frame = frame->f_back; > | ^~ > In file included from /usr/include/python3.11/Python.h:42, > from /var/tmp/portage/sci-libs/caffe2-1.12.0/work/pytorch-1.12.0/torch/csrc/autograd/profiler_python.cpp:10: > /usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘struct _frame’ > 22 | typedef struct _frame PyFrameObject; > | ^~~~~~ > /var/tmp/portage/sci-libs/caffe2-1.12.0/work/pytorch-1.12.0/torch/csrc/autograd/profiler_python.cpp: In member function ‘void torch::autograd::profiler::python_tracer::{anonymous}::PythonTracer::recordPyCall(torch::autograd::profiler::python_tracer::{anonymous}::TraceContext*, PyFrameObject*)’: > /var/tmp/portage/sci-libs/caffe2-1.12.0/work/pytorch-1.12.0/torch/csrc/autograd/profiler_python.cpp:425:49: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’} > 425 | events_.emplace_back(TraceTag::kPy_Call, frame->f_lasti, ctx, frame->f_code); > | ^~ > /usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’} > 22 | typedef struct _frame PyFrameObject; > | ^~~~~~ > /var/tmp/portage/sci-libs/caffe2-1.12.0/work/pytorch-1.12.0/torch/csrc/autograd/profiler_python.cpp:425:70: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’} > 425 | events_.emplace_back(TraceTag::kPy_Call, frame->f_lasti, ctx, frame->f_code); > | ^~ > /usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’} > 22 | typedef struct _frame PyFrameObject; > | ^~~~~~ > ... "What’s New In Python 3.11" (https://docs.python.org/3.11/whatsnew/3.11.html#id6) says: > The PyFrameObject structure members have been removed from the public C API. > > While the documentation notes that the PyFrameObject fields are subject to change at any time, they have been stable for a long time and were used in several popular extensions. > > In Python 3.11, the frame struct was reorganized to allow performance optimizations. Some fields were removed entirely, as they were details of the old implementation. > > PyFrameObject fields: > > f_back: use PyFrame_GetBack(). > f_blockstack: removed. > f_builtins: use PyFrame_GetBuiltins(). > f_code: use PyFrame_GetCode(). > f_gen: use PyFrame_GetGenerator(). > f_globals: use PyFrame_GetGlobals(). > f_iblock: removed. > f_lasti: use PyFrame_GetLasti(). Code using f_lasti with PyCode_Addr2Line() should use PyFrame_GetLineNumber() instead; it may be faster. > f_lineno: use PyFrame_GetLineNumber() > f_locals: use PyFrame_GetLocals(). > f_stackdepth: removed. > f_state: no public API (renamed to f_frame.f_state). > f_trace: no public API. > f_trace_lines: use PyObject_GetAttrString((PyObject*)frame, "f_trace_lines"). > f_trace_opcodes: use PyObject_GetAttrString((PyObject*)frame, "f_trace_opcodes"). > f_localsplus: no public API (renamed to f_frame.localsplus). > f_valuestack: removed. > > ... So until upstream ports this package to support Python 3.11, ebuilds should set: PYTHON_COMPAT=( python3_{8..10} )
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63d4f2bfcfd5e696451103703854e9485c381314 commit 63d4f2bfcfd5e696451103703854e9485c381314 Author: Alfredo Tupone <tupone@gentoo.org> AuthorDate: 2022-08-29 06:41:51 +0000 Commit: Alfredo Tupone <tupone@gentoo.org> CommitDate: 2022-08-29 06:41:51 +0000 sci-libs/caffe2: no good for python 3.11 Closes: https://bugs.gentoo.org/864769 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alfredo Tupone <tupone@gentoo.org> sci-libs/caffe2/caffe2-1.11.0-r2.ebuild | 2 +- sci-libs/caffe2/caffe2-1.12.0.ebuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)