Wayland-protocols refuses to build

I’m trying to get the development working but still can’t build basic KDE apps like Okular and KCalc, because wayland-protocols produce compilation warnings and they are treated as errors:

# kde-builder running: 'ninja'
# from directory:  /home/andrej/kde/build/wayland-protocols
# with environment:  /home/andrej/kde/build/wayland-protocols/kde-builder.env
[1/489] Generating tests/test-build-cxx-stable_linux_dmabuf_linux_dmabuf_v1_xml.cc with a custom command
[2/489] Linking target tests/test-build-cxx-stable_xdg_shell_xdg_shell_xml
[3/489] Generating tests/tablet-v2-client.h with a custom command
[4/489] Generating tests/tablet-v2-server.h with a custom command
[5/489] Generating tests/tablet-v2-code.c with a custom command
[6/489] Compiling C object tests/test-build-pedantic-stable_viewporter_viewporter_xml.p/meson-generated_.._test-build-pedantic-stable_viewporter_viewporter_xml.c.o
FAILED: tests/test-build-pedantic-stable_viewporter_viewporter_xml.p/meson-generated_.._test-build-pedantic-stable_viewporter_viewporter_xml.c.o 
cc -Itests/test-build-pedantic-stable_viewporter_viewporter_xml.p -Itests -I../../src/wayland-protocols/tests -I/home/andrej/kde/usr/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -std=c99 -pedantic -Wall -Werror -MD -MQ tests/test-build-pedantic-stable_viewporter_viewporter_xml.p/meson-generated_.._test-build-pedantic-stable_viewporter_viewporter_xml.c.o -MF tests/test-build-pedantic-stable_viewporter_viewporter_xml.p/meson-generated_.._test-build-pedantic-stable_viewporter_viewporter_xml.c.o.d -o tests/test-build-pedantic-stable_viewporter_viewporter_xml.p/meson-generated_.._test-build-pedantic-stable_viewporter_viewporter_xml.c.o -c tests/test-build-pedantic-stable_viewporter_viewporter_xml.c
In file included from /home/andrej/kde/usr/include/wayland-client.h:39,
                 from /home/andrej/kde/build/wayland-protocols/tests/viewporter-client.h:8,
                 from tests/test-build-pedantic-stable_viewporter_viewporter_xml.c:1:
/home/andrej/kde/usr/include/wayland-client-core.h:256:42: error: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
  256 |                             const struct timespec *timeout);
      |                                          ^~~~~~~~
/home/andrej/kde/usr/include/wayland-client-core.h:261:48: error: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
  261 |                                   const struct timespec *timeout);
      |                                                ^~~~~~~~
cc1: all warnings being treated as errors 

I didn’t specify any branch, so kde-builder is just taking the master branch, I suppose. What am I doing wrong?

The issue was fixed in upstream wayland:

Upstream bug:

Thanks. I retried to build with --refresh-build. The outcome states that recent changes have been fetched from main branch, but the build still fails:

Building wayland-protocols from custom-qt6-libs (11/46)
        Fetching remote changes to wayland-protocols
        Merging wayland-protocols changes from branch main
        Source update complete for wayland-protocols: no files affected
          Rebuilding because the option refresh-build was set
        Preparing build system for wayland-protocols.
        Removing files in build directory for wayland-protocols
        Old build system cleaned, starting new build system.
        Compiling... failed (after 2 seconds)

wayland-protocols didn't build, stopping here.
[monitor process] recv SIGHUP, will end after updater process finishes.
 

You’ll need to read the log file and see what the new error is, then fix it.