Bug 2049705 - FTBFS jpype fails to build with Python 3.11: error: PyFrameObject {aka struct _frame} has no member named f_lasti
Summary: FTBFS jpype fails to build with Python 3.11: error: PyFrameObject {aka struct...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: jpype
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Raphael Groner
QA Contact: Fedora Extras Quality Assurance
URL: https://pagure.io/fedora-qa/blocker-r...
Whiteboard:
: 2086264 2098724 (view as bug list)
Depends On: 1899449 2005829
Blocks: F38FTBFS PYTHON3.11 F37FTBFS F37FailsToInstall 2098977
TreeView+ depends on / blocked
 
Reported: 2022-02-02 14:59 UTC by Tomáš Hrnčiar
Modified: 2022-09-18 18:35 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-18 18:35:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github jpype-project jpype pull 1087 0 None open Fixes for 3.11 2022-09-12 22:16:11 UTC

Description Tomáš Hrnčiar 2022-02-02 14:59:25 UTC
jpype fails to build with Python 3.11.0a4.

native/common/jp_exception.cpp: In function ‘PyTracebackObject* tb_create(PyTracebackObject*, PyObject*, const char*, const char*, int)’:
native/common/jp_exception.cpp:518:23: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’; did you mean ‘cframe’?
  518 |                 state.frame = last_traceback->tb_frame;
      |                       ^~~~~
      |                       cframe
native/common/jp_exception.cpp:520:23: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’; did you mean ‘cframe’?
  520 |                 state.frame = NULL;
      |                       ^~~~~
      |                       cframe
native/common/jp_exception.cpp:546:38: error: ‘PyFrameObject’ {aka ‘struct _frame’} has no member named ‘f_lasti’
  546 |         traceback->tb_lasti = frame->f_lasti;
      |                                      ^~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

Changes of the PyFrameObject structure members:
    f_code: removed, use PyFrame_GetCode() instead. Warning: the function returns a strong reference, need to call Py_DECREF().
    f_back: changed, use PyFrame_GetBack().
    f_builtins: removed, use PyObject_GetAttrString(frame, "f_builtins").
    f_globals: removed, use PyObject_GetAttrString(frame, "f_globals").
    f_locals: removed, use PyObject_GetAttrString(frame, "f_locals").
    f_lasti: removed, use PyObject_GetAttrString(frame, "f_lasti").
    f_valuesstack: removed.
    f_stackdepth: removed.
    f_gen: removed.
    f_iblock: removed.
    f_state: removed.
    f_blockstack: removed.
    f_localsplus: removed.

The Python frame object is now created lazily. A side effect is that the f_back member must not be accessed directly, since its value is now also computed lazily. The PyFrame_GetBack() function must be called instead.

Code defining PyFrame_GetCode() on Python 3.8 and older:
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/03271117-jpype/

For all our attempts to build jpype with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/jpype/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Raphael Groner 2022-02-02 18:22:56 UTC
Thanks for your report. 

This seems somehow to be a regression we've seen with Python 3.10 and Fedora 35 as well. See bz1899449 with same error and as agreed [¹] as a blocker where we waited for upstream with next version 1.3.0 released, besides maybe exclude failing architecture (bz2005829 for s390x). Upstream is actively working on 1.3.1 but no official release available yet.

As currently used Python 3.11.0aX are pre-releases only, my suggestion is to wait for a final release.

[¹] https://pagure.io/fedora-qa/blocker-review/issue/466

Comment 2 Raphael Groner 2022-02-02 18:23:52 UTC
s/same error/similiar error/

Comment 3 Tomáš Hrnčiar 2022-02-03 07:34:45 UTC
In my opinion, this is the same but different regression like we have seen in bz1899449. There were further changes in Python 3.11 regarding PyFrameObject structure members (see my original comment above). I think it would be good to inform upstream about it so they are aware of it while working on 1.3.1.

Comment 4 Raphael Groner 2022-02-07 17:27:27 UTC
Execution of some tests fails with java 17, see bz2051183.

Comment 5 Ben Cotton 2022-02-08 20:08:18 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 6 Raphael Groner 2022-03-08 21:13:00 UTC
Well, is this still relevant for build on all architectures? e.g. I see actual Change request for F37 to exclude i386 if possible.

Comment 7 Miro Hrončok 2022-06-20 10:14:53 UTC
*** Bug 2098724 has been marked as a duplicate of this bug. ***

Comment 8 Miro Hrončok 2022-08-25 09:43:30 UTC
We are past Fedora 37 Beta Freeze and this package does not even install. What is the plan wrt this package? Can it please be removed from the distribution until this is solved?

Comment 9 Raphael Groner 2022-09-10 12:59:17 UTC
(In reply to Miro Hrončok from comment #8)
> We are past Fedora 37 Beta Freeze and this package does not even install.
> What is the plan wrt this package? Can it please be removed from the
> distribution until this is solved?

Is your comment about bug 2098976 marked as duplicate? In guess about missing numpy dependency with python 3.10 as stated there.

Comment 10 Raphael Groner 2022-09-10 13:12:20 UTC
(In reply to Miro Hrončok from comment #8)
> We are past Fedora 37 Beta Freeze and this package does not even install.
> What is the plan wrt this package? Can it please be removed from the
> distribution until this is solved?

Is your comment about bug 2098724 marked as duplicate? What happens if you do dnf install python3.10 in prior? Maybe dnf can not resolve versioned dependency of python(abi).
Please ignore comment #9 as I wrongly tried to reply to unrelated bug.

Comment 11 Miro Hrončok 2022-09-10 14:58:53 UTC
I have no idea what you mean about the duplicate, sorry.

See also https://bugzilla.redhat.com/show_bug.cgi?id=2098787#c7

Comment 12 Raphael Groner 2022-09-12 22:16:11 UTC
Upstream is aware, see issue and pull request there.
https://github.com/jpype-project/jpype/pull/1087

Comment 13 Miro Hrončok 2022-09-13 09:05:10 UTC
That's good news, but no reason to close this Bugzilla. The package still does not install in Fedora 37 and 38.

Comment 14 Raphael Groner 2022-09-14 23:08:41 UTC
*** Bug 2086264 has been marked as a duplicate of this bug. ***

Comment 15 Raphael Groner 2022-09-14 23:09:31 UTC
Another bugs with similiarly availabe upstream issues related python 3.11 were closed as deferred, so I decided to orientate there.

Comment 17 Miro Hrončok 2022-09-14 23:42:24 UTC
Please either retire or rebuild the package with Python 3.11 before closing this Bugzilla. The package still does not install in Fedora 37 and 38.

Comment 18 Raphael Groner 2022-09-15 04:56:02 UTC
Okay, you don't have to agree but then we both partly are wrong in assumptions.

> Merging #1087 (21ef638) into master (82a7658) will increase coverage by 0.00%. The diff coverage is 81.25%.

Well, I decide to retire for F37+ then. Please keep this package in F36. Thanks for your help.

Comment 19 Raphael Groner 2022-09-15 05:00:02 UTC
done.
[rawhide dfadde9] FTBFS in F37 with Python 3.11 rhbz#2049705

Comment 20 Miro Hrončok 2022-09-15 09:18:33 UTC
Thanks.

Comment 21 Miro Hrončok 2022-09-18 18:34:27 UTC
Hello,

Please note that this comment was generated automatically. If you feel that this output has mistakes, please contact me via email (mhroncok).

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 38.

Thanks for taking care of it!

Comment 22 Miro Hrončok 2022-09-18 18:35:39 UTC
Hello,

Please note that this comment was generated automatically. If you feel that this output has mistakes, please contact me via email (mhroncok).

All subpackages of a package against which this bug was filled are now installable or removed from Fedora 37.

Thanks for taking care of it!


Note You need to log in before you can comment on or make changes to this bug.