Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 488610 - dev-lang/python-2.7.5-r2::gentoo_prefix tries to delete non-existent file
Summary: dev-lang/python-2.7.5-r2::gentoo_prefix tries to delete non-existent file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All FreeMiNT
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-10-19 14:42 UTC by Alan Hourihane
Modified: 2013-10-20 18:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,560.00 KB, text/x-log)
2013-10-19 23:42 UTC, Alan Hourihane
Details
build log (build.log,696.35 KB, text/x-log)
2013-10-19 23:45 UTC, Alan Hourihane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Hourihane 2013-10-19 14:42:27 UTC
The line that says...

use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die

In the 2.7.5 ebuild should say...

use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk}

This matches the way the 3.x ebuilds do it, and crucially also fixes a "die" problem on FreeMiNT.
Comment 1 Mike Gilbert gentoo-dev 2013-10-19 15:52:02 UTC
I would like to see a build log showing a failure here.
Comment 2 Alan Hourihane 2013-10-19 20:21:00 UTC
The last lines how this....

Creating directory /usr/share/man
Creating directory /usr/share/man/man1
/usr/bin/install -c -m 644 /j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5/Misc/python.man \
	/j/var/tmp/portage/dev-lang/python-2.7.5-r2/image//usr/share/man/man1/python2.7.1
mv: cannot stat '/j/var/tmp/portage/dev-lang/python-2.7.5-r2/image/usr/bin/2to3': No such file or directory
mv: cannot stat '/j/var/tmp/portage/dev-lang/python-2.7.5-r2/image/usr/bin/pydoc': No such file or directory
mv: cannot stat '/j/var/tmp/portage/dev-lang/python-2.7.5-r2/image/usr/bin/idle': No such file or directory
rm: cannot remove '/j/var/tmp/portage/dev-lang/python-2.7.5-r2/image/usr/bin/idle2.7': No such file or directory
 * ERROR: dev-lang/python-2.7.5-r2 failed (install phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called call-ebuildshell 'src_install'
 *   environment, line 967:  Called src_install
 *   environment, line 4274:  Called die
 * The specific snippet of code:
 *           use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,lib-tk} || die;
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/python-2.7.5-r2'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/python-2.7.5-r2'`.
 * The complete build log is located at '/j/var/tmp/portage/dev-lang/python-2.7.5-r2/temp/build.log'.
 * The ebuild environment file is located at '/j/var/tmp/portage/dev-lang/python-2.7.5-r2/temp/environment'.
 * Working directory: '/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/m68k-atari-mint'
 * S: '/j/var/tmp/portage/dev-lang/python-2.7.5-r2/work/Python-2.7.5'
Comment 3 Mike Gilbert gentoo-dev 2013-10-19 22:01:39 UTC
Attach the entire log file please.
Comment 4 Alan Hourihane 2013-10-19 23:42:43 UTC
Created attachment 361378 [details]
build log
Comment 5 Alan Hourihane 2013-10-19 23:42:56 UTC
Uploaded.
Comment 6 Alan Hourihane 2013-10-19 23:45:41 UTC
Created attachment 361382 [details]
build log

new log, last one got truncated.
Comment 7 Mike Gilbert gentoo-dev 2013-10-20 00:09:55 UTC
You are using python from the prefix overlay, which differs significantly from that in the main tree. Reassigning to prefix maintainers.
Comment 8 Alan Hourihane 2013-10-20 09:13:10 UTC
You missed the point I made though.

In the 3.x ebuild it's done correctly, regardless of prefix.
Comment 9 Mike Gilbert gentoo-dev 2013-10-20 14:31:42 UTC
It works fine in the main tree version because the code is only invoked when idle2.7 actually exists.

Do not reassign this bug again.
Comment 10 Mike Gilbert gentoo-dev 2013-10-20 15:37:01 UTC
Sorry for being harsh. I would actually prefer to make the python-3.x ebuilds work more like the python-2.x ebuild.

Having the ebuild fail when removing a file which doesn't exist is a good signal to the developer that he needs to take a look and possibly fix a problem.
Comment 11 Alan Hourihane 2013-10-20 16:25:58 UTC
Mike, the problem is that the 3.x ebuild does this....

        if use build; then
                rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,sqlite3,t
est,tkinter}
        else
                use elibc_uclibc && rm -fr "${libdir}/test"
                use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
                use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib
,tkinter,test/test_tk*}
        fi

The 2.7.5 ebuild does this....

        if use build; then
                rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{bsddb,dbhash.py,i
dlelib,lib-tk,sqlite3,test}
        else
                use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py,test/test_bsddb
*} || die
                use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || d
ie
                use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib,
lib-tk} || die
                use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test}
        fi


So, The 3.x ebuild DOES NOT! check anything to do with idle2.7, which is why you claim it works in 3.x.

Again, the "use tk" line about is works fine for me in 3.x, just not 2.7 because of this.

So, you either need to fix the 3.x ebuild to fail, or fix the 2.7.5 not to fail.

Either way, there will be an additional fix for the platforms that don't end up with this file.

Please advise what the correct course of action actually is.
Comment 12 Mike Gilbert gentoo-dev 2013-10-20 16:31:02 UTC
By idle2.7, I mean idle${SLOT} of course.

Ideally I would change this:

use tk || rm -fr "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib
,tkinter,test/test_tk*}

to this:

use tk || rm -r "${ED}usr/bin/idle${SLOT}" "${libdir}/"{idlelib
,tkinter,test/test_tk*} || die

in the python-3.x ebuilds.

However, that is more of a QA cleanup item, and not a change I'm going to just make at random in a stable ebuild. I will probably do it on the next python-3.x version bump.
Comment 13 Alan Hourihane 2013-10-20 16:33:49 UTC
The you need to do it to the other lines in there as well, including the...

  if use build; then
     rm -rf ...

i.e. remove the '-f' to force.

To ensure the same behaviour.

But to be honest, I don't see the point in removing the '-f' flag. All this does is make "rm" return success even when the file doesn't exist. And we're removing the file anyway, so who cares whether it exists or not.
Comment 14 Mike Gilbert gentoo-dev 2013-10-20 17:01:25 UTC
(In reply to Alan Hourihane from comment #13)
> The you need to do it to the other lines in there as well

Of course.

> including the...
> 
>   if use build; then
>      rm -rf ...
> 
> i.e. remove the '-f' to force.
> 

The logic surrounding USE=build is a bit complex, so I have generally avoided making any changes there. It's only used for stage1 bootstrapping, so it's not a high priority.

> But to be honest, I don't see the point in removing the '-f' flag. All this
> does is make "rm" return success even when the file doesn't exist. And we're
> removing the file anyway, so who cares whether it exists or not.

I have already explained my rationale; let's agree to disagree.
Comment 15 Alan Hourihane 2013-10-20 17:09:49 UTC
Indeed, we shall.

I'll just add USE=tk and avoid the whole trouble.
Comment 16 Fabian Groffen gentoo-dev 2013-10-20 18:14:28 UTC
@@ -4,0 +5,3 @@
+  20 Oct 2013; Fabian Groffen <grobian@gentoo.org> python-2.7.5-r2.ebuild:
+  Fix unintended die on FreeMiNT, bug #488610
+