提交 058b30b3 编写于 作者: A Andrea Bolognani

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: 71517ae4Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
上级 c95656c9
...@@ -216,12 +216,15 @@ ci-run-command@%: ci-prepare-tree ...@@ -216,12 +216,15 @@ ci-run-command@%: ci-prepare-tree
$(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \ $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \
/bin/bash -c ' \ /bin/bash -c ' \
$(CI_USER_HOME)/prepare || exit 1; \ $(CI_USER_HOME)/prepare || exit 1; \
if test "$$PKG_CONFIG_LIBDIR"; then \
pkgconfig_env="PKG_CONFIG_LIBDIR=$$PKG_CONFIG_LIBDIR"; \
fi; \
sudo \ sudo \
--login \ --login \
--user="#$(CI_UID)" \ --user="#$(CI_UID)" \
--group="#$(CI_GID)" \ --group="#$(CI_GID)" \
CONFIGURE_OPTS="$$CONFIGURE_OPTS" \ CONFIGURE_OPTS="$$CONFIGURE_OPTS" \
PKG_CONFIG_LIBDIR="$$PKG_CONFIG_LIBDIR" \ $$pkgconfig_env \
CI_CONT_SRCDIR="$(CI_CONT_SRCDIR)" \ CI_CONT_SRCDIR="$(CI_CONT_SRCDIR)" \
CI_CONT_BUILDDIR="$(CI_CONT_BUILDDIR)" \ CI_CONT_BUILDDIR="$(CI_CONT_BUILDDIR)" \
CI_SMP="$(CI_SMP)" \ CI_SMP="$(CI_SMP)" \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册