Problems building Xarcan

I’m working on PR#123287. When I try to build Xarcan I get build errors. I think that all necessary dependencies should be available, and Xarcan builds on non-Nix systems. Xarcan is available in Void Linux, in their repository. Do you have any suggestions on what is causing the build errors?

$ nix-build -A xarcan
these derivations will be built:
  /nix/store/if3pnf7y3lm40ih1k3xj8z4fjjl7j6xc-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc.drv
building '/nix/store/if3pnf7y3lm40ih1k3xj8z4fjjl7j6xc-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc.drv'...
unpacking sources
unpacking source archive /nix/store/1b278458zfacc3ja1r5mp7mjgh629gyy-source
source root is source
patching sources
configuring
meson flags: --buildtype=plain         --libdir=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc/lib --libexecdir=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc/libexec         --bindir=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc/bin --sbindir=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc/sbin         --includedir=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc/include         --mandir=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc/share/man --infodir=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc/share/info         --localedir=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc/share/locale         -Dauto_features=enabled         -Dwrap_mode=nodownload         --prefix=/nix/store/yvi5pm378iiq6yazrym5jizaz700l1s0-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc
The Meson build system
Version: 0.57.1
Source dir: /build/source
Build dir: /build/source/build
Build type: native build
Project name: xserver
Project version: 20.99.1
C compiler for the host machine: gcc (gcc 10.3.0 "gcc (GCC) 10.3.0")
C linker for the host machine: gcc ld.bfd 2.35.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wall: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wformat=2: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wnested-externs: YES
Compiler for C supports arguments -Wbad-function-cast: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wunused: YES
Compiler for C supports arguments -Wuninitialized: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wmissing-noreturn: YES
Compiler for C supports arguments -Wmissing-format-attribute: YES
Compiler for C supports arguments -Wno-suggest-attribute=format: YES
Compiler for C supports arguments -Wredundant-decls: YES
Compiler for C supports arguments -Werror=implicit: YES
Compiler for C supports arguments -Werror=nonnull: YES
Compiler for C supports arguments -Werror=init-self: YES
Compiler for C supports arguments -Werror=main: YES
Compiler for C supports arguments -Werror=missing-braces: YES
Compiler for C supports arguments -Werror=sequence-point: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=trigraphs: YES
Compiler for C supports arguments -Werror=array-bounds: YES
Compiler for C supports arguments -Werror=write-strings: YES
Compiler for C supports arguments -Werror=address: YES
Compiler for C supports arguments -Werror=int-to-pointer-cast: YES
Compiler for C supports arguments -Werror=pointer-to-int-cast: YES
meson.build:60: WARNING: Consider using the built-in warning_level option instead of using "-Wall".
Found pkg-config: /nix/store/5nwv4kv0sqhzi7alkvnl8jx3k9mrnhxi-pkg-config-wrapper-0.29.2/bin/pkg-config (0.29.2)
Run-time dependency xproto found: YES 7.0.33
Run-time dependency randrproto found: YES 1.6.0
Run-time dependency renderproto found: YES 0.11.1
Run-time dependency xextproto found: YES 7.3.0
Run-time dependency inputproto found: YES 2.3.2
Run-time dependency kbproto found: YES 1.0.7
Run-time dependency fontsproto found: YES 2.1.3
Run-time dependency fixesproto found: YES 5.0
Run-time dependency damageproto found: YES 1.2.1
Run-time dependency xcmiscproto found: YES 1.2.2
Run-time dependency bigreqsproto found: YES 1.1.2
Run-time dependency xtrans found: YES 1.4.0
Run-time dependency videoproto found: YES 2.3.3
Run-time dependency compositeproto found: YES 0.4.2
Run-time dependency recordproto found: YES 1.14.2
Run-time dependency scrnsaverproto found: YES 1.2.3
Run-time dependency resourceproto found: YES 1.2.0
Run-time dependency xf86driproto found: YES 2.1.1
Run-time dependency dri2proto found: YES 2.8
Run-time dependency dri3proto found: YES 1.2
Run-time dependency xineramaproto found: YES 1.2.1
Run-time dependency xf86bigfontproto found: YES 1.2.0
Run-time dependency xf86vidmodeproto found: YES 2.3.1
Run-time dependency applewmproto found: YES 1.4.2
Run-time dependency xshmfence found: YES 1.3
Run-time dependency pixman-1 found: YES 0.38.4
Run-time dependency libbsd found: YES 0.10.0
Run-time dependency xkbcomp found: YES 1.4.5
Run-time dependency xkbfile found: YES 1.1.0
Run-time dependency xfont2 found: YES 2.0.4
Run-time dependency dbus-1 found: YES 1.12.20
Run-time dependency libsystemd found: YES 247
Run-time dependency fontutil found: YES 1.3.1
Checking for function "getaddrinfo" : YES
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency hal found: NO (tried pkgconfig and cmake)
Run-time dependency gbm found: YES 21.0.1
Run-time dependency epoxy found: YES 1.5.4
Checking for function "SHA1Init" : NO
Checking for function "CC_SHA1_Init" : NO
Has header "wincrypt.h" : NO
Library md found: YES
Message: Using libmd SHA1 functions
Run-time dependency xdmcp found: YES 1.1.3
Run-time dependency libdrm found: YES 2.4.105
Run-time dependency xf86dgaproto found: YES 2.1
Has header "linux/apm_bios.h" : YES
Has header "sys/shm.h" : YES
Library m found: YES
Library dl found: YES
Run-time dependency libselinux found: YES 3.0
Run-time dependency audit found: YES 2.8.5
Run-time dependency dri found: YES 21.0.1
Checking if "typeof()" compiles: YES
Checking for function "clock_gettime" : YES
Checking if "CLOCK_MONOTONIC" compiles: YES
Checking for size of "unsigned long" : 8
Header <pthread.h> has symbol "PTHREAD_MUTEX_RECURSIVE" : YES
Checking if "pthread_setname_np(tid, name)" compiles: YES
Has header "dlfcn.h" : YES
Has header "execinfo.h" : YES
Has header "fcntl.h" : YES
Has header "fnmatch.h" : YES
Has header "linux/agpgart.h" : YES
Has header "stdlib.h" : YES
Has header "string.h" : YES
Has header "strings.h" : YES
Has header "sys/agpgart.h" : NO
Has header "sys/agpio.h" : NO
Has header "sys/utsname.h" : YES
Has header "sys/sysmacros.h" : YES
Has header "unistd.h" : YES
Checking for function "arc4random_buf" with dependency libbsd: YES
Checking for function "backtrace" : YES
Checking for function "cbrt" : YES
Checking for function "epoll_create1" : YES
Checking for function "getuid" : YES
Checking for function "geteuid" : YES
Checking for function "isastream" : NO
Checking for function "issetugid" : NO
Checking for function "getifaddrs" : YES
Checking for function "getpeereid" : NO
Checking for function "getpeerucred" : NO
Checking for function "getprogname" : NO
Checking for function "getzoneid" : NO
Checking for function "memfd_create" : YES
Checking for function "mkostemp" : YES
Checking for function "mmap" : YES
Checking for function "poll" : YES
Checking for function "pollset_create" : NO
Checking for function "posix_fallocate" : YES
Checking for function "port_create" : NO
Checking for function "reallocarray" with dependency libbsd: YES
Checking for function "seteuid" : YES
Checking for function "setitimer" : YES
Checking for function "shmctl64" : NO
Checking for function "sigaction" : YES
Checking for function "sigprocmask" : YES
Checking for function "strcasecmp" : YES
Checking for function "strcasestr" : YES
Checking for function "strlcat" with dependency libbsd: YES
Checking for function "strlcpy" with dependency libbsd: YES
Checking for function "strncasecmp" : YES
Checking for function "strndup" : YES
Header <string.h> has symbol "strndup" : YES
Checking for function "timingsafe_memcmp" : NO
Checking for function "vasprintf" : YES
Checking for function "vsnprintf" : YES
Checking for function "walkcontext" : NO
Header <sys/socket.h> has symbol "SCM_RIGHTS" : YES
Header <sys/socket.h> has symbol "SO_PEERCRED" : YES
Configuring dix-config.h using configuration
WARNING: Project targeting '>= 0.47.0' but tried to use feature introduced in '0.50.0': install arg in configure_file.
Configuring xorg-server.h using configuration
Configuring version-config.h using configuration
Configuring xkb-config.h using configuration
Has header "stropts.h" : NO
Has header "sys/kd.h" : YES
Has header "sys/vt.h" : YES
Configuring xorg-config.h using configuration
Configuring xwin-config.h using configuration
Configuring xwayland-config.h using configuration
Run-time dependency glproto found: YES 1.4.17
Run-time dependency gl found: YES 1.3.3
Dependency glproto found: YES 1.4.17 (cached)
Dependency gl found: YES 1.3.3 (cached)
os/meson.build:24: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
os/meson.build:27: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
os/meson.build:30: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
os/meson.build:33: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
os/meson.build:36: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
os/meson.build:39: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
os/meson.build:45: WARNING: Trying to compare values of different types (str, bool) using ==.
The result of this is undefined and will become a hard error in a future Meson release.
os/meson.build:49: WARNING: Trying to compare values of different types (str, bool) using !=.
The result of this is undefined and will become a hard error in a future Meson release.
Run-time dependency libtirpc found: YES 1.2.6
Library pthread found: YES
Run-time dependency xau found: YES 1.0.9
Run-time dependency presentproto found: YES 1.2
Dependency epoxy found: YES 1.5.4 (cached)
Message: added kdrive
Run-time dependency arcan-shmif found: YES 0.6.0
Run-time dependency arcan-shmif-ext found: YES 0.6.0
Program rendercheck found: NO
Run-time dependency xcb found: YES 1.14
Run-time dependency xcb-xinput found: YES 1.14
Dependency xcb found: YES 1.14 (cached)
Run-time dependency xcb-damage found: YES 1.14
Dependency xcb found: YES 1.14 (cached)
Run-time dependency xcb-sync found: YES 1.14
Configuring Xserver.1 using configuration
Build targets in project: 33
WARNING: Project specifies a minimum meson_version '>= 0.47.0' but uses features which were added in newer versions:
 * 0.50.0: {'install arg in configure_file'}

Option buildtype is: plain [default: debugoptimized]
Found ninja-1.10.2 at /nix/store/xs8izjgn764z9c6hsqh4famk6m0z8560-ninja-1.10.2/bin/ninja
meson: enabled parallel building
building
build flags: -j4 -l4
[143/407] Compiling C object os/liblibxserver_os.a.p/access.c.oKoK[KK[Kc.oc.o
FAILED: os/liblibxserver_os.a.p/access.c.o
gcc -Ios/liblibxserver_os.a.p -Ios -I../os -IXext -I../Xext -IXi -I../Xi -Icomposite -I../composite -Idamageext -I../damageext -I../exa -Ifb -I../fb -Iglamor -I../glamor -Imi -I../mi -Imiext/damage -I../miext/damage -Imiext/shadow -I../miext/shadow -Imiext/sync -I../miext/sync -Idbe -I../dbe -Idri3 -I../dri3 -Iinclude -I../include -Ipresent -I../present -Irandr -I../randr -Irender -I../render -Ixfixes -I../xfixes -I/nix/store/bzfsqnx1fc08vb5nkl20grr2mrfwk1zs-xorgproto-2021.3/include -I/nix/store/hc4zxp0fyk9rqry9svd5mmjlfxdkcgd8-xtrans-1.4.0/include -I/nix/store/g7vifxq7kjx7iam70ssfjs4p10kl96zc-systemd-247.6-dev/include -I/nix/store/bzfsqnx1fc08vb5nkl20grr2mrfwk1zs-xorgproto-2021.3/include/X11/dri -I/nix/store/kflcxy78frl16bxklfsk62bd24yyniis-pixman-0.38.4/include/pixman-1 -I/nix/store/lgp6a5wcp2qyz6mfz8j4q04l6m8ng2zi-libbsd-0.10.0-dev/include -I/nix/store/z0h521gyynpylskcknj287zgdj1524h4-libxkbfile-1.1.0-dev/include -I/nix/store/wcr1p7c9xrmw1dg9gc30js9xar2ifvhb-libXfont2-2.0.4/include -I/nix/store/80b49by2j929bsc860lh0jaxlypm2ir3-libXdmcp-1.1.3-dev/include -I/nix/store/9cmcx5nwpqbir4a879a0rdfr3zyk7pxw-libselinux-3.0-dev/include -I/nix/store/js2lpj7a8a3hjqrnamjzvl6g5gxq59yq-audit-2.8.5-dev/include -I/nix/store/s6xlmmm0hz74ls5fpji2yyx09cabq3j6-libtirpc-1.2.7-rc4-dev/include/tirpc -I/nix/store/ajyd0m4qy11gsfdpy11pc0qj3ml16qxi-libXau-1.0.9-dev/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DHAVE_DIX_CONFIG_H -fno-strict-aliasing -fvisibility=hidden -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wno-suggest-attribute=format -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fPIC -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -DCLIENTIDS -MD -MQ os/liblibxserver_os.a.p/access.c.o -MF os/liblibxserver_os.a.p/access.c.o.d -o os/liblibxserver_os.a.p/access.c.o -c ../os/access.c
../os/access.c: In function 'siHostnameAddrMatch':
../os/access.c:1820:9: error: implicit declaration of function 'strlcpy'; did you mean 'strncpy'? [-Werror=implicit-function-declaration]
 1820 |         strlcpy(hostname, siAddr, siAddrLen + 1);
      |         ^~~~~~~
      |         strncpy
../os/access.c:1820:9: warning: nested extern declaration of 'strlcpy' [-Wnested-externs]
cc1: some warnings being treated as errors
[146/407] Compiling C object os/liblibxserver_os.a.p/connection.c.oK
FAILED: os/liblibxserver_os.a.p/connection.c.o
gcc -Ios/liblibxserver_os.a.p -Ios -I../os -IXext -I../Xext -IXi -I../Xi -Icomposite -I../composite -Idamageext -I../damageext -I../exa -Ifb -I../fb -Iglamor -I../glamor -Imi -I../mi -Imiext/damage -I../miext/damage -Imiext/shadow -I../miext/shadow -Imiext/sync -I../miext/sync -Idbe -I../dbe -Idri3 -I../dri3 -Iinclude -I../include -Ipresent -I../present -Irandr -I../randr -Irender -I../render -Ixfixes -I../xfixes -I/nix/store/bzfsqnx1fc08vb5nkl20grr2mrfwk1zs-xorgproto-2021.3/include -I/nix/store/hc4zxp0fyk9rqry9svd5mmjlfxdkcgd8-xtrans-1.4.0/include -I/nix/store/g7vifxq7kjx7iam70ssfjs4p10kl96zc-systemd-247.6-dev/include -I/nix/store/bzfsqnx1fc08vb5nkl20grr2mrfwk1zs-xorgproto-2021.3/include/X11/dri -I/nix/store/kflcxy78frl16bxklfsk62bd24yyniis-pixman-0.38.4/include/pixman-1 -I/nix/store/lgp6a5wcp2qyz6mfz8j4q04l6m8ng2zi-libbsd-0.10.0-dev/include -I/nix/store/z0h521gyynpylskcknj287zgdj1524h4-libxkbfile-1.1.0-dev/include -I/nix/store/wcr1p7c9xrmw1dg9gc30js9xar2ifvhb-libXfont2-2.0.4/include -I/nix/store/80b49by2j929bsc860lh0jaxlypm2ir3-libXdmcp-1.1.3-dev/include -I/nix/store/9cmcx5nwpqbir4a879a0rdfr3zyk7pxw-libselinux-3.0-dev/include -I/nix/store/js2lpj7a8a3hjqrnamjzvl6g5gxq59yq-audit-2.8.5-dev/include -I/nix/store/s6xlmmm0hz74ls5fpji2yyx09cabq3j6-libtirpc-1.2.7-rc4-dev/include/tirpc -I/nix/store/ajyd0m4qy11gsfdpy11pc0qj3ml16qxi-libXau-1.0.9-dev/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DHAVE_DIX_CONFIG_H -fno-strict-aliasing -fvisibility=hidden -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wno-suggest-attribute=format -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fPIC -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -DCLIENTIDS -MD -MQ os/liblibxserver_os.a.p/connection.c.o -MF os/liblibxserver_os.a.p/connection.c.o.d -o os/liblibxserver_os.a.p/connection.c.o -c ../os/connection.c
../os/connection.c: In function 'AuthAudit':
../os/connection.c:386:9: error: implicit declaration of function 'strlcpy'; did you mean 'strncpy'? [-Werror=implicit-function-declaration]
  386 |         strlcpy(addr, "local host", sizeof(addr));
      |         ^~~~~~~
      |         strncpy
../os/connection.c:386:9: warning: nested extern declaration of 'strlcpy' [-Wnested-externs]
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
builder for '/nix/store/if3pnf7y3lm40ih1k3xj8z4fjjl7j6xc-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc.drv' failed with exit code 1
error: build of '/nix/store/if3pnf7y3lm40ih1k3xj8z4fjjl7j6xc-xarcan-c19cca12f21c451a306c3eeffce450c058cfe6bc.drv' failed

This problem was solved by removing libbsd. Apparently the build fails if this package is available in the build environment.