Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 765484 - media-video/syncplay-1.6.7: launch scripts in /usr/bin have wrong python interpreter
Summary: media-video/syncplay-1.6.7: launch scripts in /usr/bin have wrong python inte...
Status: RESOLVED FIXED
Alias: None
Product: GURU
Classification: Unclassified
Component: Package issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: GURU project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-14 23:48 UTC by Marco Rebhan
Modified: 2021-01-15 08:25 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 Marco Rebhan 2021-01-14 23:48:05 UTC
The interpreter for /usr/bin/syncplay and /usr/bin/syncplay-server is set to "#!/usr/bin/env python3". This will fail with the following error when trying to start it (and a similar one for the server) and the default python interpreter not being the one selected with PYTHON_TARGETS (in my case PYTHON_TARGETS="python3_8" and python3 is set to run python 3.9.

ModuleNotFoundError: No module named 'twisted'

This can easily be worked around by changing the interpreter line to the wanted python version, in my case "#!/usr/bin/env/python3.8".


Reproducible: Always

Steps to Reproduce:
1. Emerge syncplay (or rather dev-python/twisted) with a PYTHON_TARGETS set to something not including the python version set by eselect python
2. Run /usr/bin/syncplay
Actual Results:  
The program crashes with the error mentioned above, since the dev-python/twisted package is not compiled for the python version syncplay is trying to run as.

Expected Results:  
The program should have started normally and shown the GUI window.

Portage 3.0.13 (python 3.8.7-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-10.2.0, glibc-2.32-r7, 5.10.5-gentoo x86_64)
=================================================================
System uname: Linux-5.10.5-gentoo-x86_64-Intel-R-_Core-TM-_i5-6600_CPU_@_3.30GHz-with-glibc2.2.5
KiB Mem:    24480568 total,   2915032 free
KiB Swap:    4194300 total,   3695356 free
Timestamp of repository gentoo: Thu, 14 Jan 2021 11:30:01 +0000
Head commit of repository gentoo: 169c02849e8bd630f18b48834df15623b7220eb3
Head commit of repository 2xsaiko: ace23b6115084c0857417b0ae82bb598081cebc9

Timestamp of repository brother-overlay: Tue, 05 Jan 2021 23:59:15 +0000
Head commit of repository brother-overlay: 0e4a8e2e71074904bea62290bb49299472256c94

Timestamp of repository dotnet: Tue, 12 Jan 2021 10:37:33 +0000
Head commit of repository dotnet: 9def1db4c60751284f818739cad05fcdc64942e6

Timestamp of repository guru: Thu, 14 Jan 2021 14:06:46 +0000
Head commit of repository guru: 42da0d3f7d2729b8b80b08e652af1a6538995680

Timestamp of repository maggu2810-overlay: Tue, 12 Jan 2021 18:35:14 +0000
Head commit of repository maggu2810-overlay: b18a1f8e0d408363a87d1ce0baf3da8774a454b0

Timestamp of repository steam-overlay: Tue, 12 Jan 2021 10:37:54 +0000
Head commit of repository steam-overlay: bd1215e0cf901abeb8494cba77cf12a098ae58bc

sh bash 5.1_p4
ld GNU ld (Gentoo 2.35.1 p2) 2.35.1
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          5.1_p4::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.32.0-r1::gentoo
dev-lang/python:          2.7.18-r5::gentoo, 3.8.7::gentoo, 3.9.1::gentoo
dev-util/cmake:           3.19.3::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            10.2.0-r5::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

2xsaiko
    location: /var/db/repos/2xsaiko
    sync-type: git
    sync-uri: https://git.sr.ht/~dblsaiko/ebuilds
    masters: gentoo

brother-overlay
    location: /var/db/repos/brother-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/brother-overlay.git
    masters: gentoo

dotnet
    location: /var/db/repos/dotnet
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/dotnet.git
    masters: gentoo

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

maggu2810-overlay
    location: /var/db/repos/maggu2810-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/maggu2810-overlay.git
    masters: gentoo

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo

local
    location: /var/db/repos/local
    masters: gentoo
    priority: 9999

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS=" -ggdb -march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS=" -ggdb -march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS=" -ggdb -march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles installsources ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=" -ggdb -march=native -O2 -pipe"
GENTOO_MIRRORS="        https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/      https://mirror.netcologne.de/gentoo/    https://ftp.fau.de/gentoo      https://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi activities alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr elogind emboss encode exif flac fortran gdbm gif gpm gtk gui ibus iconv icu ipv6 jpeg kde kipi kwallet lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg mtp multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt5 readline sdl seccomp semantic-desktop spell split-usr ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vaapi vorbis vulkan wayland widgets wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python2_7 python3_8" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 wolfgang 2021-01-15 00:21:48 UTC
Hm, according to [this SO answer][1], we should probably use `#!/usr/bin/env python3`, however according to [this gentoo manual][2], `python-exec` should (probably?) be used, in which case the script would have to be adjusted to choose a specific python interpreter as you've outlined.

It's unclear to me what the best course of action is.

[1]: https://stackoverflow.com/a/19305076
[2]: https://dev.gentoo.org/~mgorny/python-guide/interpreter.html#support-for-multiple-implementations
Comment 2 wolfgang 2021-01-15 03:52:29 UTC
After some conversations in IRC, it looks like perhaps `python_doscript`[1] is needed, which should update the shebang appropriately.

[1]: https://dev.gentoo.org/~mgorny/python-guide/helper.html#install-helpers
Comment 3 Larry the Git Cow gentoo-dev 2021-01-15 08:25:14 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7c42b3e976a4afaf0f711abbeb76de550737e15f

commit 7c42b3e976a4afaf0f711abbeb76de550737e15f
Author:     Andrew Ammerlaan <andrewammerlaan@riseup.net>
AuthorDate: 2021-01-15 08:24:46 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@riseup.net>
CommitDate: 2021-01-15 08:24:46 +0000

    media-video/syncplay: properly install python modules and scripts
    
    now we use the dedicated python_do* functions instead of
    the shipped make install, this ensures that syncplay
    is run with the version of python that is enabled with
    PYTHON_TARGETS
    
    also set DISTUTILS_SINGLE_IMPL because there is no
    need to install this for more than one python version
    
    Closes: https://bugs.gentoo.org/765484
    Package-Manager: Portage-3.0.13, Repoman-3.0.2
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>

 ...cplay-1.6.7.ebuild => syncplay-1.6.7-r1.ebuild} | 27 +++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)