Can't build third-party/wayland

When I run kde-builder workspace, the project third-party/wayland fails to build. Below is the build log:

# kde-builder running: 'ninja'
# from directory:  /home/mjq/kde/build/wayland
# with environment:  /home/mjq/kde/build/wayland/kde-builder.env
[1/129] Generating doc/publican/ProtocolSpec.xml with a custom command
[2/129] Generating doc/publican/ProtocolInterfaces.xml with a custom command
[3/129] Generating doc/publican/html/images/wayland-architecture.gv.map with a custom command
[4/129] Generating doc/publican/html/images/x-architecture.gv.map with a custom command
[5/129] Copying file doc/publican/Wayland.ent
[6/129] Copying file doc/publican/Xwayland.xml
[7/129] Copying file doc/publican/Wayland.xml
[8/129] Copying file doc/publican/Preface.xml
[9/129] Copying file doc/publican/Protocol.xml
[10/129] Copying file doc/publican/Server.xml
[11/129] Copying file doc/publican/Author_Group.xml
[12/129] Copying file doc/publican/Compositors.xml
[13/129] Copying file doc/publican/Book_Info.xml
[14/129] Copying file doc/publican/Revision_History.xml
[15/129] Copying file doc/publican/Foreword.xml
[16/129] Copying file doc/publican/Client.xml
[17/129] Copying file doc/publican/Color.xml
[18/129] Copying file doc/publican/html/css/brand.css
[19/129] Copying file doc/publican/html/css/common.css
[20/129] Generating doc/publican/html/images/wayland-architecture.gv.png with a custom command
[21/129] Generating src/wayland.dtd.h with a custom command (wrapped by meson to capture output)
[22/129] Generating doc/publican/html/images/x-architecture.gv.png with a custom command
[23/129] Generating doc/publican/Introduction.xml with a custom command
[24/129] Generating doc/publican/Architecture.xml with a custom command
[25/129] Copying file doc/publican/html/images/icon.svg
[26/129] Copying file doc/publican/html/images/wayland.png
[27/129] Copying file doc/publican/html/css/default.css
[28/129] Copying file doc/publican/html/css/epub.css
[29/129] Copying file doc/publican/html/css/print.css
[30/129] Compiling C object egl/wayland-egl-abi-check.p/wayland-egl-abi-check.c.o
[31/129] Compiling C object tests/enum-validator-test.p/enum-validator-test.c.o
[32/129] Compiling C object tests/exec-fd-leak-checker.p/exec-fd-leak-checker.c.o
[33/129] Compiling C object tests/fixed-test.p/fixed-test.c.o
[34/129] Linking target egl/wayland-egl-abi-check
[35/129] Compiling C object tests/map-test.p/map-test.c.o
[36/129] Compiling C object src/libwayland-private.a.p/wayland-os.c.o
[37/129] Generating doc/doxygen/html-Cursor-doc with a custom command
[38/129] Generating doc/doxygen/xml/Client/xml-Client-doc with a custom command
[39/129] Compiling C object tests/array-test.p/array-test.c.o
[40/129] Compiling C object tests/list-test.p/list-test.c.o
[41/129] Generating doc/doxygen/xml/Server/xml-Server-doc with a custom command
[42/129] Generating doc/publican/ClientAPI-combine-doxygen-files with a custom command
[43/129] Compiling C object src/libwayland-util.a.p/wayland-util.c.o
[44/129] Linking static target src/libwayland-util.a
[45/129] Compiling C object tests/os-wrappers-test.p/os-wrappers-test.c.o
[46/129] Generating doc/doxygen/man-pages-3 with a custom command
[47/129] Generating doc/publican/ClientAPI-doxygen-to-docbook with a custom command
[48/129] Generating doc/publican/ServerAPI-combine-doxygen-files with a custom command
[49/129] Generating doc/publican/ServerAPI-doxygen-to-docbook with a custom command
[50/129] Compiling C object src/libwayland-private.a.p/connection.c.o
[51/129] Linking static target src/libwayland-private.a
[52/129] Generating doc/publican/Wayland-docbook-html with a custom command
FAILED: [code=13] doc/publican/html 
/usr/bin/xmlto --stringparam chunker.output.encoding=UTF-8 --stringparam chunk.section.depth=0 --stringparam toc.section.depth=1 --stringparam generate.consistent.ids=1 --stringparam html.stylesheet=css/default.css -o doc/publican/html html doc/publican/Wayland.xml
xmlto: /home/mjq/kde/build/wayland/doc/publican/Wayland.xml does not validate (status 3)
xmlto: Fix document syntax or use --skip-validation option
Document /home/mjq/kde/build/wayland/doc/publican/Wayland.xml does not validate
[53/129] Compiling C object src/wayland-scanner.p/scanner.c.o
ninja: build stopped: subcommand failed.

# exit code was: 3328

Does anyone know why this project fails to build? I mean, I know why it is not building, in that an XML file is not validating. My question is why would their be compile errors in a stable branch of code? Am I using a stable branch? If not, how? Here is my config file:

# This file controls options to apply when configuring/building projects, and controls which projects are built in the first place.
# List of all options: https://kde-builder.kde.org/en/configuration/conf-options-table.html

config-version: 2
global:
  branch-group: kf6-qt6

  # Finds and includes *KDE*-based dependencies into the build. This makes
  # it easier to ensure that you have all the projects needed, but the
  # dependencies are not very fine-grained so this can result in quite a few
  # projects being installed that you didn't need.
  include-dependencies: true

  source-dir: ~/kde/src  # Directory for downloaded source code
  build-dir: ~/kde/build  # Directory to build KDE into before installing
  install-dir: ~/kde/usr  # Directory to install KDE software into
  # qt-install-dir: ~/kde/qt  # Directory to install Qt if kde-builder supplies it
  log-dir: ~/kde/log  # Directory to write logs into

  cmake-options: >
    -DCMAKE_BUILD_TYPE=RelWithDebInfo

  # kde-builder sets 2 options which is used in options like make-options or set-env
  # to help manage the number of compile jobs that happen during a build:
  #
  # 1. num-cores, which is just the number of detected CPU cores, and can be passed
  #    to tools like make (needed for parallel build) or ninja (completely optional).
  #
  # 2. num-cores-low-mem, which is set to the largest value that appears safe for
  #    particularly heavyweight projects based on total memory, intended for
  #    projects like qtwebengine.
  num-cores: "auto"
  num-cores-low-mem: "auto"

  # Makes the built-from-source Plasma session accessible from the SDDM login screen.
  install-login-session: true

  # Stop the build process on the first failure. If set to false, when kde-builder
  # encounters a build failure, it will attempt to continue building other projects,
  # using libraries from the system in cases where they would otherwise be provided
  # by a project that has failed to build.
  # Unless your system has very up-to-date packages, this is probably not what you want.
  stop-on-failure: true

  # Use a flat folder layout under ~/kde/src and ~/kde/build
  # rather than nested directories
  directory-layout: flat

  # Use Ninja as cmake generator
  cmake-generator: Ninja

  # Build with LSP support for everything that supports it
  compile-commands-linking: true
  compile-commands-export: true

  # Generate .idea config files in project directories
  # Enable this if you want to use CLion for development
  generate-clion-project-config: false

  # Generate .vscode config files in project directories
  # Enable this if you want to use Visual Studio Code for development
  generate-vscode-project-config: false

  # Generate copy-pastable files for manual qtcreator config creation
  # Enable this if you want to use Qt Creator for development
  generate-qtcreator-project-config: false

  # Show a message when kde-builder detects it is outdated.
  check-self-updates: true

# With base options set, the remainder of the file is used to define projects to build, in the
# desired order, and set any project-specific options.

# This line includes build configs that are provided in build-configs dir in repo-metadata.
# https://invent.kde.org/sysadmin/repo-metadata/-/tree/master/build-configs
# KDE Builder automatically updates repo-metadata, so you are always using an up-to-date configs.
include ${build-configs-dir}/kde6.yaml: ""

# ===============================================================================================
# Starting from here, you can add your custom projects and override options for defined projects.
# ===============================================================================================

#  To change options for projects that have already been defined, use an "override" node.
#  Example:
#
#    override qt6-set:
#      branch: dev
#
#  To define a project with some options, use "project" node.
#  Example:
#
#    project some-app:
#      repository: https://github.com/YourUser/YourProject.git

I’ve discovered the same problem just yesterday trying to build kwin project (which also depends on wayland).

It seems the problem is in one of the last commit upstream on main branch. The author says that “[…] all XML validation errors have been fixed […]”, so maybe the problem is somewhere on our side (in kde-builder or its configuration?)

I don’t know how to properly fix that, so as a quick workaround I do the following procedure (to properly build for example kwin):

kde-builder -s kwin (this just pulls all code changes from master/main branches for all dependencies)

Then I “hard reset” the local wayland sources to the commit just before the problematic one.

Then kde-builder -S kwin (which skips pull and just build).

I’m not sure why xmlto cannot parse this Wayland.xml file as it seems to be properly formatted…

I can confirm this issue after running kde-builder --refresh-build wayland on Fedora KDE 43.

You can do that with git reset --hard 4216a08b964207d2c7f588489de7c0da4388e7f7 and then kde-builder --no-src wayland, yeah.

You can also add the following to your ~/.config/kde-builder.yaml:

override wayland:
  revision: "4216a08b964207d2c7f588489de7c0da4388e7f7"

Or alternatively just not build the wayland docs:

override wayland:
  meson-options: -Ddocumentation=false

It’s possible that upstream was wrong, so maybe making an issue is worthwhile.

2 Likes

On my Ubuntu 25.10 machine, the build passes. On Arch it fails. I’m not really proficient in XML, so I can’t get to the bottom of it. Would appreciate an issue as well.

I just added the --skip-validation back in to bypass this issue in the meantime. I tried creating an issue but I couldn’t determine under what product the bug should be filed?

Upstream bug report by @at_underscore: Making sure you're not a bot!

Upstream reported they have fixed the issue.