From nobody Mon May 6 22:08:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582555388; cv=none; d=zohomail.com; s=zohoarc; b=TLdGmXbr4SyFVcLLhevlOC1h0UipjA1JkCndrOEg74KXwNYiKI/Eaq2RfI1IqzR/xA7xenppMH2QNqrhkWem9vcCfco98NphgRTOfKV7CB2nYdFnUCjBhoYQjR3+pkBUvFLvUJ3n6HK7KB84l+9wxUSKho0yFq77AE+l5sINFA0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582555388; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=xtt6zmXysmi0TBDWXw4HIJ4Cvby2GPMvYUarAXwjEqw=; b=ewue6vt2lZ22R57cgx/cvXUAaxq+aFNv4g2kJr3Gpy1hQOpv/utAjKb/bZ7NM3kU8ePzfJdz61b32tWU5fUrDEX8Jn5AyzlG1S0opPbDxNPYDE7xqUxB9GWZa45Uc/CqXkC+6jwowwGcpRb4S3Re8IakHJweL8Aau78JEm1l53E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1582555388070494.7382718915194; Mon, 24 Feb 2020 06:43:08 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-sx3nZShCNpOa3v19BGZ0SA-1; Mon, 24 Feb 2020 09:43:04 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4069B100550E; Mon, 24 Feb 2020 14:42:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CE1B25C114; Mon, 24 Feb 2020 14:42:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EA66418089C8; Mon, 24 Feb 2020 14:42:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01OEgsT0024328 for ; Mon, 24 Feb 2020 09:42:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9B5FA60BF7; Mon, 24 Feb 2020 14:42:54 +0000 (UTC) Received: from kinshicho.usersys.redhat.com (ovpn-205-234.brq.redhat.com [10.40.205.234]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81C1460BF3 for ; Mon, 24 Feb 2020 14:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582555386; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xtt6zmXysmi0TBDWXw4HIJ4Cvby2GPMvYUarAXwjEqw=; b=e1UY3Nz5ImMUb8fSLtEZikLbusa9uWejCTiRJPArGoBbugTU4CH1OrLSnILX5nik2Xmq9F q6KMOh3DebuPq3ZvSxT/GPF0BDEIaOKdkZ+JTGICfxJb0ka22ynqpEDxTJxpuToyZBr5NZ 6SFJcM7fGagZ46giEKoQSU7SH5jZZ7E= X-MC-Unique: sx3nZShCNpOa3v19BGZ0SA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH] ci: Fix handling of $PKG_CONFIG_LIBDIR Date: Mon, 24 Feb 2020 15:42:46 +0100 Message-Id: <20200224144246.174361-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 --- Pushed as a CI fix. ci/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/Makefile b/ci/Makefile index 03799924b4..577b130d2f 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -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=3D"PKG_CONFIG_LIBDIR=3D$$PKG_CONFIG_LIBDIR"; \ + fi; \ sudo \ --login \ --user=3D"#$(CI_UID)" \ --group=3D"#$(CI_GID)" \ CONFIGURE_OPTS=3D"$$CONFIGURE_OPTS" \ - PKG_CONFIG_LIBDIR=3D"$$PKG_CONFIG_LIBDIR" \ + $$pkgconfig_env \ CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)" \ CI_CONT_BUILDDIR=3D"$(CI_CONT_BUILDDIR)" \ CI_SMP=3D"$(CI_SMP)" \ --=20 2.24.1