Build failure on nightly Haiku (anyboot) — error: strchrnul not declared in scope

Hello Haiku developers,

I’m trying to build a fresh nightly-anyboot image, but the build fails during compilation of libroot.

I’m using a VMware Haiku virtual machine, and my build environment and repositories are fully up to date.

here is the logs:

../src/system/libroot/os/driver_settings.cpp: In function 'status_t get_word(char**, char**, int32, bool)':
../src/system/libroot/os/driver_settings.cpp:183:31: error: 'strchrnul' was not declared in this scope; did you mean 'strchr'?
  183 |                         pos = strchrnul(pos, '\n');
      |                               ^~~~~~~~~
      |                               strchr
gcc -c "../src/system/libroot/os/driver_settings.cpp" -O2 -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar -include ../headers/build/HaikuBuildCompatibility.h -D'HAIKU_BUILD_ATTRIBUTES_DIR="/boot/home/haiku-source/haiku/generated.x86_64/attributes"' -D_HAIKU_BUILD_DONT_REMAP_FD_FUNCTIONS=1 -include ../headers/build/BeOSBuildCompatibility.h -fPIC -DARCH_x86_64 -D_NO_INLINE_ASM -D__NO_INLINE__ -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAIKU_HOST_USE_XATTR -DHAIKU_HOST_PLATFORM_HAIKU -DHAIKU_HOST_PLATFORM_64_BIT -DHAIKU_PACKAGING_ARCH=\"x86_64\" -iquote ../build/user_config_headers -iquote ../build/config_headers -iquote ../src/build/libroot -iquote objects/common/build/libroot -iquote objects/haiku_host/x86_64/common/build/libroot -iquote objects/haiku/x86_64/common/build/libroot -I ../headers/build -I ../headers/build/os -I ../headers/build/os/app -I ../headers/build/os/drivers -I ../headers/build/os/kernel -I ../headers/build/os/interface -I ../headers/build/os/storage -I ../headers/build/os/support -I ../headers/build/private/kernel -I ../headers/build/private/libroot -I ../headers/build/private/system -I ../headers/private/system -I ../headers/build/host/haiku_host -I ../headers/build -I ../headers/build/os -I ../headers/build/os/add-ons/registrar -I ../headers/build/os/app -I ../headers/build/os/bluetooth -I ../headers/build/os/drivers -I ../headers/build/os/kernel -I ../headers/build/os/interface -I ../headers/build/os/locale -I ../headers/build/os/storage -I ../headers/build/os/support -I ../headers/build/private -o "objects/haiku_host/x86_64/release/build/libroot/driver_settings.o"
...failed C++ objects/haiku_host/x86_64/release/build/libroot/driver_settings.o ...
BUILD FAILURE:
...failed updating 1 target(s)...
...skipped 7 target(s)...
...updated 15 target(s)...

It looks like strchrnul() is not available in my build environment or not exposed by the host libc headers during the build.

I built images many times and didn’t get this error previously.

I see strchrnul on: /boot/system/develop/headers/posix/string.h:47.

Do your haiku and haiku_devel .hpkg versions match?

yes both match
haiku-r1~beta5_hrev57937_113-1-x86_64.hpkg
haiku_devel-r1~beta5_hrev57937_113-1-x86_64.hpkg

I added a workaround to use strchr instead of strchrnul.
I got the same error but with different function memmem().

both of them are outdated (beta5) is already at rev57937+129 for some time, try to run “pkgman full-sync” in Terminal or use SoftwareUpdater to update your system.