mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-30 16:35:24 +00:00
ci: Fix handling of $PKG_CONFIG_LIBDIR
There are two environment variables that are baked into our cross-compilation container images at build time, $CONFIGURE_OPTS and $PKG_CONFIG_LIBDIR: the former contain the options necessary to convince configure to perform a cross build rather than a native one, and the latter is necessary so that pkg-config will locate the .pc files for MinGW libraries. Container images that are not intended for cross-compilation will not have either one defined. The problem is that, while an empty $CONFIGURE_OPTS is completely harmless, setting $PKG_CONFIG_LIBDIR to an emtpy value will result in pkg-config not looking in its default search path, thus not finding any library, and subsequently breaking native builds. To work around this issue, only pass $PKG_CONFIG_LIBDIR to sudo when the value is set in the calling environment. Fixes: 71517ae4db35c4dcc6c358d60d3a6d5da0615d39 Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
c95656c995
commit
058b30b382
@ -216,12 +216,15 @@ ci-run-command@%: ci-prepare-tree
|
||||
$(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \
|
||||
/bin/bash -c ' \
|
||||
$(CI_USER_HOME)/prepare || exit 1; \
|
||||
if test "$$PKG_CONFIG_LIBDIR"; then \
|
||||
pkgconfig_env="PKG_CONFIG_LIBDIR=$$PKG_CONFIG_LIBDIR"; \
|
||||
fi; \
|
||||
sudo \
|
||||
--login \
|
||||
--user="#$(CI_UID)" \
|
||||
--group="#$(CI_GID)" \
|
||||
CONFIGURE_OPTS="$$CONFIGURE_OPTS" \
|
||||
PKG_CONFIG_LIBDIR="$$PKG_CONFIG_LIBDIR" \
|
||||
$$pkgconfig_env \
|
||||
CI_CONT_SRCDIR="$(CI_CONT_SRCDIR)" \
|
||||
CI_CONT_BUILDDIR="$(CI_CONT_BUILDDIR)" \
|
||||
CI_SMP="$(CI_SMP)" \
|
||||
|
Loading…
x
Reference in New Issue
Block a user