Bug 276190

Summary: www/lagrange: Fails to build on 15-CURRENT
Product: Ports & Packages Reporter: Alastair Hogge <agh>
Component: Individual Port(s)Assignee: Lewis Cook <lcook>
Status: New ---    
Severity: Affects Only Me CC: agh, dan.kotowski, freebsd, scf
Priority: --- Flags: bugzilla: maintainer-feedback? (lcook)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 274414    

Description Alastair Hogge 2024-01-07 22:51:35 UTC
Hello, current Port (1.16.5), and 1.17.x updates fail to build on FreeBSD:

> FAILED: lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o
> /usr/bin/cc -DiIsLibraryBuild -I/tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/include -I/tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/.build/lib/the_Foundation -I/usr/local/include -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  > -DNDEBUG -std=gnu11 -Wall -Wpedantic -Werror -Wno-deprecated-declarations -Wno-format-pedantic -Wno-format -msse4.1 -MD -MT lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o -MF lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o.d -o lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o -c /tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/src/punycode.c
> In file included from /tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/src/punycode.c:41:
> /usr/local/include/unistr.h:203:39: error: [[]] attributes are a C2x extension [-Werror,-Wc2x-extensions]
>   203 |                    const uint32_t *s, _GL_ATTRIBUTE_MAYBE_UNUSED size_t n)
>       |                                       ^
> /usr/local/include/unistring/cdefs.h:44:37: note: expanded from macro '_GL_ATTRIBUTE_MAYBE_UNUSED'
>    44 | # define _GL_ATTRIBUTE_MAYBE_UNUSED _UC_ATTRIBUTE_MAYBE_UNUSED
>       |                                     ^
> /usr/local/include/unistring/cdefs.h:105:37: note: expanded from macro '_UC_ATTRIBUTE_MAYBE_UNUSED'
>   105 | # define _UC_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
>       |                                     ^
> In file included from /tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/src/punycode.c:41:
> /usr/local/include/unistr.h:270:13: error: [[]] attributes are a C2x extension [-Werror,-Wc2x-extensions]
>   270 |             _GL_ATTRIBUTE_MAYBE_UNUSED size_t n)
>       |             ^
> /usr/local/include/unistring/cdefs.h:44:37: note: expanded from macro '_GL_ATTRIBUTE_MAYBE_UNUSED'
>    44 | # define _GL_ATTRIBUTE_MAYBE_UNUSED _UC_ATTRIBUTE_MAYBE_UNUSED
>       |                                     ^
> /usr/local/include/unistring/cdefs.h:105:37: note: expanded from macro '_UC_ATTRIBUTE_MAYBE_UNUSED'
>   105 | # define _UC_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
>       |                                     ^
> 2 errors generated.
> ninja: build stopped: subcommand failed.
> *** Error code 1
Comment 1 Alastair Hogge 2024-01-07 22:51:54 UTC
Logs:
https://portsfallout.com/port/29942/
Comment 2 Mina Galić freebsd_triage 2024-01-08 08:07:46 UTC
the culprits here are -std=gnu11 and -Wpedantic
if the compiler is to be pedantic about the standard, then it has to error out on things that aren't a standard (yet)

try removing the -Wpedantic and see where that leads us to
Comment 3 Alastair Hogge 2024-01-14 00:09:31 UTC
(In reply to Mina Galić from comment #2)
 
Ah awesome, thanks, I will have a look and report back.
Comment 4 Alastair Hogge 2024-01-15 02:06:35 UTC
I patched ${WRKSRC}/lib/the_Foundation/CMakeLists.txt to remove the -Wpedantic, the error remains the same:

> [ 75% 92/122] /usr/bin/cc -DiIsLibraryBuild -I/tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/include -I/tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/.build/lib/the_Foundation -I/usr/local/include -O2 -pipe  -Wc2x-extensions -fstack-protector-strong -fno-strict-aliasing -O2 -pipe  -Wc2x-extensions -fstack-protector-strong -fno-strict-aliasing  -DNDEBUG -std=gnu11 -Wall -Werror -Wno-deprecated-declarations -Wno-format-pedantic -Wno-format -msse4.1 -MD -MT lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o -MF lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o.d -o lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o -c /tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/src/punycode.c
> FAILED: lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o
> /usr/bin/cc -DiIsLibraryBuild -I/tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/include -I/tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/.build/lib/the_Foundation -I/usr/local/include -O2 -pipe  -Wc2x-extensions -fstack-protector-strong -fno-strict-aliasing -O2 -pipe  -Wc2x-extensions -fstack-protector-strong -fno-strict-aliasing  -DNDEBUG -std=gnu11 -Wall -Werror -Wno-deprecated-declarations -Wno-format-pedantic -Wno-format -msse4.1 -MD -MT lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o -MF lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o.d -o lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/punycode.c.o -c /tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/src/punycode.c
> In file included from /tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/src/punycode.c:41:
> /usr/local/include/unistr.h:203:39: error: [[]] attributes are a C2x extension [-Werror,-Wc2x-extensions]
>   203 |                    const uint32_t *s, _GL_ATTRIBUTE_MAYBE_UNUSED size_t n)
>       |                                       ^
> /usr/local/include/unistring/cdefs.h:44:37: note: expanded from macro '_GL_ATTRIBUTE_MAYBE_UNUSED'
>    44 | # define _GL_ATTRIBUTE_MAYBE_UNUSED _UC_ATTRIBUTE_MAYBE_UNUSED
>       |                                     ^
> /usr/local/include/unistring/cdefs.h:105:37: note: expanded from macro '_UC_ATTRIBUTE_MAYBE_UNUSED'
>   105 | # define _UC_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
>       |                                     ^
> In file included from /tmp/lagrange/net/fafnir/git/worktrees/lagrange-20240107/www/lagrange/work/lagrange-1.17.5/lib/the_Foundation/src/punycode.c:41:
> /usr/local/include/unistr.h:270:13: error: [[]] attributes are a C2x extension [-Werror,-Wc2x-extensions]
>   270 |             _GL_ATTRIBUTE_MAYBE_UNUSED size_t n)
>       |             ^
> /usr/local/include/unistring/cdefs.h:44:37: note: expanded from macro '_GL_ATTRIBUTE_MAYBE_UNUSED'
>    44 | # define _GL_ATTRIBUTE_MAYBE_UNUSED _UC_ATTRIBUTE_MAYBE_UNUSED
>       |                                     ^
> /usr/local/include/unistring/cdefs.h:105:37: note: expanded from macro '_UC_ATTRIBUTE_MAYBE_UNUSED'
>   105 | # define _UC_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
>       |                                     ^
> 2 errors generated.
> ninja: build stopped: subcommand failed.
> *** Error code 1
>
> Stop.
> make[1]: stopped in /net/fafnir/git/worktrees/lagrange-20240107/www/lagrange
> *** Error code 1
>
> Stop.
> make: stopped in /net/fafnir/git/worktrees/lagrange-20240107/www/lagrange
Comment 5 Sean Farley freebsd_committer freebsd_triage 2024-01-19 03:07:14 UTC
I cheated a little by downgrading errors to warnings with this in the port Makefile:

    CMAKE_ARGS+=   -DTFDN_ENABLE_WARN_ERROR=OFF

That is telling "the_Foundation" to not fail on the warnings coming from the libunistring port, I think.  :)
Comment 6 Alastair Hogge 2024-01-21 03:10:18 UTC
(In reply to Sean Farley from comment #5)

Thanks Sean, It would be nice to avoid attenuating the compiler's constraints, however, the solution is beyond me. Thanks for the tip anyways, I am testing an updated patch from bug #274414 at the moment, so far so good.