From nobody Thu May 2 16:00:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1614698243; cv=none; d=zohomail.com; s=zohoarc; b=UZm8rsQp3LtPEH1TyuUG070wznG1aoemvzKd6nUfa9ysw9iP5ktQNEtdJ8RNziQGReVWSva1+NppGlscgAVVmaGsxtS3c/20W9OExjcb689+kgusbg7srnPK/7xGCUE0z3YLBKoM29titUOMKp56bZj+7CwV7cs5KU0yhgNLMmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614698243; 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=rpP9Fgo2Ew73ZM6qLQIfYaHetPOzrzf0cKnKInrnQGA=; b=Lw/8qhIhGmjV/iA4e3PLpWlFEnZDKOczwFDvmXaH2UiDycqOFVd1k4I/fKzWMg0qxpnIfY54/cz2PhhtJ/y3lvoXqwrXiSbs68s+yivoio2pXDA0p1xQmlF3laid6je/aT8lskdebIhu8gE5+8p1Xg6TT5hC3D/DiwfmJ1xpBNw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614698243868303.33234110107185; Tue, 2 Mar 2021 07:17:23 -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-179-udYp3-bCMPeQ4TSFxfMbIg-1; Tue, 02 Mar 2021 10:17:18 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 55CB5107ACE3; Tue, 2 Mar 2021 15:17:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCBF810023B0; Tue, 2 Mar 2021 15:17:11 +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 1A1FA50033; Tue, 2 Mar 2021 15:17:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122FH5lK017239 for ; Tue, 2 Mar 2021 10:17:05 -0500 Received: by smtp.corp.redhat.com (Postfix) id AC758107291; Tue, 2 Mar 2021 15:17:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A73F1107290 for ; Tue, 2 Mar 2021 15:17:03 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 74FBB85A59D for ; Tue, 2 Mar 2021 15:17:03 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-529-AusXk3FrPa61UyKm9Sqydw-1; Tue, 02 Mar 2021 10:16:58 -0500 Received: by mail-lf1-f50.google.com with SMTP id z11so31774187lfb.9 for ; Tue, 02 Mar 2021 07:16:57 -0800 (PST) Received: from kloomba.my.domain ([31.29.246.181]) by smtp.gmail.com with ESMTPSA id y23sm796024ljm.53.2021.03.02.07.16.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 07:16:55 -0800 (PST) X-MC-Unique: udYp3-bCMPeQ4TSFxfMbIg-1 X-MC-Unique: AusXk3FrPa61UyKm9Sqydw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rpP9Fgo2Ew73ZM6qLQIfYaHetPOzrzf0cKnKInrnQGA=; b=rkf6Ij3NCfFdpt4z6DOBtanO53CPPnfPXJTI3EIu55zaH9euNPboEWmnvlSvzvI+T8 YTP7yTlbXIqFrs74Fls+gwn9sClcVhxVwLrJUCiVHIvmDCcFCKpA2zdj9ceI9ujkwuW0 RDh0Uq03aVDL258hsHKuoF5EYDmHXpgWtxMPddCRnYwQ1iV+7F3gY5QeRYv0LA/YSgLv y3kWV1BsKPrRfEZppVWDlTUhdHHZdGMh5/f2DsJQA37ZW+vUh7XjhzKZ+CdCmi4s+eX2 1aLx67WDfcOpOhxW7vd7nHG/6mvX0ImXfll9TahKaWtv7vpg//Qoh79uN0N4KTm2ptEV qfWA== X-Gm-Message-State: AOAM532mbRQPtxatakJPUbfU/KFszFQDqf954nn9nVsm9/yRW5XPvFgp gNlnWcmoX/ioa+lEXyWoDKGSoLqpkOeg6w== X-Google-Smtp-Source: ABdhPJyeb3aK//3Fbf7vOTjEMjlzVmKIDt2W3tkEJ697pO023D9+GilFkgBMPeOKZgLZ+qKrO6QUCw== X-Received: by 2002:a05:6512:398e:: with SMTP id j14mr13521631lfu.9.1614698216085; Tue, 02 Mar 2021 07:16:56 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Subject: [PATCH] build-aux: require GNU grep on FreeBSD Date: Tue, 2 Mar 2021 19:16:49 +0400 Message-Id: <20210302151649.10940-1-bogorodskiy@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Roman Bogorodskiy 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.84 on 10.5.11.22 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 Content-Type: text/plain; charset="utf-8" FreeBSD 13.x and newer ship BSD grep which apparently has some performance issues causing certain syntax check tests to run longer than the default 30 seconds timeout used by meson. However, GNU grep is still available through the textproc/gnugrep port, so require it on FreeBSD if /usr/bin/grep is a BSD grep to make checks pass in a reasonable time. Signed-off-by: Roman Bogorodskiy Reviewed-by: J=C3=A1n Tomko --- build-aux/Makefile.in | 1 + build-aux/meson.build | 24 +++++++++++++++++++----- build-aux/syntax-check.mk | 1 - 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/build-aux/Makefile.in b/build-aux/Makefile.in index 0424ff39fc..415a8df305 100644 --- a/build-aux/Makefile.in +++ b/build-aux/Makefile.in @@ -5,6 +5,7 @@ top_builddir =3D @top_builddir@ FLAKE8 =3D @flake8_path@ RUNUTF8 =3D @runutf8@ PYTHON =3D @PYTHON3@ +GREP =3D @GREP@ =20 # include syntax-check.mk file include $(top_srcdir)/build-aux/syntax-check.mk diff --git a/build-aux/meson.build b/build-aux/meson.build index c506feefd2..c44ed6821c 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -10,18 +10,32 @@ syntax_check_conf.set('flake8_path', flake8_path) syntax_check_conf.set('runutf8', ' '.join(runutf8)) syntax_check_conf.set('PYTHON3', python3_prog.path()) =20 -configure_file( - input: 'Makefile.in', - output: '@BASENAME@', - configuration: syntax_check_conf, -) + +grep_prog =3D find_program('grep') =20 if host_machine.system() =3D=3D 'freebsd' make_prog =3D find_program('gmake') + + grep_cmd =3D run_command(grep_prog, '--version') + if grep_cmd.stdout().startswith('grep (BSD grep') + grep_prog =3D find_program('/usr/local/bin/grep') + grep_cmd =3D run_command(grep_prog, '--version') + if grep_cmd.stdout().startswith('grep (BSD grep') + error('GNU grep not found') + endif + endif else make_prog =3D find_program('make') endif =20 +syntax_check_conf.set('GREP', grep_prog.path()) + +configure_file( + input: 'Makefile.in', + output: '@BASENAME@', + configuration: syntax_check_conf, +) + rc =3D run_command( 'sed', '-n', 's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p', diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index e51877648a..6f6603fa6f 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -27,7 +27,6 @@ ME :=3D build-aux/syntax-check.mk # of the module description. But some packages import this file directly, # ignoring the module description. AWK ?=3D awk -GREP ?=3D grep # FreeBSD (and probably some other OSes too) ships own version of sed(1), = not # compatible with the GNU sed. GNU sed is available as gsed(1), so use this # instead --=20 2.30.0