Bug 273681 - graphics/darktable: Fails to build with GCC 13: error: expected identifier before '__is_convertible'
Summary: graphics/darktable: Fails to build with GCC 13: error: expected identifier be...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jean-Sébastien Pédron
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-10 07:40 UTC by Lorenzo Salvadore
Modified: 2024-11-25 23:42 UTC (History)
1 user (show)

See Also:
dumbbell: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Salvadore freebsd_committer freebsd_triage 2023-09-10 07:40:37 UTC
This bug report blocks the update of GCC_DEFAULT to 13. This webpage can help finding a fix: https://gcc.gnu.org/gcc-13/porting_to.html

FAILED: lib/darktable/rawspeed/CMakeFiles/rawspeed.dir/src/librawspeed/common/ChecksumFile.cpp.o 
/usr/local/bin/g++13 -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES -DNDEBUG -D_RELEASE -I/wrkdirs/usr/ports/graphics/darktable/work/.build/lib/darktable/rawspeed -I/wrkdirs/usr/ports/graphics/darktable/work/darktable-4.4.2/src/external/rawspeed -I/wrkdirs/usr/ports/graphics/darktable/work/.build/lib/darktable/rawspeed/src -I/wrkdirs/usr/ports/graphics/darktable/work/darktable-4.4.2/src/external/rawspeed/src/librawspeed -isystem /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.4.2/src/external/rawspeed/src/external -O2 -pipe  -fopenmp -I/usr/local/include/Imath -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc13 -Wall -Wformat -Wformat-security -Wshadow -Wtype-limits -Wvla -Wmaybe-uninitialized -Wno-unknown-pragmas -Wno-error=varargs -Wno-format-truncation -Wno-error=address-of-packed-member -w -Wall -Wextra -Wcast-qual -Wextra -Wextra-semi -Wformat=2 -Wpointer-arith -Wvla -Wmissing-format-attribute -Wsuggest-attribute=format -Wno-unused-parameter -Wstack-usage=4096 -Wframe-larger-than=4096 -Wlarger-than=32768 -Werror -O2 -pipe  -fopenmp -I/usr/local/include/Imath -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc13  -stdlib=libc++ -Wl,-rpath=/usr/local/lib/gcc13  -DNDEBUG -O3 -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden   -mtune=generic -g3 -ggdb3 -fopenmp -MD -MT lib/darktable/rawspeed/CMakeFiles/rawspeed.dir/src/librawspeed/common/ChecksumFile.cpp.o -MF lib/darktable/rawspeed/CMakeFiles/rawspeed.dir/src/librawspeed/common/ChecksumFile.cpp.o.d -o lib/darktable/rawspeed/CMakeFiles/rawspeed.dir/src/librawspeed/common/ChecksumFile.cpp.o -c /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.4.2/src/external/rawspeed/src/librawspeed/common/ChecksumFile.cpp
In file included from /usr/include/c++/v1/__functional/weak_result_type.h:16,
                 from /usr/include/c++/v1/__functional/invoke.h:14,
                 from /usr/include/c++/v1/__functional_base:15,
                 from /usr/include/c++/v1/string:520,
                 from /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.4.2/src/external/rawspeed/src/librawspeed/common/ChecksumFile.h:23,
                 from /wrkdirs/usr/ports/graphics/darktable/work/darktable-4.4.2/src/external/rawspeed/src/librawspeed/common/ChecksumFile.cpp:21:
/usr/include/c++/v1/type_traits:1770:8: error: expected identifier before '__is_convertible'
 1770 | struct __is_convertible
      |        ^~~~~~~~~~~~~~~~

Full log: https://pkg-status.freebsd.org/package18/data/124amd64-default-foo/2023-09-06_17h55m19s/logs/errors/darktable-4.4.2_2.log

There are other bugs similar to this one, such as bug #273671 or bug #273674.
Comment 1 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2023-09-21 11:00:35 UTC
For the record, I'm discussing the possible solutions to this problem in the parent bug 273397, in case it can help other people working on similarily affected ports.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-10-01 20:40:45 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=01cc6a27117a38079dd3b57e69455d7a191ca54a

commit 01cc6a27117a38079dd3b57e69455d7a191ca54a
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2023-10-01 20:30:13 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
CommitDate: 2023-10-01 20:37:57 +0000

    graphics/darktable: Build explicitly with GCC 12.x on FreeBSD 12.x

    On FreeBSD 12.x, it looks like GCC 13+ is incompatible with the version
    of libcxx. In the case of darktable, this leads to the following compile
    time error:

        In file included from /usr/include/c++/v1/__functional/weak_result_type.h:16,
                         from /usr/include/c++/v1/__functional/invoke.h:14,
                         from /usr/include/c++/v1/__functional_base:15,
                         from /usr/include/c++/v1/string:520,
                         from .../work/darktable-4.4.2/src/external/rawspeed/src/librawspeed/common/ChecksumFile.h:23,
                         from .../work/darktable-4.4.2/src/external/rawspeed/src/librawspeed/common/ChecksumFile.cpp:21:
        /usr/include/c++/v1/type_traits:1770:8: error: expected identifier before '__is_convertible'
         1770 | struct __is_convertible
              |        ^~~~~~~~~~~~~~~~

    I have no idea if it is possible to fix or work around this problem in
    darktable itself. Thus, on FreeBSD 12.x, we pin the version of GCC to
    12. This way, once GCC 13+ bescomes the default version, darktable can
    still be built on FreeBSD 12.x, even though the user may have to install
    two versions of GCC.

    For FreeBSD 13.x and onward, the version of GCC remains unpinned in the
    port and the default one will be used.

    This solution was discussed with salvadore@ in the following exp-run
    request:
    https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273397

    PR:             273681

 graphics/darktable/Makefile | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)
Comment 3 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2023-10-20 09:14:25 UTC
Closing this bug because a fix has been committed and the switch to make GCC 13 the default will go in after FreeBSD 12.x reaches EOL.
Comment 4 Lorenzo Salvadore freebsd_committer freebsd_triage 2023-11-18 10:01:08 UTC
Sorry, but I need to re-open this bug report.
Apparently, the issue is still there:

https://pkg-status.freebsd.org/package22/data/132amd64-default-foo/2023-11-10_07h48m13s/logs/errors/darktable-4.4.2_4.log

Please note that this test has been run on FreeBSD 13.2.
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-01-23 10:31:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c97005f74a5b93654b81c249c7ef6e06ca1a1cf4

commit c97005f74a5b93654b81c249c7ef6e06ca1a1cf4
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2024-01-23 10:25:50 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-01-23 10:30:25 +0000

    graphics/darktable: Set USE_GCC=12

    This is to allow the update of GCC_DEFAULT to version 13 until a better
    solution is found.

    PR:             273681
    Approved by:    portmgr (blanket)

 graphics/darktable/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-01-23 10:38:08 UTC
Sorry, this should not have been closed since the bug is still there. Only the block for the GCC 13 as default version should have been removed.
Comment 7 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-01-23 10:38:57 UTC
Opening again.
Comment 8 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-02-03 11:28:16 UTC
Re-adding the block for GCC default version update: the commit in comment #5 did not work, GCC 13 is still being used.

https://pkg-status.freebsd.org/package18/data/140amd64-default-foo/2024-01-29_17h34m15s/logs/errors/darktable-4.6.0.log
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-02-24 09:35:34 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b1b2712440d93ea3c636266309bf9c1b518c595b

commit b1b2712440d93ea3c636266309bf9c1b518c595b
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2024-02-24 08:45:25 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-02-24 09:34:52 +0000

    graphics/darktable: Force building with GCC 12

    Second attempt to set USE_GCC=12 properly, so that the GCC_DEFAULT
    update can get forward.

    PR:             273681
    Approved by:    portmgr (blanket)
    Fixes:  c97005f74a5b graphics/darktable: Set USE_GCC=12

 graphics/darktable/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 10 Lorenzo Salvadore freebsd_committer freebsd_triage 2024-02-24 09:36:44 UTC
This time GCC 12 should be enforced properly, so I remove the block again.