Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 758881

Summary: dev-java/jython-2.7.0-r2 AttributeError: 'NoneType' object has no attribute 'startswith'
Product: Gentoo Linux Reporter: Jean-Claude Aciman <jcl.aciman>
Component: Current packagesAssignee: Java team <java>
Status: RESOLVED FIXED    
Severity: major CC: ionen, jon, jstein, leonchik1976, lssndrbarbieri, rossi.f, sam, scott, treecleaner, valentin.ittvs
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/22895
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: all requested files
jython-2.7.0-r2.ebuild.patch

Description Jean-Claude Aciman 2020-12-07 09:34:36 UTC
Required by "emerge ant", the package jython-2.7.0.r2 failed to compile in the following configuration:

GENTOO_VM=icedtea-bin-8  CLASSPATH="" JAVA_HOME="/opt/icedtea-bin-3.16.0"
JAVACFLAGS="-source 1.7 -target 1.7" COMPILER="javac"

Error reported is:

  File "/var/tmp/portage/dev-java/jython-2.7.0-r2/image/usr/share/jython-2.7/Lib/posixpath.py", line 373, in _joinrealpath
    if isabs(rest):
  File "/var/tmp/portage/dev-java/jython-2.7.0-r2/image/usr/share/jython-2.7/Lib/posixpath.py", line 61, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'
 * ERROR: dev-java/jython-2.7.0-r2::gentoo failed (install phase):
 *   (no error message)

_______________________________________________________________________________
Attchment includes:
build.log
emerge --info =jython-2.7.0
environment


Reproducible: Always
Comment 1 Jean-Claude Aciman 2020-12-07 09:36:01 UTC
Created attachment 677134 [details]
all requested files

Contents:
build.log
environment
emerge --info
Comment 2 Fabio Rossi 2021-01-10 12:04:30 UTC
Created attachment 682225 [details, diff]
jython-2.7.0-r2.ebuild.patch

I have applied the attached patch to the current ebuild in portage, the package now build successfully
Comment 3 Fabio Rossi 2021-01-10 12:10:13 UTC
During the install phase there is a warning

/var/tmp/portage/dev-java/jython-2.7.0-r2/temp/jython: /usr/share/bashdb/bashdb-main.inc: No such file or directory
/var/tmp/portage/dev-java/jython-2.7.0-r2/temp/jython: warning: cannot start debugger; debugging mode disabled

but it seems it can be ignored, there is no need to depend on bashdb. It happens during call to "python_domodule epython.py" which calls python_optimize but eventually I can see the optimized file /usr/share/jython-2.7/Lib/site-packages/epython$py.class being generated
Comment 4 Jon Janzen 2021-01-14 04:32:46 UTC
I can confirm that I'm experiencing the same build failure on my machine, and additionally that the provide patch allows the package to build.
Comment 5 Ionen Wolkens gentoo-dev 2021-02-16 17:55:55 UTC
*** Bug 770958 has been marked as a duplicate of this bug. ***
Comment 6 Ionen Wolkens gentoo-dev 2021-02-16 17:57:09 UTC
Taking the liberty to re-open given this was never really fixed and the patch seems to help.
Comment 7 Jean-Claude Aciman 2021-03-06 22:27:48 UTC
Hi,
I got exactly the same problem today and the patch don't work. It cannot be applied without error as follow:
The text leading up to this was:

--------------------------
|--- /usr/portage/dev-java/jython/jython-2.7.0-r2.ebuild	2021-01-09 17:04:20.798391252 +0100
|+++ /var/lib/layman/__mine__/dev-java/jython/jython-2.7.0-r2.ebuild	2021-01-10 12:26:24.341996198 +0100
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored           

How to solve this issue? Please help!
Comment 8 Sebastian Pipping gentoo-dev 2021-03-06 23:02:51 UTC
(In reply to Jean-Claude Aciman from comment #7)
> I got exactly the same problem today and the patch don't work. It cannot be
> applied without error as follow:

Based on the output of patch you shared: There's a problem in the way you're using patch.  Try format "patch path/to/target < /path/to/patch" or see "man patch" please.
Comment 9 Jean-Claude Aciman 2021-03-08 13:57:05 UTC
(In reply to Sebastian Pipping from comment #8)
> (In reply to Jean-Claude Aciman from comment #7)
> > I got exactly the same problem today and the patch don't work. It cannot be
> > applied without error as follow:
> 
> Based on the output of patch you shared: There's a problem in the way you're
> using patch.  Try format "patch path/to/target < /path/to/patch" or see "man
> patch" please.

I did not use "patch" to apply this, but I ave put the patch_to_apply.patch file in the directory /etc/portage/patches/dev-lang/jython/, then doing a normal emerge for the packet. Normally, the patch must be applied correctly (with all the others from the repository), but there the application ot this patch fails.
Comment 10 Sebastian Pipping gentoo-dev 2021-03-08 14:04:44 UTC
(In reply to Jean-Claude Aciman from comment #9)
> I did not use "patch" to apply this, but I ave put the patch_to_apply.patch
> file in the directory /etc/portage/patches/dev-lang/jython/, then doing a
> normal emerge for the packet. Normally, the patch must be applied correctly
> (with all the others from the repository), but there the application ot this
> patch fails.

I see, my bad.  Have you tried adjusting the path inside the patch file?
Comment 11 Jean-Claude Aciman 2021-03-08 15:43:44 UTC
(In reply to Sebastian Pipping from comment #10)
> (In reply to Jean-Claude Aciman from comment #9)
> > I did not use "patch" to apply this, but I ave put the patch_to_apply.patch
> > file in the directory /etc/portage/patches/dev-lang/jython/, then doing a
> > normal emerge for the packet. Normally, the patch must be applied correctly
> > (with all the others from the repository), but there the application ot this
> > patch fails.
> 
> I see, my bad.  Have you tried adjusting the path inside the patch file?

I did and the full result of "ebuild jython-2.7.0-r2.ebuild clean prepare" is:

# ebuild jython-2.7.0-r2.ebuild clean prepare
 * jython-2.7.0-sources.jar BLAKE2B SHA512 size ;-) ...                                                              [ ok ]
 * checking ebuild checksums ;-) ...                                                                                 [ ok ]
 * checking auxfile checksums ;-) ...                                                                                [ ok ]
 * checking miscfile checksums ;-) ...                                                                               [ ok ]
 * Using: icedtea-8
>>> Unpacking source...
>>> Unpacking jython-2.7.0-sources.jar to /var/tmp/portage/dev-java/jython-2.7.0-r2/work
>>> Source unpacked in /var/tmp/portage/dev-java/jython-2.7.0-r2/work
>>> Preparing source in /var/tmp/portage/dev-java/jython-2.7.0-r2/work ...
 * Applying jython-2.5.2-distutils_scripts_location.patch ...
patching file Lib/distutils/command/install.py
Hunk #1 succeeded at 87 with fuzz 2 (offset 17 lines).                                                               [ ok ]
 * Applying jython-2.5.2-respect_PYTHONPATH.patch ...
patching file src/org/python/core/PySystemState.java
Hunk #1 succeeded at 807 with fuzz 2 (offset 161 lines).                                                             [ ok ]
 * Applying jython-2.7_beta1-ant.patch ...                                                                           [ ok ]
 * Applying jython-2.7_beta1-dont-always-recompile-classes.patch ...                                                 [ ok ]
 * Applying jython-2.7_beta2-maxrepeat-import.patch ...                                                              [ ok ]
 * Applying jython-2.7.0-build.xml.patch ...                                                                         [ ok ]
 * Applying CVE-2016-4000.patch ...                                                                                  [ ok ]
 * Applying jython-2.7.0-r2.ebuild.patch ...
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- /usr/portage/dev-java/jython/jython-2.7.0-r2.ebuild	2021-01-09 17:04:20.798391252 +0100
|+++ /var/lib/layman/__mine__/dev-java/jython/jython-2.7.0-r2.ebuild	2021-01-10 12:26:24.341996198 +0100
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored                                                                                             [ !! ]
 * ERROR: dev-java/jython-2.7.0-r2::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/dev-java/jython-2.7.0-r2/jython-2.7.0-r2.ebuild.patch
Comment 12 Fabio Rossi 2021-03-08 16:07:28 UTC
The patch is to change the ebuild file itself as indicated in the name, it is not a patch to be added in /etc/portage/patches/dev-lang/jython ;-)

Starting from the ebuild in portage you use the patch to produce a new ebuild to be installed in your overlay
Comment 13 Sebastian Pipping gentoo-dev 2021-03-08 16:29:51 UTC
I'm not sure I understand.  Why would you apply a patch against the ebuild from inside the ebuild?  You need to patch the ebuild and then run it, no?
Comment 14 Jean-Claude Aciman 2021-03-08 18:44:57 UTC
(In reply to Sebastian Pipping from comment #13)
> I'm not sure I understand.  Why would you apply a patch against the ebuild
> from inside the ebuild?  You need to patch the ebuild and then run it, no?

You are right. I applied the patch directly to the ebuild, updated the Manifest then run the ebuild patched and all worked fine.
Thank you for your help.
Comment 15 Volkmar W. Pogatzki 2021-05-04 21:59:59 UTC
(In reply to Jonathan Janzen from comment #4)
> I can confirm that I'm experiencing the same build failure on my machine,
> and additionally that the provide patch allows the package to build.

That patch causes trouble in qa-reports:
https://qa-reports.gentoo.org/output/gentoo-ci/28728c336e/output.html#dev-java/jython
Comment 16 Volkmar W. Pogatzki 2021-05-07 06:55:12 UTC
(In reply to Volkmar W. Pogatzki from comment #15)
> (In reply to Jonathan Janzen from comment #4)
> > I can confirm that I'm experiencing the same build failure on my machine,
> > and additionally that the provide patch allows the package to build.
> 
> That patch causes trouble in qa-reports:
> https://qa-reports.gentoo.org/output/gentoo-ci/28728c336e/output.html#dev-
> java/jython

Removing PATCH keyword since the patch was wrong
Comment 17 Agostino Sarubbo gentoo-dev 2021-09-30 07:03:49 UTC
Dear treecleaner@:

I'm still able to reproduce this issue right now.

Since it has not been fixed for a long time, I'd suggest to evaluate if it is the case to remove this package from the tree. Thanks
Comment 18 Larry the Git Cow gentoo-dev 2021-11-13 10:24:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d565de9ee70694ab90d0adba26c937a5a08a997

commit 2d565de9ee70694ab90d0adba26c937a5a08a997
Author:     Volkmar W. Pogatzki <gentoo@pogatzki.net>
AuthorDate: 2021-05-03 23:01:40 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-11-13 10:24:35 +0000

    dev-java/jython: min java 1.8, icu4j:55, asm:9
    
    Closes: https://bugs.gentoo.org/758881
    Closes: https://bugs.gentoo.org/645808
    Package-Manager: Portage-3.0.18, Repoman-3.0.2
    Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net>
    Closes: https://github.com/gentoo/gentoo/pull/22895
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-java/jython/jython-2.7.0-r3.ebuild | 152 +++++++++++++++++++++++++++++++++
 1 file changed, 152 insertions(+)