Bug 273649 - textproc/enchant: Fix build with ISPELL option with LLVM/clang++ 16
Summary: textproc/enchant: Fix build with ISPELL option with LLVM/clang++ 16
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: Olivier Certner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-08 21:28 UTC by Olivier Certner
Modified: 2024-01-19 08:55 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gnome)


Attachments
Please apply with 'git am' (794 bytes, patch)
2023-09-08 21:29 UTC, Olivier Certner
no flags Details | Diff
Please apply with 'git am' (893 bytes, patch)
2023-09-22 15:28 UTC, Olivier Certner
no flags Details | Diff
Please apply with 'git am' (892 bytes, patch)
2023-10-17 13:29 UTC, Olivier Certner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Certner freebsd_committer freebsd_triage 2023-09-08 21:28:34 UTC
clang++ 16 defaults to C++17 causing errors with the codebase.  Switching back to C++14 makes it build.

Patch to be attached after bug creation.  Please apply with 'git am'.

Thanks.
Comment 1 Olivier Certner freebsd_committer freebsd_triage 2023-09-08 21:29:28 UTC
Created attachment 244723 [details]
Please apply with 'git am'
Comment 2 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-09-09 04:16:07 UTC
(In reply to Olivier Certner from comment #0)
> clang++ 16 defaults to C++17 causing errors with the codebase.
Could you please cite the exact built errors you're seeing?  I couldn't find the log in the pkg-fallout@ reports nor reproduce it locally with patched Makefile (CXX=/usr/local/bin/clang++16).

> Switching back to C++14 makes it build.
Fixing the actual bug(s) in the code is preferred to lowering the C++ standard, but in any case we must understand what's going on here first.
Comment 3 Olivier Certner freebsd_committer freebsd_triage 2023-09-09 08:39:50 UTC
(In reply to Alexey Dokuchaev from comment #2)

The only errors this build produces are these:
> error: ISO C++17 does not allow 'register' storage class specifier
and there are dozens of them.

They are harmless, and in fact were fixed upstream long ago (in 2017).  For there reasons, I don't think it's worth it to patch them out.  I'll also note that upstream explicitly requires C++11 in the newer 1.6.1 version (from 2017) of the 1.x series.

So I tend to think that this should go in as is (perhaps using "USE_CXXSTD=c++11" instead).  An alternative would be to upgrade to 1.6.1, but this can be done afterwards with no harm (it is likely to take more time, and right now I can't).

As to why there are no fallouts, for 13, that's normal since apparently the last builds were with clang 14.0.5, whereas I have clang 16.0.6 (I'm on 13-STABLE from end of August).  The latter clang version is also the one used for the latest pkg builds for 14-STABLE, where no fallouts can be seen, and I'm not sure why.  FWIW, I'm using the ports tree at 38c671e45e4bae21a0199079d08273c1f171e1d4.

What do you think?
Comment 4 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-09-14 08:55:40 UTC
(In reply to Olivier Certner from comment #3)
> The only errors this build produces are these:
> error: ISO C++17 does not allow 'register' storage class specifier
> and there are dozens of them.
I only see those when building the port with non-default ISPELL option, which also agrees with grepping the source code for `register'.  You didn't mention this detail. :-)

> As to why there are no fallouts, for 13 [...]
I meant pkg-fallout@ runs against -CURRENT, of course.

> where no fallouts can be seen, and I'm not sure why.
I guess that's because the port defaults to HUNSPELL, could you confirm?
Comment 5 Olivier Certner freebsd_committer freebsd_triage 2023-09-22 14:49:38 UTC
(In reply to Alexey Dokuchaev from comment #4)

> You didn't mention this detail. :-)

Indeed. :-)

> I meant pkg-fallout@ runs against -CURRENT, of course.

I'm reporting a build failure on 13-STABLE, so naturally I wanted to know if this problem was visible in the ports build for 13, in addition to -CURRENT.

> I guess that's because the port defaults to HUNSPELL, could you confirm?

I confirm that the ISPELL option is the culprit.  I've also tested building with the C++11 standard (instead of C++14) and it works.  So going to upload an amended patch to use that standard (as said above, matches what upstream did for 1.6.1).

I don't know anything more about this port.  Would upgrading it to 1.6.1 be a pain?  On my machines, I only see it appearing as a dependency of gtkspell, but in the ports tree it seems to be a dependency for a bunch of other ones, including some PHP ports.
Comment 6 Olivier Certner freebsd_committer freebsd_triage 2023-09-22 15:28:50 UTC
Created attachment 245120 [details]
Please apply with 'git am'

Force C++11 standard instead of C++14.

Revise the commit message to indicate that the build fails only with ISPELL option activated.
Comment 7 Olivier Certner freebsd_committer freebsd_triage 2023-10-17 13:29:55 UTC
Created attachment 245696 [details]
Please apply with 'git am'

New patch, because I managed to mess up the previous version.

Ping?
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-01-18 23:46:43 UTC
A commit in branch main references this bug:

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

commit ed633bad445cb49e524aab1cb11a2cbf17364a5c
Author:     Olivier Certner <olce.freebsd@certner.fr>
AuthorDate: 2023-08-25 11:06:31 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2024-01-18 23:44:50 +0000

    textproc/enchant: Fix build with ISPELL option

    clang++ 16 defaults to C++17 causing errors with the codebase when the
    ISPELL option is turned on.  Switching back to C++11 (what upstream did
    for 1.6.1) makes it build correctly.

    PR:             273649

 textproc/enchant/Makefile | 1 +
 1 file changed, 1 insertion(+)
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-01-18 23:51:45 UTC
A commit in branch 2024Q1 references this bug:

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

commit 236c97ad7faea13d55f4f2a611ee250fcf55c10c
Author:     Olivier Certner <olce.freebsd@certner.fr>
AuthorDate: 2023-08-25 11:06:31 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2024-01-18 23:48:34 +0000

    textproc/enchant: Fix build with ISPELL option

    clang++ 16 defaults to C++17 causing errors with the codebase when the
    ISPELL option is turned on.  Switching back to C++11 (what upstream did
    for 1.6.1) makes it build correctly.

    PR:             273649
    (cherry picked from commit ed633bad445cb49e524aab1cb11a2cbf17364a5c)

 textproc/enchant/Makefile | 1 +
 1 file changed, 1 insertion(+)