Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561414 - net-misc/chrome-remote-desktop needs python_fix_shebang
Summary: net-misc/chrome-remote-desktop needs python_fix_shebang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-24 22:46 UTC by beigetangerine
Modified: 2015-09-30 14:17 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description beigetangerine 2015-09-24 22:46:04 UTC
chrome-remote-desktop crashes at startup when the default Python is Python 3.

Reproducible: Always

Steps to Reproduce:
# emerge chrome-remote-desktop
# /etc/init.d/chrome-remote-desktop start
Actual Results:  
# /etc/init.d/chrome-remote-desktop status
 * status: crashed

The cause of the crash was unclear, so I patched /etc/init.d/chrome-remote-desktop to set log files for stdout and stderr (with -1 and -2), and I started it again. That gave this output:

  File "/opt/google/chrome-remote-desktop/chrome-remote-desktop", line 142
    old_umask = os.umask(0066)
                            ^
SyntaxError: invalid token
  File "/opt/google/chrome-remote-desktop/chrome-remote-desktop", line 142
    old_umask = os.umask(0066)
                            ^
SyntaxError: invalid token

Expected Results:  
It should have run without crashing :)

I presume that the problem is that my default Python is Python 3.3:

$ eselect python list
Available Python interpreters:
  [1]   python2.7
  [2]   python3.2
  [3]   python3.3 *
  [4]   python3.4

Indeed, I can fix it by telling the script to run with Python 2.7:

$ diff -u /usr/portage/net-misc/chrome-remote-desktop/chrome-remote-desktop-45.0.2454.17.ebuild chrome-remote-desktop-45.0.2454.17.ebuild
--- /usr/portage/net-misc/chrome-remote-desktop/chrome-remote-desktop-45.0.2454.17.ebuild 2015-09-06 04:01:02.000000000 -0400
+++ chrome-remote-desktop-45.0.2454.17.ebuild 2015-09-24 18:36:49.076315995 -0400
@@ -14,9 +14,11 @@
 # Use curl to find the answer:
 #  curl -q https://dl.google.com/linux/chrome-remote-desktop/deb/dists/stable/main/binary-i386/Packages | grep ^Filename

-EAPI="4"
+EAPI="5"

-inherit unpacker eutils
+PYTHON_COMPAT=( python2_7 )
+
+inherit unpacker eutils python-single-r1

 DESCRIPTION="access remote computers via Chrome!"
 PLUGIN_URL="https://chrome.google.com/remotedesktop"
@@ -65,6 +67,7 @@

 src_prepare() {
  epatch "${FILESDIR}"/${PN}-44.0.2403.44-always-sudo.patch #541708
+ python_fix_shebang opt/google/chrome-remote-desktop/chrome-remote-desktop
 }

 src_install() {
Comment 1 beigetangerine 2015-09-24 22:48:24 UTC
My apologies: The fix should also include a call to python_setup before the call to python_fix_shebang. I thought I had tested without it, but I guess I got confused.
Comment 2 beigetangerine 2015-09-25 16:04:01 UTC
I thought I had included a link to someone else who had the same problem and solution, but I guess I missed it. Here it is: https://plus.google.com/+NickMossie/posts/TB32wTtMSZS
Comment 3 beigetangerine 2015-09-25 18:24:23 UTC
I've also reported this upstream (though I don't have a shareable link), so if they fix it, it may go away on its own in some future release.
Comment 5 beigetangerine 2015-09-30 14:17:32 UTC
Thanks!

Here's the public upstream bug that may eventually make this unnecessary: https://code.google.com/p/chromium/issues/detail?id=537436