Skip to content

SceneFX and gnome-keyring fail, requires header generation #122

@Zeckmathederg

Description

@Zeckmathederg

For most packages, samurai works just fine as a Ninja replacement. But I have observed issues when using it with two packages: SceneFX and gnome-keyring.

When building SceneFX and gnome-keyring, one of the earliest steps is header generation. It can be generation from protocols or other files within the source tree. These headers are then included in other files.

Ninja handles this dependency information and handles the header generation steps first or one of the first. samurai handles header generation near the end, when files being compiled beforehand are including the generated header files that have not yet been generated.

I have not observed this with any Wayland compositors or such, and both of those projects use Meson build systems.

I noticed that with SceneFX, if samu is ran 3 times, then the dependency order is figured out and compilation succeeds. Using multiple jobs does not help, but instead makes the issue worse, by compiling the files that need the headers more closer to the beginning.

Using a single thread, the failure can be observed:

root [/sources/misc/scenefx-0.4.1/build] > SAMUFLAGS=-j1 samu
[1/53] Generating protocol/xdg_shell_client_h with a custom command
[2/53] Compiling C object tinywl/tinywl.p/tinywl.c.o
samu: job failed with status 1: cc -Itinywl/tinywl.p -Itinywl -I../tinywl -Iinclude -I../include -Iprotocol -I/usr/include/wlroots-0.19 -I/usr/include/pixman-1 -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c23 -O3 -D_POSIX_C_SOURCE=200809L -DWLR_USE_UNSTABLE -DWLR_PRIVATE= -DWLR_LITTLE_ENDIAN=1 -DWLR_BIG_ENDIAN=0 -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wimplicit-fallthrough=2 -Wendif-labels -Wstrict-aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wno-missing-braces -Wno-missing-field-initializers -Wno-unused-parameter -fmacro-prefix-map=../= -MD -MQ tinywl/tinywl.p/tinywl.c.o -MF tinywl/tinywl.p/tinywl.c.o.d -o tinywl/tinywl.p/tinywl.c.o -c ../tinywl/tinywl.c
In file included from ../tinywl/tinywl.c:28:
/usr/include/wlroots-0.19/wlr/types/wlr_xdg_shell.h:16:10: fatal error: xdg-shell-protocol.h: No such file or directory
   16 | #include "xdg-shell-protocol.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
samu: subcommand failed

Using multiple threads, things are fine until about midway, where the same result is shown. Some protocols are generated into headers, but not all of them.

When Ninja is used, all the headers are generated first, instead of only doing some in the beginning.

I can speculate as to why this is the case. Perhaps the information giving to the Meson build system is wrong or incomplete, missing important dependency information, and that samu fails while Ninja perhaps papers over the issue. That's in regards to SceneFX. I can't fathom what's going on in gnome-keyring since I haven't took a look at the build system yet.

Issue was present since at least 737f70 and persists at the now current commit ff9b14.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions