Draft: Disable overly parallell processing in build
Builds are seen to fail, usually or arm machines, with below type errors:
[ 114s] FAILED: src/udev/3eb56e7@@scsi_id@exe/scsi_id_scsi_id.c.o
[ 114s] cc -Isrc/udev/3eb56e7@@scsi_id@exe -Isrc/udev -I../src/udev -Isrc/basic -I../src/basic -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/libudev -I../src/libudev -Isrc/core -I../src/core -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -I. -I../ -flto -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIE -DLOG_REALM=LOG_REALM_UDEV -MD -MQ 'src/udev/3eb56e7@@scsi_id@exe/scsi_id_scsi_id.c.o' -MF 'src/udev/3eb56e7@@scsi_id@exe/scsi_id_scsi_id.c.o.d' -o 'src/udev/3eb56e7@@scsi_id@exe/scsi_id_scsi_id.c.o' -c ../src/udev/scsi_id/scsi_id.c
[ 114s] In file included from ../src/udev/scsi_id/scsi_id.c:21:
[ 114s] ../src/basic/build.h:4:10: fatal error: version.h: No such file or directory
[ 114s] #include "version.h"
[ 114s] ^~~~~~~~~~~
[ 114s] compilation terminated.
and
[ 114s] FAILED: src/core/2ac6ece@@core@sta/dbus-manager.c.o
[ 114s] cc -Isrc/core/2ac6ece@@core@sta -Isrc/core -I../src/core -Isrc/basic -I../src/basic -Isrc/shared -I../src/shared -Isrc/systemd -I../src/systemd -Isrc/journal -I../src/journal -Isrc/journal-remote -I../src/journal-remote -Isrc/nspawn -I../src/nspawn -Isrc/resolve -I../src/resolve -Isrc/timesync -I../src/timesync -I../src/time-wait-sync -Isrc/login -I../src/login -Isrc/udev -I../src/udev -Isrc/libudev -I../src/libudev -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/libsystemd-network -I../src/libsystemd-network -I. -I../ -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -flto -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wextra -Werror=undef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wimplicit-fallthrough=5 -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Werror=overflow -Werror=shift-count-overflow -Werror=shift-overflow=2 -Wdate-time -Wnested-externs -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Wno-error=nonnull -Wno-maybe-uninitialized -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -ffunction-sections -fdata-sections -Werror=shadow -include config.h -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -pthread -MD -MQ 'src/core/2ac6ece@@core@sta/dbus-manager.c.o' -MF 'src/core/2ac6ece@@core@sta/dbus-manager.c.o.d' -o 'src/core/2ac6ece@@core@sta/dbus-manager.c.o' -c ../src/core/dbus-manager.c
[ 114s] In file included from ../src/core/dbus-manager.c:10:
[ 114s] ../src/basic/build.h:4:10: fatal error: version.h: No such file or directory
[ 114s] #include "version.h"
[ 114s] ^~~~~~~~~~~
[ 114s] compilation terminated.
and many more like these.
While the code that generates the version.h file, out of the version.h.in file, is very basic.
The real problem lies in the overly parallelly processed build config. For example, on the mahcine where the above errors are seen (which is an arm64 build machine):
[ 112s] dh_auto_build --builddirectory=build-deb
[ 113s] cd build-deb && LC_ALL=C.UTF-8 ninja -j160 -v
160 jobs is an insanely high number for standard machines.
OTOH, on x86, where the builds have succeeded, we have:
[ 195s] dh_auto_build --builddirectory=build-deb
[ 196s] cd build-deb && LC_ALL=C.UTF-8 ninja -j3 -v
which looks right.
While this may be a bug in ninja
, as a rule thumb, this proposed check
on parallellism should be a good gatekeeper to not allow such issues to
surface.
Signed-off-by: Ritesh Raj Sarraf ritesh.sarraf@collabora.com