Bug 1709037

Summary: Review Request: python-javabridge - Python wrapper for the Java Native Interface
Product: [Fedora] Fedora Reporter: Raphael Groner <projects.rg>
Component: Package ReviewAssignee: Zbigniew Jędrzejewski-Szmek <zbyszek>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: package-review, zbyszek, zebob.m
Target Milestone: ---Flags: zbyszek: fedora-review+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-javabridge-1.0.18-3.20190729gitc7ccaed.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-08 09:13:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Raphael Groner 2019-05-12 18:18:10 UTC
Spec URL: https://raphgro.fedorapeople.org/review/misc//python-javabridge.spec
SRPM URL: https://raphgro.fedorapeople.org/review/misc//python-javabridge-1.0.18-1.fc30.src.rpm

Description:

The javabridge Python package makes it easy to start a Java virtual machine (JVM)
from Python and interact with it. Python code can interact with the JVM using a
low-level API or a more convenient high-level API.
An python module which provides a convenient example.

Comment 1 Raphael Groner 2019-05-12 18:20:56 UTC
Currently, FTBFS except on epel7 with x86_64.
https://koji.fedoraproject.org/koji/taskinfo?taskID=34814909

There's some need for a patch to Cython with Python 3,
as noticed with failed builds in Rawhide and F30.
https://github.com/LeeKamentsky/python-javabridge/issues/164

Comment 2 Robert-André Mauchin 🐧 2019-06-05 20:42:18 UTC
Add the commit https://github.com/LeeKamentsky/python-javabridge/commit/7a914577f0f13328d0e315c18fb3505c5113c82e as a patch?

Comment 3 Raphael Groner 2019-07-25 03:49:00 UTC
(In reply to Robert-André Mauchin from comment #2)
> Add the commit
> https://github.com/LeeKamentsky/python-javabridge/commit/
> 7a914577f0f13328d0e315c18fb3505c5113c82e as a patch?

Will do ASAP, thanks.

Comment 4 Raphael Groner 2019-07-27 09:37:19 UTC
SPEC: https://raphgro.fedorapeople.org/review/py/python-javabridge/python-javabridge.spec
SRPM: https://raphgro.fedorapeople.org/review/py/python-javabridge/python-javabridge-1.0.18-2.20190723git16d6c91.fc30.src.rpm

Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=36607367

%changelog
* Sat Jul 27 2019 Raphael Groner <> - 1.0.18-2.20190723git16d6c91
- use latest git snapshot to support cython with python3

Thanks for the review!

Comment 5 Raphael Groner 2019-07-27 09:38:43 UTC
Ohno... FTBFS with latest git.

Comment 6 Raphael Groner 2019-07-27 11:48:46 UTC
epel7 on x86 only... Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=36608068

Comment 7 Raphael Groner 2019-07-30 06:00:35 UTC
Suspection for FTBFS is that setup.py doesn't find jvm.so, for ppc64le and aarch64.

BUILDSTDERR:   File "setup.py", line 140, in ext_modules
BUILDSTDERR:     library_dirs = [os.path.dirname(jvm_so)]

The relevant code for find_jre_bin_jdk_so() return value read into jvm_so variable:
https://github.com/LeeKamentsky/python-javabridge/blob/master/javabridge/locate.py#L233

Maybe there's no java_home ($JAVA_HOME environment variable) or any other pathes are b0rken.

Comment 8 Raphael Groner 2019-08-06 10:25:30 UTC
Asked in IRC #fedora-java:

[06.08.19 12:13] <mizdebsk> RaphGro, https://github.com/LeeKamentsky/python-javabridge/blob/master/javabridge/locate.py#L242
[06.08.19 12:13] <mizdebsk> arches = ('amd64', 'i386', '') if is_linux
[06.08.19 12:13] <mizdebsk> seems they support only x86
[06.08.19 12:16] <mizdebsk> or just make the code arch independent
[06.08.19 12:16] <mizdebsk> what's the point of hardcoding lists of arches?

...  maybe I can disable that piece of restrictive code with a downstream patch, later.

Comment 9 Zbigniew Jędrzejewski-Szmek 2019-09-15 15:07:38 UTC
Missing: BR: gcc

Something's off with the spacing in description:
$ rpm -qp --qf '%{description}' /var/lib/mock/fedora-rawhide-x86_64/result/python3-javabridge-1.0.18-2.20190723git16d6c91.fc32.x86_64.rpm|nl -ba
     1	
     2	The javabridge Python package makes it easy to start a Java virtual machine (JVM)
     3	from Python and interact with it. Python code can interact with the JVM using a
     4	low-level API or a more convenient high-level API.

Also, having a description for the binary package which does not get created is strange.

My suggestion:

%global _description %{expand:
The javabridge Python package makes it easy to start a Java virtual machine (JVM)
from Python and interact with it. Python code can interact with the JVM using a
low-level API or a more convenient high-level API.}

%description %_description

%description -n python%{python3_pkgversion}-%{modname} %_description

From %check:
> nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module
→ maybe add BR: python%{python3_pkgversion}-coverage to avoid the warning?

> sh: python: command not found
> Warning: Error loading ����
It seems unversioned python is being called.
The call is:
> /bin/sh bin/python -c import sysconfig; from os.path import join; print(join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('multiarchsubdir')[1:], sysconfig.get_config_var('LDLIBRARY')))
This is going to give wrong results. I think that file needs to be patched to call
%__python3 instead.

You build twice... I see setup.py manipulates sys.path to do import from $PWD, which
doesn't work, because the binary module is missing. Too bad, I don't see an easy way
to avoid this issue. Building twice doesn't seem so bad... OK.

Comment 10 Raphael Groner 2019-10-10 02:57:31 UTC
Thanks for your advice. Though, I don't see any blockers to approve, otherwise please guide me in our official packaging guidelines.
https://docs.fedoraproject.org/en-US/packaging-guidelines/

> Also, having a description for the binary package which does not get created is strange.
It's suggested in the official python sample. No idea if rpmbuild accepts an empty main description.

> → maybe add BR: python%{python3_pkgversion}-coverage to avoid the warning?
No, coverage is not relevant for the package build, that seems to be a feature for upstream only.

> It seems unversioned python is being called.
I fail to see for what step of the build task this counts.

Comment 11 Zbigniew Jędrzejewski-Szmek 2019-10-10 08:24:02 UTC
(In reply to Raphael Groner from comment #10)
> Thanks for your advice. Though, I don't see any blockers to approve,
> otherwise please guide me in our official packaging guidelines.
> https://docs.fedoraproject.org/en-US/packaging-guidelines/

> Missing: BR: gcc
https://docs.fedoraproject.org/en-US/packaging-guidelines/#buildrequires

> > Also, having a description for the binary package which does not get created is strange.
> It's suggested in the official python sample. No idea if rpmbuild accepts an
> empty main description.

Hmm, I think I was totally wrong here, please ignore.

> > → maybe add BR: python%{python3_pkgversion}-coverage to avoid the warning?
> No, coverage is not relevant for the package build, that seems to be a
> feature for upstream only.

Ack.

> > It seems unversioned python is being called.
> I fail to see for what step of the build task this counts.

Calling unversioned python is against the guidelines (https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_python_version_support):
"Packages in Fedora MUST NOT use /usr/bin/python".
Among other things, it will also be allowed to have no /usr/bin/python
at all in local installations. /usr/bin/python3 should be called.

Comment 12 Raphael Groner 2019-11-15 21:24:48 UTC
The python warning seems to have been a bug in the build environment.

% grep Warn build.log                                                
/usr/lib64/python3.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/builder/rpmbuild/BUILD/python-javabridge-16d6c91c3aa9dbf8c80de1fc442aca696a6197fa/_javabridge_mac.pxd
/usr/lib64/python3.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/builder/rpmbuild/BUILD/python-javabridge-16d6c91c3aa9dbf8c80de1fc442aca696a6197fa/_javabridge_nomac.pxd
Übereinstimmungen in Binärdatei build.log

https://koji.fedoraproject.org/koji/taskinfo?taskID=39019569

Comment 15 Zbigniew Jędrzejewski-Szmek 2019-11-17 11:43:22 UTC
+ package name is OK
+ latest version (git snapshot)
+ license is acceptable for Fedora (MIT)
+ license is specified correctly
+ builds and installs OK
+ BR/R/P look correct
+ package seems functional

rpmlint:
python3-javabridge.x86_64: E: description-line-too-long C The javabridge Python package makes it easy to start a Java virtual machine (JVM)
→ maybe "Start the Java VM from the Python interpreter" ?

Package is APPROVED.

Comment 16 Raphael Groner 2019-11-17 13:54:28 UTC
https://pagure.io/releng/fedora-scm-requests/issue/19764

Thanks.

Comment 17 Gwyn Ciesla 2019-11-17 18:41:58 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-javabridge