Make libvfio-user build reliable on ninja < 1.9
Sadly, before v1.9.0, ninja used per-second granularity timestamps. This had the unfortunate consequence that a "meson configure" immediately following a "meson setup" would not be picked up by ninja, thinking that no regeneration of the build config was needed during "meson compile". See https://github.com/mesonbuild/meson/issues/3992 for background and general dismay. This means that VFIO_USER_CFG_OPTS are ignored 50% of the time, depending on the wall clock. Unlucky builds would therefore end up with libvfio-user being built as a shared object (rather than a static archive) and for installation in /usr/local/lib64 (rather than /usr/local/lib, as per VFIO_USER_LIB_PREFIX). This is worked around by injecting a sleep between "meson setup" and "meson configure" when ninja < 1.9 is in use. Note that ninja v1.8.2 ships in el8, so suffers from this problem. Signed-off-by: Jonathan Davies <jonathan.davies@nutanix.com> Change-Id: I4d555dcc5bc63df4475ec6fd6014e3502123e92b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14236 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: John Levon <levon@movementarian.org> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
51a8f16e72
commit
510f4c134a
@ -19,6 +19,9 @@ all: scan-build
|
||||
build:
|
||||
$(Q)test -d $(VFIO_USER_BUILD_DIR) || \
|
||||
CC=$(SUB_CC) meson setup $(VFIO_USER_BUILD_DIR) $(VFIO_USER_SRC_DIR)
|
||||
# Work around pre-v1.9 versions of ninja ignoring new configuration.
|
||||
$(Q)[ $$((ninja --version; echo 1.9) | sort --version-sort | head -n 1) \
|
||||
= 1.9 ] || sleep 0.5
|
||||
$(Q)meson configure $(VFIO_USER_BUILD_DIR) $(VFIO_USER_CFG_OPTS)
|
||||
$(Q)meson compile $(MESON_COMPILE_OPTS) -C $(VFIO_USER_BUILD_DIR)
|
||||
DESTDIR=$(VFIO_USER_INSTALL_DIR) meson install --quiet -C $(VFIO_USER_BUILD_DIR)
|
||||
|
Loading…
Reference in New Issue
Block a user