Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 596206 - net-misc/openvswitch-2.6.0 : SyntaxError: invalid syntax
Summary: net-misc/openvswitch-2.6.0 : SyntaxError: invalid syntax
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
: 602936 611834 (view as bug list)
Depends on:
Blocks: CVE-2017-9214
  Show dependency tree
 
Reported: 2016-10-05 08:14 UTC by Toralf Förster
Modified: 2022-07-02 12:35 UTC (History)
10 users (show)

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


Attachments
config.log (config.log,124.42 KB, text/plain)
2016-10-05 08:14 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,200.12 KB, text/plain)
2016-10-05 08:14 UTC, Toralf Förster
Details
environment (environment,195.28 KB, text/plain)
2016-10-05 08:14 UTC, Toralf Förster
Details
net-misc:openvswitch-2.6.0:20161005-012335.log (net-misc:openvswitch-2.6.0:20161005-012335.log,33.00 KB, text/plain)
2016-10-05 08:14 UTC, Toralf Förster
Details
emerge --info '=net-misc/openvswitch-2.6.0::gentoo' (ovs-info,5.28 KB, text/plain)
2016-10-09 12:15 UTC, Andreas G.
Details
environment (ovs-environment,194.76 KB, text/plain)
2016-10-09 12:17 UTC, Andreas G.
Details
emerge-info.txt (emerge-info.txt,5.74 KB, text/plain)
2017-03-05 08:16 UTC, Toralf Förster
Details
config.log.tbz2 (config.log.tbz2,16.51 KB, application/x-bzip)
2017-03-05 08:16 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,209.27 KB, text/plain)
2017-03-05 08:16 UTC, Toralf Förster
Details
environment (environment,196.25 KB, text/plain)
2017-03-05 08:16 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,22.48 KB, application/x-bzip)
2017-03-05 08:16 UTC, Toralf Förster
Details
net-misc:openvswitch-2.7.0:20170305-081224.log (net-misc:openvswitch-2.7.0:20170305-081224.log,34.21 KB, text/plain)
2017-03-05 08:16 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,48.27 KB, application/x-bzip)
2017-03-05 08:17 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2016-10-05 08:14:47 UTC
    #include "uuid.h"''' % {'prefix': prefix.upper()}
                       ^
SyntaxError: invalid syntax
make: *** [Makefile:6005: lib/vswitch-idl.ovsidl] Error 1
 * ERROR: net-misc/openvswitch-2.6.0::gentoo failed (compile phase):
 *   emake failed


$ cat emerge-info.txt
  -----------------------------------------------------------------

  This is an unstable amd64 chroot image (named amd64-plasma-unstable_20161001-222637) at a hardened host acting as a tinderbox.

  -----------------------------------------------------------------
  USE flags ...

  ... in make.conf:
USE="  pax_kernel xtpax -cdinstall -oci8 -bindist ssp -apache2 bzip2 -cdb custom-optimization dec_av2 dot ext4 fluidsynth gcj glamor gles ibus -inifile jadetex kvm libinput llvm mdnsresponder-compat mikmod minimal mpeg2 mpi mta multimedia mysqli ncurses nscd nss objc ois opencv openexr opengl osc plasma png printsupport pyqt4 qemu qt4 rdoc -smpeg snmp sslv3 svg system-ffmpeg system-libs tcpd theora tk tracepath uxa vorbis webstart -x264 x265 -xkb xmlreader xmp xz zlib"

  ... in /etc/portage/package.use/*:
  mail-mta/ssmtp      ssl mta
  net-misc/wget       ssl
  app-crypt/pinentry  -qt4
  app-editors/emacs   -dbus -svg -ssl -gtk -gtk3
  app-text/xmlto      -latex
  dev-libs/boehm-gc   threads
  dev-libs/libpcre    pcre16
  dev-lang/python     threads
  dev-qt/qtgui        egl eglfs
  net-nds/openldap    -sasl
  dev-util/cmake      -qt4 -qt5
  dev-vcs/git         -perl
  media-libs/mesa     -vaapi
  sys-apps/kmod       tools
  net-misc/iputils -caps -filecaps
  >=x11-libs/libxcb-1.12-r2 xkb

  entries in /etc/portage/package.unmask/*:
  ~dev-libs/boost-1.62.0
  ~dev-util/boost-build-1.62.0
  ~sys-apps/sandbox-2.11
  sys-devel/gcc:6.2.0
  -----------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-4.9.3
 [2] x86_64-pc-linux-gnu-6.2.0 *
llvm-config --version:
3.8.1

Available Python interpreters, in order of preference:
  [1]   python3.4
  [2]   python2.7 (fallback)
  [3]   pypy3 (fallback)
  [4]   pypy (fallback)

  -----------------------------------------------------------------

Portage 2.3.1 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-6.2.0, glibc-2.23-r2, 4.7.6-hardened x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.7.6-hardened-x86_64-Intel-R-_Core-TM-_i7-3930K_CPU_@_3.20GHz-with-gentoo-2.3
KiB Mem:    65285480 total,   2098344 free
KiB Swap:   67108860 total,  67104016 free
Timestamp of repository gentoo: Wed, 05 Oct 2016 00:30:23 +0000
sh bash 4.4
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.4::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.6.2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.1::gentoo
sys-apps/sandbox:         2.11-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.26.1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 6.2.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: 1

local
    location: /usr/local/portage
    masters: gentoo
    priority: 2

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/omega.conf /usr/share/config"
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"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--verbose --verbose-conflicts --color=n --nospinner --tree --quiet-build"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox parallel-fetch preserve-libs protect-owned sandbox sfperms strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo rsync://mirror.netcologne.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gor.bytemark.co.uk/gentoo/ rsync://ftp.snt.utwente.nl/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
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 alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups custom-optimization cxx dbus dec_av2 declarative dot dri dts dvd dvdr emboss encode exif ext4 fam firefox flac fluidsynth fortran gcj gdbm gif glamor gles gpm gtk ibus iconv ipv6 jadetex jpeg kde kipi kvm lcms ldap libinput libnotify llvm mad mdnsresponder-compat mikmod minimal mmx mmxext mng modules mp3 mp4 mpeg mpeg2 mpi mta multilib multimedia mysqli ncurses nls nptl nscd nss objc ogg ois opencv openexr opengl openmp osc pam pango pax_kernel pcre pdf phonon plasma png policykit ppds printsupport pyqt4 qemu qml qt3support qt4 qt5 rdoc readline sdl seccomp semantic-desktop session snmp spell sse sse2 ssl sslv3 ssp startup-notification svg system-ffmpeg system-libs tcpd theora tiff tk tracepath truetype udev udisks unicode upower usb uxa vorbis webstart widgets wxwidgets x265 xattr xcb xcomposite xinerama xml xmlreader xmp xscreensaver xtpax xv xvid xz zlib" ABI_X86="64" 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" L10N="en-ZA ka si wa" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Toralf Förster gentoo-dev 2016-10-05 08:14:50 UTC
Created attachment 449194 [details]
config.log
Comment 2 Toralf Förster gentoo-dev 2016-10-05 08:14:53 UTC
Created attachment 449196 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2016-10-05 08:14:56 UTC
Created attachment 449198 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2016-10-05 08:14:58 UTC
Created attachment 449200 [details]
net-misc:openvswitch-2.6.0:20161005-012335.log
Comment 5 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-10-05 13:23:46 UTC
gcc 6.2?
Comment 6 Andreas G. 2016-10-09 12:15:50 UTC
Created attachment 449658 [details]
emerge --info '=net-misc/openvswitch-2.6.0::gentoo'

Hitting the same issue with GCC 5.2. The line producing the error (?) says something about python. Could this be related to #596172?
Comment 7 Andreas G. 2016-10-09 12:17:36 UTC
Created attachment 449660 [details]
environment
Comment 8 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-10-09 16:25:42 UTC
Ya, given some of the updates that went into this I'd ask that you give me the md5sum of the ebuild so I know it's the newer (fixed) one.  Broken builds get fixed in place.
Comment 9 Andreas G. 2016-10-10 18:26:08 UTC
Ebuild that failed, synced portage some minutes ago:
276f5489d7bb33f2a1fe67f9876bbf1e  /usr/portage/net-misc/openvswitch/openvswitch-2.6.0.ebuild
Comment 10 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-10-10 21:48:26 UTC
gcc 5.4.0 (the version you last tested with) is marked unstable for at least amd64.  Can you test with the stable version (4.9.3)?

I don't think the issue is with the python updates.  Did previous versions build with newer GCC versions?
Comment 11 Andreas G. 2016-10-10 22:35:54 UTC
After emerging and selecting gcc-4.9.3, openvswitch now fails with:
 configure: error: C compiler cannot create executables

So I guess I will have to do more than that, but I am afraid this would screw my system... I can setup a test box with stable gcc but I can not manage to do this today.
Comment 12 Andreas G. 2016-10-10 22:55:36 UTC
Oh, and yes, openvswitch-2.5.0 built fine with gcc-5.4.
Comment 13 Toralf Förster gentoo-dev 2016-10-11 09:05:33 UTC
net-misc/openvswitch-2.6.0 built fine here at 2 older tinderbox images (around 1st of October) with gcc-6.2.0 :


amd64-13.0-no-multilib-unstable_20160928-214001/var/log/emerge.log
Sat Oct  1 09:33:40 2016 >>> net-misc/openvswitch-2.6.0
openvswitch: Sat Oct  1 09


amd64-13.0-systemd-unstable_20160928-214401/var/log/emerge.log
Sat Oct  1 10:05:15 2016 >>> net-misc/openvswitch-2.6.0
openvswitch: Sat Oct  1 09:59:31 2016: 5 minutes, 44 seconds
openvswitch: 1 times
Comment 14 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-10-11 16:09:36 UTC
Ya, I'm not sure what I can do with this, I'm thinking there's an unstable lib in use or something.
Comment 15 BRULE Herman 2016-10-27 21:35:24 UTC
Here the version 2.6.0 fail with gcc version 4.9.3.
Internet say it due to python due, confirmed by where it bug
Comment 16 BRULE Herman 2016-10-27 21:43:44 UTC
Why after all python flag disable it continue to call?:
PYTHONPATH=./python":"$PYTHONPATH PYTHONDONTWRITEBYTECODE=yes /bin/sh /var/tmp/portage/net-misc/openvswitch-2.6.0/work/openvswitch-2.6.0/build-aux/missing python ./ovsdb/ovsdb-idlc.in annotate ./vtep/vtep.ovsschema ./vtep/vtep-idl.ann > vtep/vtep-idl.ovsidl.tmp && \
mv vtep/vtep-idl.ovsidl.tmp vtep/vtep-idl.ovsidl
Comment 17 Alexander Samarin 2016-11-09 09:39:02 UTC
Well, there is a lot of bugs here.

First error 'SyntaxError: invalid syntax' raised from that the configure
script is unable to find python2.x. And that is because of line

    use monitor || export ovs_cv_python="no"

in the src_configure() function of the ebuild.

So, when we do not enable 'monitor' use flag, we tell the configure
script that python is 'not found' (see config.log):

> configure:14044: checking for Python 2.x for x >= 7
> configure:14077: result: no
> configure:14097: checking for Python 3.x for x >= 4
> configure:14130: result: /usr/bin/python3

Again, this is a fragment of mine build.log:
> checking for Python 2.x for x >= 7... (cached) no
> checking for Python 3.x for x >= 4... /usr/bin/python3

It could be easily reproduced by out-of-portage build:

    tar xf openvswitch-2.6.0.tar.gz
    cd openvswitch-2.6.0
    env ovs_cv_python="no" ./configure
    make

But the build system still tries to run some code-generating scripts
using default python (python3), which are not adapted for 3.x version.
I tried to fix them locally by running:

    2to3 -w build-aux/extract-ofp-actions
    2to3 -w build-aux/extract-ofp-errors
    2to3 -w build-aux/extract-ofp-msgs
    2to3 -w build-aux/xml2nroff
    2to3 -w ovsdb/ovsdb-doc
    2to3 -w ovsdb/ovsdb-idlc.in

... and the 'SyntaxError: ...' gone.

Unfortunally, this is NOT a solution now because 'disabled' python2
leads to disabling the build of several scripts under utilities/
directory. See Makefile.in:

    @HAVE_PYTHON_TRUE@am__append_30 = \
    @HAVE_PYTHON_TRUE@	utilities/ovs-dpctl-top \
    @HAVE_PYTHON_TRUE@	utilities/ovs-l3ping \
    @HAVE_PYTHON_TRUE@	utilities/ovs-parse-backtrace \
    @HAVE_PYTHON_TRUE@	utilities/ovs-pcap \
    @HAVE_PYTHON_TRUE@	utilities/ovs-tcpdump \
    @HAVE_PYTHON_TRUE@	utilities/ovs-tcpundump \
    @HAVE_PYTHON_TRUE@	utilities/ovs-test \
    @HAVE_PYTHON_TRUE@	utilities/ovs-vlan-test

And emerge fails at the install phase because it can't find these files.


So the only solution I can see is to remove the line

    use monitor || export ovs_cv_python="no"

from the ebuild. Without it openvswitch-2.6.0 builds successfully, but
fails to install with the following error:

 * The file has incompatible shebang:
 *   file: /usr/lib/python-exec/python3.4/ovs-pcap
 *   current shebang: #! /usr/bin/env /usr/bin/python2.7
 *   requested impl: python3.4
 * ERROR: net-misc/openvswitch-2.6.0-r1::x-portage failed (install phase):
 *   python_fix_shebang: conversion of incompatible shebang requested
 * 

Here I give up because my knowledge of portage/python ecosystem
is very small.
Comment 18 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-11-09 22:18:58 UTC
Ya, as a workaround we can statically enable monitor, I'll leave this bug open for now to track it.  Will be worked around in r1
Comment 19 Yaroslav Isakov 2016-12-31 03:59:59 UTC
*** Bug 602936 has been marked as a duplicate of this bug. ***
Comment 20 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2017-03-05 04:44:38 UTC
could this be retested with 2.7.0?
Comment 21 Toralf Förster gentoo-dev 2017-03-05 08:16:32 UTC
same issue at an unstable amd64 chroot image (named plasma-abi32+64_20170228-094845)
Comment 22 Toralf Förster gentoo-dev 2017-03-05 08:16:38 UTC
Created attachment 466036 [details]
emerge-info.txt
Comment 23 Toralf Förster gentoo-dev 2017-03-05 08:16:42 UTC
Created attachment 466038 [details]
config.log.tbz2
Comment 24 Toralf Förster gentoo-dev 2017-03-05 08:16:45 UTC
Created attachment 466040 [details]
emerge-history.txt
Comment 25 Toralf Förster gentoo-dev 2017-03-05 08:16:49 UTC
Created attachment 466042 [details]
environment
Comment 26 Toralf Förster gentoo-dev 2017-03-05 08:16:53 UTC
Created attachment 466044 [details]
etc.portage.tbz2
Comment 27 Toralf Förster gentoo-dev 2017-03-05 08:16:57 UTC
Created attachment 466046 [details]
net-misc:openvswitch-2.7.0:20170305-081224.log
Comment 28 Toralf Förster gentoo-dev 2017-03-05 08:17:00 UTC
Created attachment 466048 [details]
temp.tbz2
Comment 29 Agostino Sarubbo gentoo-dev 2017-06-10 13:19:29 UTC
*** Bug 611834 has been marked as a duplicate of this bug. ***
Comment 30 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2018-03-16 15:32:53 UTC
I imagine it's still the same in 2.8.1?
Comment 31 Larry the Git Cow gentoo-dev 2022-07-02 12:35:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9810e0f55cb9c8da7bdcf6bdcae630e61fcf3594

commit 9810e0f55cb9c8da7bdcf6bdcae630e61fcf3594
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-07-02 12:31:46 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-07-02 12:35:08 +0000

    net-misc/openvswitch: add 2.17.2
    
    Bug: https://bugs.gentoo.org/766135
    Closes: https://bugs.gentoo.org/596206
    Closes: https://bugs.gentoo.org/633516
    Closes: https://bugs.gentoo.org/671776
    Closes: https://bugs.gentoo.org/672870
    Closes: https://bugs.gentoo.org/794535
    Closes: https://bugs.gentoo.org/854663
    Signed-off-by: Sam James <sam@gentoo.org>

 net-misc/openvswitch/Manifest                  |   1 +
 net-misc/openvswitch/openvswitch-2.17.2.ebuild | 152 +++++++++++++++++++++++++
 2 files changed, 153 insertions(+)