From nobody Wed May 15 08:34:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1620984194; cv=none; d=zohomail.com; s=zohoarc; b=KcVGrJI3sNZxpN3cJhBMHfLCbDglLCxjzN0SrIPWte0s/g2C2uGLP3IppfFN2N4Vggwj1nPQAxp5lfIa8PMsOFPVsA1YcJccBt5ukU+t5kvfKVFX8IqXkoTGUYqYDOxlIdntf0Glh+xQQZSxVZGRgDO9Kvl1MdisJyrU/GU5BVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620984194; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=CaGNjA9WQ6lrBNU9+kACRS+BlQN2w9hJamfKSZ95Ym8=; b=Hzm+LbOUBUDpPakEjf46bxWHZHrIUoP8cDKiqImBsYVGLLdm6aihMo/qQbiCEKGoiSCSuetkN06ELPDij6Pttxdfwa+cAs4FddbvvY0nVCGKVvgHW5TL0KaBQq3nQsXoRraMLeESVJhofw1mHLLAcvdOMJwp2VlOfKTqSa4Sao4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1620984194508748.791427626572; Fri, 14 May 2021 02:23:14 -0700 (PDT) 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-506-_prNpF2UOmuXlbZO17zmfA-1; Fri, 14 May 2021 05:23:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 399A2802939; Fri, 14 May 2021 09:22:59 +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 B08FB60BF1; Fri, 14 May 2021 09:22:55 +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 94CCC1806D0E; Fri, 14 May 2021 09:22:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14E9ModZ020755 for ; Fri, 14 May 2021 05:22:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2F06B1971B; Fri, 14 May 2021 09:22:50 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.194.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27A3719C59; Fri, 14 May 2021 09:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620984193; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=CaGNjA9WQ6lrBNU9+kACRS+BlQN2w9hJamfKSZ95Ym8=; b=U8Ja0yevruqnqraj8K2hdgWsPcXuqDjSqiNn6cjTQO0bEhnYrvoBzxEUik1SccXPjHB3QZ Zw/6Q7C/Kk2Xtx73kOTwgtOFycoTiTZMy4IC2ye6xkw2ivhWfiZmudl1m9USThySCNZ9Zn ePbZLARDzKE2bm2rX5eP1ETR7CezOUU= X-MC-Unique: _prNpF2UOmuXlbZO17zmfA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH] meson: Add yajl kludge Date: Fri, 14 May 2021 11:22:42 +0200 Message-Id: <20210514092242.1239666-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: r.bolshakov@yadro.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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" If this looks familiar, that's because it's literally *the same code* that we used to work around *the same issue* in readline before 1635dca26f61def3fbf56c70fbbfe514f2b50987 :) Note that the issue only really affects people building from source on Apple Silicon: on Intel, Homebrew installs header files under directories that are part of the default search path, which explains why our CI pipeline never ran into it. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov --- Roman, can you please test this? Thanks! :) meson.build | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/meson.build b/meson.build index 1f97842319..4f23f9104e 100644 --- a/meson.build +++ b/meson.build @@ -1318,6 +1318,41 @@ endif yajl_version =3D '2.0.3' yajl_dep =3D dependency('yajl', version: '>=3D' + yajl_version, required: = get_option('yajl')) if yajl_dep.found() + # Kludge for yajl include path on non-Linux + # + # As of 2.1.0, upstream yajl.pc has -I${includedir}/yajl among + # its Cflags, which is clearly wrong. This does not affect Linux + # because ${includedir} is already part of the default include path, + # but on other platforms that's not the case and the result is that + # can't be located, causing the build to fail. + # + # Since upstream development for yajl has stopped years ago, there's + # little hope of this issue getting fixed by a new upstream release. + # Some non-Linux operating systems such as FreeBSD have elected to + # carry a small downstream patch, but in the case of Homebrew on + # macOS this approach has been rejected[1] and so we're left with no + # choice but to work around the issue ourselves. + # + # [1] https://github.com/Homebrew/homebrew-core/pull/74516 + if host_machine.system() !=3D 'linux' + pkg_config_prog =3D find_program('pkg-config') + rc =3D run_command(pkg_config_prog, '--cflags', 'yajl', check: true) + cflags =3D rc.stdout().strip() + if cflags.contains('include/yajl') + rc =3D run_command( + 'python3', '-c', + 'print("@0@".replace("@1@", "@2@"))'.format( + cflags, 'include/yajl', 'include', + ), + check: true, + ) + yajl_dep =3D declare_dependency( + compile_args: rc.stdout().strip().split(), + dependencies: [ yajl_dep ], + ) + endif + endif + conf.set('WITH_YAJL', 1) endif =20 --=20 2.26.3