From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +BNCB2uaYGHEcwAAgWs5BA (envelope-from ) for ; Fri, 08 Oct 2021 21:22:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8F8cAmuaYGFbSAAA1q6Kng (envelope-from ) for ; Fri, 08 Oct 2021 19:22:19 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B467531A30 for ; Fri, 8 Oct 2021 21:22:18 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id EE9A120334; Fri, 8 Oct 2021 15:22:13 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id C75161FCE9 for ; Fri, 8 Oct 2021 15:22:11 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 474991B00124; Fri, 8 Oct 2021 22:22:09 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1633720929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/iUAkHLLs0hz9kIcV1aqTfSQhDdqUnHrn5r8xprtibc=; b=mEXxYyYgnKftemlQjQ3Fy+ZWldhrP9DmD6ek7RJ5CWwmi4bwQhC0x9MovjKjumtuneexAK DaZo3DUHG3VlvbJuTxP8BMDYi8mv4mtars42x4d2D3KSxhYcU2hX9EYF8Morg7RiQji9xq jD4cW9xGaRhwM6Gh64gG6TbBtDzJd7GDYkH5DnDGzM14XOjq3snNYSokB99yX5NtdJyLF0 3rFD20opEWtRhIvZUgiNiCkLbIDrHoO0hV2fJV96bTvdRRXr9aVVroutibiqUoc/XFhw5n n4bXZdIiqs6foJrBusyMEg/opx6El+Q0fLkg4qBajOzo3fVg07A80WBYJ5l6sg== From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] configure: check explicitely for python dev (include) files In-Reply-To: <20211007120924.515415-1-david@tethera.net> References: <87im1g35ey.fsf@tethera.net> <20211007120924.515415-1-david@tethera.net> User-Agent: Notmuch/0.33+54~gcaf4513 (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1633720929; a=rsa-sha256; cv=none; b=MqgKDbc59hovoCxbtz676yjlgtDToMi6hw3tliefHlyjQHZFMItwlwSQ07ZmT5yoFwziNA nqSAZ+6RoQlUxMhaL3s+67ypVMNDE3LpN5HOK2FXFDSWIUxcfpZPdeX+05Cj0Lp1biaPje yZQh80BazSy/iUvpY8obsE45SDAU7qoWm7cZcprsCpCdzN0jnR7JLvTcf/RScYQ4aDW8eX DJ/+UKNNd6iZ+o/6KCH7JaErbYZrFAHvMbf6P4LyGki+MuoNRyt0+BYVF6QTu+X7uxRx6d aRSgPOp1z35WVkeCAgaiiOLJmHeJogl8sj37nVccIdSxBqoaeq5ecH+8+GATMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1633720929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/iUAkHLLs0hz9kIcV1aqTfSQhDdqUnHrn5r8xprtibc=; b=blRXAypuJXorqEjUc0j51TIgPpvY798eLWF0JpMW8odXIRJ++Q1FdFj1RhkQ97SfY86s1A 2yZ/TmwH3pmxxKol7Q5GzDxdT8HbmP3F+2YFDo+ZTnRZfGfxXR4HhFdy40jOZjrZ30xz1S LvWOgHeHcsb5XMim083/6zOrtp7f3voFvV6qTh5KfFmWWFvxlYZr3FeREz6+ouEYaHs7ZH Yhv+y8t61K5Vnqqj8wNQet0CD8QNxlU51ojgU7YcLb2HAnKnug121AG2URwdqShqsTLscF M0RvtGQ2MeswuclqMbyktQ/F8BaK0hjqIPLy1N37MHqiwMomBzAfCXJhHhyYrA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi Message-ID-Hash: C7B2XWNPLGKC3SNZIRVPM7KR7O76FFIS X-Message-ID-Hash: C7B2XWNPLGKC3SNZIRVPM7KR7O76FFIS X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633720938; h=from:from: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=qLisZ7F6EkhxzFLpaKGQRLPcquEzV+qGty1+RPRV/aA=; b=SaMTk7lWILUZTfaL+EjluSJbonUc3+YoqvXoz5YWBVELRknAFugg9UkC3ZdqaxZBMlvpC/ 1wxc4g+cHzWyWp4ZcOgdT98aLGiafq61zVPihzF9Lz5/5dWUa+7MTv6HI0BFsTh2f1iWck wlg5yeTDslJLicirpcBEHPXtytQ+dQrrv3X/fnWjvb+VuUdTn9EntGPGvMd9kcjDXEtp5h WJb+tt216Wg2AAQnLsnZB+OX9cgbMQgjuYnmk0g3SUWRQT6yoZWA5HeFgukdkEDov3zS/X y6Ye+C1u6aSSX8s6/lsRwStgONbGF/TtEgfN27Nqbnl2j0U1fGto9r1iHXUlSg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1633720938; a=rsa-sha256; cv=fail; b=o/3kti+K0qdBWwtYr12UBoNO8MQVvpN8dH7pRJolJqDdJB4TS1NoW7LCvOyogHfcnCMQPG M+bbtrPDO4UoMDCn3Uwg7PiJwaggjv6TiXfZI2zM5XHAQL8Hl5CHP5aq4BTwUo4ALhLna9 VSayfzrTFqcv3MMxDiWDX2hOojX3oSRJBJ4v2TK7FIh+iC4uKcUuyKjICalQ1VRl8Ia8Ne XyTpze07K6nAnC4acXnORAE5S7N04G860pcetdnnx9qx+RtZ6V7FsmsUKQJ07z+wGkm/wm 16sP6Z5XpEuMDnEJkKvAJKyB4/kbLA2d9M3x13Y7rZp2yvMwejbYC7PokTACRw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=mEXxYyYg; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=mEXxYyYg; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: B467531A30 X-Spam-Score: 0.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: UO1qup94NSFO On Thu, Oct 07 2021, David Bremner wrote: > As discussed at [1] we have received reports that the implicit check > using cffi.FFI().verify() is not reliable in all environments. Since > we already use pkg-config, and the python dev package should include a > .pc file [2], add an extra check using pkg-config. On at least > Debian, we have to know which version of python dev files with are > looking for, so calculate that first. > > [1]: id:87im1g35ey.fsf@tethera.netid:87im1g35ey.fsf@tethera.net, > [2]: checked on Debian and Fedora > --- > configure | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/configure b/configure > index 4262d122..fc9512f9 100755 > --- a/configure > +++ b/configure > @@ -777,7 +777,23 @@ fi > > have_python3_cffi=0 > have_python3_pytest=0 Works and look good (but some style mismatches) -- but move the whole added block before the 2 variables set abobe to zero -- those does not need to be defined before the code below is executed and it is more consistent that way... > +have_python3_dev=0 > if [ $have_python3 -eq 1 ]; then > + printf "Checking for python3 version ..." ----------- extra space here -------------^ > + python3_version=$("$python" -c 'import sysconfig; print(sysconfig.get_python_version());') > + printf "(%s)\n" $python3_version > + > + printf "Checking for python $python3_version development files..." > + if pkg-config --exists "python-$python3_version"; then > + have_python3_dev=1 > + printf "Yes.\n" > + else > + have_python3_dev=0 > + printf "No (will not install CFFI-based python bindings).\n" --- tabs vs spaces difference above (use only spaces above for local consistency) --- > + fi > +fi ...i.e. the lines 'have_python3_cffi=0' and 'have_python3_pytest=0' to appear here > + > +if [ $have_python3_dev -eq 1 ]; then > printf "Checking for python3 cffi and setuptools... " > if "$python" -c 'import cffi,setuptools; cffi.FFI().verify()' >/dev/null 2>&1; then > printf "Yes.\n" > -- > 2.33.0 Tomi