Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 903867 - media-gfx/inkscape-1.2.2: error: statement-expressions are not allowed outside functions nor in template-argument lists
Summary: media-gfx/inkscape-1.2.2: error: statement-expressions are not allowed outsid...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Andreas K. Hüttel
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-04-05 13:54 UTC by Dominique Michel
Modified: 2023-05-01 07:32 UTC (History)
1 user (show)

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


Attachments
output of # emerge --info '=media-gfx/inkscape-1.2.2::gentoo' (emerge-info,18.55 KB, text/plain)
2023-04-05 13:55 UTC, Dominique Michel
Details
complete build log part 1 (build.log,870.15 KB, text/plain)
2023-04-05 14:05 UTC, Dominique Michel
Details
complete build log #2 (build.log,858.63 KB, text/plain)
2023-04-05 14:10 UTC, Dominique Michel
Details
complete build log #3 (build.log,913.79 KB, text/x-log)
2023-04-05 14:13 UTC, Dominique Michel
Details
complete build log #4 on 4 (build.log,258.05 KB, text/plain)
2023-04-05 14:15 UTC, Dominique Michel
Details
environment file (environment,135.22 KB, text/plain)
2023-04-05 14:16 UTC, Dominique Michel
Details
patch that solves that issue (781e29cd3538.patch,8.32 KB, patch)
2023-04-05 18:18 UTC, Dominique Michel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique Michel 2023-04-05 13:54:01 UTC
during a world update, I get the following build error:

FAILED: src/CMakeFiles/inkscape_base.dir/ui/widget/selected-style.cpp.o 
...
/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/ui/widget/selected-style.cpp:111:6: error: statement-expressions are not allowed outside functions nor in template-argument lists
  111 |     {g_strdup("application/x-oswb-color"), 0, APP_OSWB_COLOR}

It look to be the same issue than on that forum thread: https://forums.gentoo.org/viewtopic-t-1162685-highlight-inkscape.html

Reproducible: Always

Actual Results:  
FAILED: src/CMakeFiles/inkscape_base.dir/ui/widget/selected-style.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DHAVE_CONFIG_H -DHAVE_X11 -Dinkscape_base_EXPORTS -I/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2_build/src -I/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src -I/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2 -I/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2_build/include -I/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/3rdparty/adaptagrams -I/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/3rdparty/2geom/include -I/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/3rdparty/2geom/include/2geom -isystem /usr/include/harfbuzz -isystem /usr/include/freetype2 -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /usr/include/pango-1.0 -isystem /usr/lib64/libffi/include -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/fribidi -isystem /usr/include/cairo -isystem /usr/include/libpng16 -isystem /usr/include/pixman-1 -isystem /usr/include/libsoup-2.4 -isystem /usr/include/libxml2 -isystem /usr/include/poppler -isystem /usr/include/libcdr-0.1 -isystem /usr/include/librevenge-0.0 -isystem /usr/include/gtkmm-3.0 -isystem /usr/lib64/gtkmm-3.0/include -isystem /usr/include/giomm-2.4 -isystem /usr/lib64/giomm-2.4/include -isystem /usr/include/glibmm-2.4 -isystem /usr/lib64/glibmm-2.4/include -isystem /usr/include/sigc++-2.0 -isystem /usr/lib64/sigc++-2.0/include -isystem /usr/include/gtk-3.0 -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/gio-unix-2.0 -isystem /usr/include/atk-1.0 -isystem /usr/include/at-spi2-atk/2.0 -isystem /usr/include/at-spi-2.0 -isystem /usr/include/dbus-1.0 -isystem /usr/lib64/dbus-1.0/include -isystem /usr/include/cairomm-1.0 -isystem /usr/lib64/cairomm-1.0/include -isystem /usr/include/pangomm-1.4 -isystem /usr/lib64/pangomm-1.4/include -isystem /usr/include/atkmm-1.6 -isystem /usr/lib64/atkmm-1.6/include -isystem /usr/include/gtk-3.0/unix-print -isystem /usr/include/gdkmm-3.0 -isystem /usr/lib64/gdkmm-3.0/include -isystem /usr/include/gspell-1 -isystem /usr/include/enchant-2  -march=native -O2 -pipe -frecord-gcc-switches -fno-strict-aliasing -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DGLIBMM_DISABLE_DEPRECATED -DGTKMM_DISABLE_DEPRECATED -DGDKMM_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -fstack-protector-strong -Werror=format -Werror=format-security -Werror=ignored-qualifiers -Werror=return-type -Wno-switch -Wstrict-null-sentinel -pthread -fopenmp -fPIC   -pthread -UWITH_MESH -UWITH_CSSBLEND -UWITH_SVG2 -fPIC -fdiagnostics-color -std=gnu++17 -MD -MT src/CMakeFiles/inkscape_base.dir/ui/widget/selected-style.cpp.o -MF src/CMakeFiles/inkscape_base.dir/ui/widget/selected-style.cpp.o.d -o src/CMakeFiles/inkscape_base.dir/ui/widget/selected-style.cpp.o -c /var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/ui/widget/selected-style.cpp
In file included from /var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/object/sp-namedview.h:22,
                 from /var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/ui/widget/selected-style.cpp:31:
/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/util/units.h:29:42: warning: ‘template<class _Arg, class _Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
   29 | struct hash<Glib::ustring> : public std::unary_function<Glib::ustring, std::size_t> {
      |                                          ^~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/string:48,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/locale_classes.h:40,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/ios_base.h:41,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/streambuf:41,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/streambuf_iterator.h:35,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/iterator:66,
                 from /usr/include/glibmm-2.4/glibmm/ustring.h:25,
                 from /usr/include/gtkmm-3.0/gtkmm/box.h:6,
                 from /var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/ui/widget/selected-style.h:15,
                 from /var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/ui/widget/selected-style.cpp:13:
/usr/lib/gcc/x86_64-pc-linux-gnu/12/include/g++-v12/bits/stl_function.h:117:12: note: declared here
  117 |     struct unary_function
      |            ^~~~~~~~~~~~~~
In file included from /usr/lib64/glib-2.0/include/glibconfig.h:9,
                 from /usr/include/glib-2.0/glib/gtypes.h:34,
                 from /usr/include/glib-2.0/glib/galloca.h:34,
                 from /usr/include/glib-2.0/glib.h:32,
                 from /usr/include/glibmm-2.4/glibmm/unicode.h:23,
                 from /usr/include/glibmm-2.4/glibmm/ustring.h:21:
/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/ui/widget/selected-style.cpp:111:6: error: statement-expressions are not allowed outside functions nor in template-argument lists
  111 |     {g_strdup("application/x-oswb-color"), 0, APP_OSWB_COLOR}
      |      ^~~~~~~~
In file included from /usr/include/glib-2.0/glib/gstring.h:37,
                 from /usr/include/glib-2.0/glib/giochannel.h:36,
                 from /usr/include/glib-2.0/glib.h:56:
/var/tmp/portage/media-gfx/inkscape-1.2.2/work/inkscape-1.2.2/src/ui/widget/selected-style.cpp:111:6: error: statement-expressions are not allowed outside functions nor in template-argument lists
  111 |     {g_strdup("application/x-oswb-color"), 0, APP_OSWB_COLOR}
      |      ^~~~~~~~
Comment 1 Dominique Michel 2023-04-05 13:55:35 UTC
Created attachment 859538 [details]
output of # emerge --info '=media-gfx/inkscape-1.2.2::gentoo'
Comment 2 Dominique Michel 2023-04-05 13:56:33 UTC
 # emerge -pqv '=media-gfx/inkscape-1.2.2::gentoo'
[ebuild     U ] media-gfx/inkscape-1.2.2 [1.2.1-r2] USE="X cdr exif jpeg openmp readline spell -dia -graphicsmagick -imagemagick -inkjar (-jemalloc) -postscript -svg2 -test -visio -wpg" PYTHON_SINGLE_TARGET="python3_10 -python3_9 -python3_11% (-python3_8%)"
Comment 3 Dominique Michel 2023-04-05 14:05:38 UTC
Created attachment 859539 [details]
complete build log part 1
Comment 4 Dominique Michel 2023-04-05 14:10:26 UTC
Created attachment 859540 [details]
complete build log #2
Comment 5 Dominique Michel 2023-04-05 14:13:28 UTC
Created attachment 859541 [details]
complete build log #3
Comment 6 Dominique Michel 2023-04-05 14:15:04 UTC
Created attachment 859542 [details]
complete build log #4 on 4
Comment 7 Dominique Michel 2023-04-05 14:16:22 UTC
Created attachment 859543 [details]
environment file
Comment 8 Dominique Michel 2023-04-05 18:18:40 UTC
Created attachment 859574 [details, diff]
patch that solves that issue

Same than http://mirrors.infowest.com/freebsd-ftp/ports/distfiles/781e29cd3538.patch but with modified offset as explained here: https://forums.gentoo.org/viewtopic-t-1162685-highlight-inkscape.html

That patch solve that issue for me.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-19 05:09:44 UTC
I still don't get why only certain people can hit this.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-01 06:04:10 UTC
(In reply to Dominique Michel from comment #8)
> Created attachment 859574 [details, diff] [details, diff]
> patch that solves that issue
> 
> Same than
> http://mirrors.infowest.com/freebsd-ftp/ports/distfiles/781e29cd3538.patch
> but with modified offset as explained here:
> https://forums.gentoo.org/viewtopic-t-1162685-highlight-inkscape.html
> 
> That patch solve that issue for me.

I'd really prefer not to apply this until it's backported upstream given how large it is until we understand what's going on here, fwiw.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-01 06:34:51 UTC
Okay, I think I partly get it now. I suspect it's not really just gcc 13 and some change got backported to newer GCCs.

Fedora are using https://src.fedoraproject.org/rpms/inkscape/blob/rawhide/f/0001-Fix-build-with-GCC13.patch for now (https://gitlab.com/inkscape/inkscape/-/merge_requests/5108) which is less invasive than the patch here (https://gitlab.com/inkscape/inkscape/-/merge_requests/5111).

Let's add that in.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-01 06:39:05 UTC
(In reply to Sam James from comment #11)
> Okay, I think I partly get it now. I suspect it's not really just gcc 13 and
> some change got backported to newer GCCs.
> 

I still think it's possible this is a glib/glibmm thing but it's harmless enough, so.
Comment 13 Larry the Git Cow gentoo-dev 2023-05-01 07:32:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4edc51728fdea1246c4dbe0abf6dd310e7362dbc

commit 4edc51728fdea1246c4dbe0abf6dd310e7362dbc
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-05-01 07:31:33 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-01 07:32:11 +0000

    media-gfx/inkscape: fix compile issue
    
    Unclear when this happens but I can see how it might, so..
    
    Closes: https://bugs.gentoo.org/903867
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/inkscape-1.2.2-fix-compile.patch         |  46 +++++
 media-gfx/inkscape/inkscape-1.2.2-r1.ebuild        | 197 +++++++++++++++++++++
 2 files changed, 243 insertions(+)