Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 341687 - [PATCH] dev-util/gprof2dot and Python3
Summary: [PATCH] dev-util/gprof2dot and Python3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2010-10-18 21:10 UTC by Nico Schlömer
Modified: 2012-03-15 20:19 UTC (History)
2 users (show)

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


Attachments
First try on a patch for Python 3 (without breaking Python 2) (0001-Support-both-Python-2.x-and-3.x.patch,20.39 KB, patch)
2010-11-05 17:14 UTC, Sebastian Pipping
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nico Schlömer 2010-10-18 21:10:35 UTC
Hi,

based on the error I get with dev-util/gprof2dot compilation


==================== *snip* ====================
 * Compilation and optimization of Python modules for CPython 3.1 ...
*** Error compiling /usr/lib64/python3.1/site-packages/gprof2dot/gprof2dot.py ...
  File "/usr/lib64/python3.1/site-packages/gprof2dot/gprof2dot.py", line 43
    return u"%u\xd7" % (x,)
                   ^
SyntaxError: invalid syntax
                                                                         [ !! ]
==================== *snap* ====================

I think that gprof2dot should be limited to Python 2.

Cheers,
Nico

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-10-19 03:36:59 UTC
Please post your `emerge --info' too and attach the entire build log.
Comment 2 Nico Schlömer 2010-10-22 23:08:05 UTC
I'm using Paludis and have no time to find out how to retrieve this data at the moment. If you emerge the package with Python 3 installed, I'm sure you'll see the same error message though.
Feel free to close as invalid if that's not satisfactory.
Comment 3 Sebastian Pipping gentoo-dev 2010-11-05 17:14:01 UTC
Created attachment 253305 [details, diff]
First try on a patch for Python 3 (without breaking Python 2)

Review and testing wanted.

(In case of no reply in 30 days I'll apply the patch to the package in Gentoo.)
Comment 4 Nico Schlömer 2010-11-05 19:13:24 UTC
Works for me.
Comment 5 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-11-07 00:01:52 UTC
I recommend sending this patch to upstream...
Comment 6 Sebastian Pipping gentoo-dev 2010-11-07 00:09:49 UTC
Reported upstream now:
http://code.google.com/p/jrfonseca/issues/detail?id=44
Comment 7 Martin Mokrejš 2012-03-14 21:36:22 UTC
I get this error with dev-util/gprof2dot-0_p20100216 as of now.
>>> Install gprof2dot-0_p20100216 into /var/tmp/portage/dev-util/gprof2dot-0_p20100216/image/ category dev-util
 * Installation of dev-util/gprof2dot-0_p20100216 with CPython 2.7...
 * Installation of dev-util/gprof2dot-0_p20100216 with CPython 3.1...
 * Generating '/usr/bin/gprof2dot' wrapper script
>>> Completed installing gprof2dot-0_p20100216 into /var/tmp/portage/dev-util/gprof2dot-0_p20100216/image/


>>> Installing (1 of 1) dev-util/gprof2dot-0_p20100216
 * Compilation and optimization of Python modules for CPython 2.7 ...                                   [ ok ]
 * Compilation and optimization of Python modules for CPython 3.1 ...                                   [ !! ]
 *     *** Error compiling /usr/lib64/python3.1/site-packages/gprof2dot/gprof2dot.py ...
 *     File "/usr/lib64/python3.1/site-packages/gprof2dot/gprof2dot.py", line 43
 *     return u"%uxd7" % (x,)
 *     ^
 *     SyntaxError: invalid syntax



Confirming that the patch works:

# emerge dev-util/gprof2dot
Calculating dependencies... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) dev-util/gprof2dot-0_p20100216
 * gprof2dot-0_p20100216.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                        [ ok ]
>>> Unpacking source...
>>> Unpacking gprof2dot-0_p20100216.tar.bz2 to /var/tmp/portage/dev-util/gprof2dot-0_p20100216/work
>>> Source unpacked in /var/tmp/portage/dev-util/gprof2dot-0_p20100216/work
>>> Preparing source in /var/tmp/portage/dev-util/gprof2dot-0_p20100216/work/gprof2dot-0_p20100216 ...
 * Applying python3.patch ...                                                                           [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-util/gprof2dot-0_p20100216/work/gprof2dot-0_p20100216 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-util/gprof2dot-0_p20100216/work/gprof2dot-0_p20100216 ...
>>> Source compiled.
>>> Test phase [not enabled]: dev-util/gprof2dot-0_p20100216

>>> Install gprof2dot-0_p20100216 into /var/tmp/portage/dev-util/gprof2dot-0_p20100216/image/ category dev-util
 * Installation of dev-util/gprof2dot-0_p20100216 with CPython 2.7...
 * Installation of dev-util/gprof2dot-0_p20100216 with CPython 3.1...
 * Generating '/usr/bin/gprof2dot' wrapper script
>>> Completed installing gprof2dot-0_p20100216 into /var/tmp/portage/dev-util/gprof2dot-0_p20100216/image/


>>> Installing (1 of 1) dev-util/gprof2dot-0_p20100216
 * Compilation and optimization of Python modules for CPython 2.7 ...                                   [ ok ]
 * Compilation and optimization of Python modules for CPython 3.1 ...                                   [ ok ]
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
#


Please apply the patch, provide if possible also a current version (2011-10-23) and finally, there is some die(0 call missing in the ebuild. The current, unpatched ebuild let emerge to finish although "Compilation and optimization of Python modules for CPython 3.1 ..." failed with the above error. That is I think wrong.
Comment 8 Sebastian Pipping gentoo-dev 2012-03-15 20:19:53 UTC
(In reply to comment #7)
> Please apply the patch

+  15 Mar 2012; Sebastian Pipping <sping@gentoo.org>
+  gprof2dot-0_p20100216.ebuild, +files/gprof2dot-0_p20100216-python3.patch:
+  Support Python 3.x (bug #341687)
+


>, provide if possible also a current version
> (2011-10-23)

Maybe later.  If it matters to you, please open a new bug.


> and finally, there is some die(0 call missing in the ebuild.
> The current, unpatched ebuild let emerge to finish although "Compilation and
> optimization of Python modules for CPython 3.1 ..." failed with the above
> error. That is I think wrong.

To my understanding in pkg_post{inst,rm} it's too late for catching errors anyway.