Bug 2254033 - python-jnius uses Cython 0.29 to build, please update to Cython 3 - upstream release 1.6.1
Summary: python-jnius uses Cython 0.29 to build, please update to Cython 3 - upstream ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-jnius
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Raphael Groner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2261576 (view as bug list)
Depends On:
Blocks: 1996356 F40FTBFS DROP_CYTHON_0.29 2261576
TreeView+ depends on / blocked
 
Reported: 2023-12-11 16:08 UTC by Miro Hrončok
Modified: 2024-02-27 17:57 UTC (History)
3 users (show)

Fixed In Version: python-jnius-1.6.1-1.fc41 python-jnius-1.6.1-1.fc40
Clone Of:
Environment:
Last Closed: 2024-02-26 15:22:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gentoo 917562 0 None None None 2024-02-26 09:57:31 UTC
Github kivy/pyjnius/commit/fd748e5db48d8e69e4aeab9a2af1400871dff46b 0 None None None 2023-12-12 11:23:34 UTC
Github kivy/pyjnius/releases/tag/1.6.1 0 None None None 2023-12-12 11:22:02 UTC

Description Miro Hrončok 2023-12-11 16:08:41 UTC
Description of problem:
As the maintainer of the deprecated python-cython0.29 package, I'd like to get rid of it. I'm opening this bugzilla to track the migration of python-jnius to Cython 3.


There is this upstream commit https://github.com/kivy/pyjnius/commit/fd748e5db48d8e69e4aeab9a2af1400871dff46b but the Fedora package seems quite outdated.

Please backport that and let me know if you need help. Thanks.

Version-Release number of selected component:
python-jnius-0:1.3.0-17.fc39.src

Comment 1 Raphael Groner 2023-12-12 11:22:03 UTC
Thanks for letting me know about deprecated CPython. Patches welcome, could you provide a Pull Request for review? I'll provide a new build ASAP.

By the way, there's release 1.6.1 available. Is that patch for CPython included?
https://github.com/kivy/pyjnius/releases/tag/1.6.1

Comment 2 Raphael Groner 2023-12-12 11:23:34 UTC
s/CPython/Cython/g

Comment 3 Miro Hrončok 2023-12-12 11:36:05 UTC
Updating to 1.6.0+ should include this, yes.

Comment 4 Aoife Moloney 2024-02-15 23:07:33 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 5 Miro Hrončok 2024-02-24 15:44:17 UTC
I plan to retire Cython 0.29 in Fedora 41 next week. Let me know if I should wait.

Comment 6 Raphael Groner 2024-02-26 07:05:02 UTC
How to fix those errors generated from Cython and restrictive gcc options.

running build_ext
warning: jnius/jnius.pyx:102:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
Compiling jnius/jnius.pyx because it changed.
[1/1] Cythonizing jnius/jnius.pyx
building 'jnius' extension
creating build/temp.linux-x86_64-cpython-312
creating build/temp.linux-x86_64-cpython-312/jnius
gcc -fno-strict-overflow -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fcf-protection -fexceptions -fcf-protection -fexceptions -fcf-protection -fexceptions -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -I/usr/lib/jvm/java-17-openjdk-17.0.10.0.7-1.fc40.x86_64/include -I/usr/lib/jvm/java-17-openjdk-17.0.10.0.7-1.fc40.x86_64/include/linux -I/usr/include/python3.12 -c jnius/jnius.c -o build/temp.linux-x86_64-cpython-312/jnius/jnius.o
jnius/jnius.c: In function ‘__pyx_f_5jnius_get_jnienv’:
jnius/jnius.c:22570:76: error: passing argument 2 of ‘(*__pyx_v_5jnius_jvm)->AttachCurrentThread’ from incompatible pointer type [-Wincompatible-pointer-types]
22570 |   (void)((__pyx_v_5jnius_jvm[0])->AttachCurrentThread(__pyx_v_5jnius_jvm, (&__pyx_v_env), NULL));
      |                                                                           ~^~~~~~~~~~~~~
      |                                                                            |
      |                                                                            const struct JNINativeInterface_ ***
jnius/jnius.c:22570:76: note: expected ‘void **’ but argument is of type ‘const struct JNINativeInterface_ ***’
jnius/jnius.c: In function ‘__pyx_f_5jnius_convert_jstring_to_python’:
jnius/jnius.c:31003:19: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
31003 |   __pyx_v_j_chars = (__pyx_v_j_env[0])->GetStringChars(__pyx_v_j_env, __pyx_v_j_string, NULL);
      |                   ^
jnius/jnius.c: In function ‘__pyx_pf_5jnius_13MetaJavaClass_8resolve_class’:
jnius/jnius.c:43717:30: error: assignment to ‘jobject’ {aka ‘struct _jobject *’} from incompatible pointer type ‘struct _jobject **’ [-Wincompatible-pointer-types]
43717 |           (__pyx_v_jargs[0]) = ((jobject *)__pyx_v_classLoader);
      |                              ^
jnius/jnius.c:43726:30: error: assignment to ‘jobject’ {aka ‘struct _jobject *’} from incompatible pointer type ‘struct _jobject **’ [-Wincompatible-pointer-types]
43726 |           (__pyx_v_jargs[1]) = __pyx_v_interfaces;
      |                              ^
jnius/jnius.c: In function ‘__pyx_f_5jnius_create_proxy_instance’:
jnius/jnius.c:61433:36: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
61433 |   (__pyx_v_invoke_methods[0]).name = ((char const *)"invoke0");
      |                                    ^
jnius/jnius.c:61442:41: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
61442 |   (__pyx_v_invoke_methods[0]).signature = ((char const *)"(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;");
      |                                         ^
error: command '/usr/bin/gcc' failed with exit code 1

Comment 7 Miro Hrončok 2024-02-26 08:56:15 UTC
This is a known issue in Cython. https://github.com/cython/cython/issues/2747

As a workaround set %global build_type_safety_c 2

See e.g. https://src.fedoraproject.org/rpms/python-lxml/c/0f5102956846f0396780ac3ff116c20795dbbf89?branch=rawhide

Comment 8 Raphael Groner 2024-02-26 09:57:31 UTC
(In reply to Miro Hrončok from comment #7)
> This is a known issue in Cython. https://github.com/cython/cython/issues/2747

Bummer, again with enthusiastic update maniac, often seen with gcc while ignoring mass rebuilds for prior tests. /rant

When reading through similiar comments, other distro uses clang replacement with lxml and maybe similiarly some downgrade option with also clang for pyjnius is alternative workaround. Proposed build_type_safety_c shows actually as ugly (but working) hack for me. Doubtful gcc 14 can foreseeable revert that faulty default setting.

Comment 9 Fedora Update System 2024-02-26 15:19:28 UTC
FEDORA-2024-6e03f90a4f (python-jnius-1.6.1-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-6e03f90a4f

Comment 10 Fedora Update System 2024-02-26 15:22:34 UTC
FEDORA-2024-6e03f90a4f (python-jnius-1.6.1-1.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Raphael Groner 2024-02-26 15:24:59 UTC
*** Bug 2261576 has been marked as a duplicate of this bug. ***

Comment 12 Fedora Update System 2024-02-26 15:26:28 UTC
FEDORA-2024-c6133f5811 (python-jnius-1.6.1-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-c6133f5811

Comment 13 Fedora Update System 2024-02-26 15:28:34 UTC
FEDORA-2024-c6133f5811 (python-jnius-1.6.1-1.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Miro Hrončok 2024-02-27 17:57:16 UTC
For the record, the cython+gcc14 problem has a workaround currently proposed at https://src.fedoraproject.org/rpms/Cython/pull-request/57


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