From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EOjDKniB316TVAAA0tVLHw (envelope-from ) for ; Tue, 09 Jun 2020 12:32:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CLyrJniB317PEwAAbx9fmQ (envelope-from ) for ; Tue, 09 Jun 2020 12:32:56 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 127D8940418 for ; Tue, 9 Jun 2020 12:32:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 6405C6DE0B6D; Tue, 9 Jun 2020 05:32:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HGor4NbLNOMQ; Tue, 9 Jun 2020 05:32:49 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 8C8946DE0BEF; Tue, 9 Jun 2020 05:32:48 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7E3496DE0BEF for ; Tue, 9 Jun 2020 05:32:47 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JQVUv_McYySq for ; Tue, 9 Jun 2020 05:32:45 -0700 (PDT) Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) by arlo.cworth.org (Postfix) with ESMTPS id 1BD7E6DE0B6D for ; Tue, 9 Jun 2020 05:32:43 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by meesny.iki.fi (Postfix) with ESMTPSA id EA33C20175; Tue, 9 Jun 2020 15:32:37 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1591705958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=NWoqtjkTmhNRhu8j8P4rZsBReck2v05pH5ddXrCfmZ8=; b=pHmm8QjUZ+MWyYpvGENc/awl4CtgN0uwxW5AYe/5Obk4cuTZL3iCwBRpsoGLqJA6uccyeg +2GPbrWDN7PIxaKPV3CH73FU4DtkXdishGMtVWrjE118rk6+AKs8Vt5AQ7YfcfW1btMgFZ 3a283PKBsEBWrXE6r/s0s1TeORrZE7Y= From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH v2] configure: use cffi.FFI().verify() to test buildability of CFFI bindings Date: Tue, 9 Jun 2020 15:32:27 +0300 Message-Id: <20200609123227.17330-1-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.13.3 In-Reply-To: <87pna8fqfj.fsf@tethera.net> References: <87pna8fqfj.fsf@tethera.net> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1591705958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=NWoqtjkTmhNRhu8j8P4rZsBReck2v05pH5ddXrCfmZ8=; b=QtFnJBUsdSvq/vhsVjCSrHKtABzSJyHcWq+lt7enG2JNVGN84UIerH4Zk/aGQBHmtrPmGH E8BD8LFEH6qZaIlS23HOURm5gS+8wOP4GchG9qTN8VM+nn8DGMBPmStUp7lqXnI55g/yvJ bpn3Gsk4M6Yt7zUsFR3q3Ucbqq8HHZY= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1591705958; a=rsa-sha256; cv=none; b=fE1Lu/VUcQ873FjD5lIDXf6IUyJ9P7F6+Ll4AKjpHm6o1lz5W50+psSinIZJ2E1p63Y69d 1Xg4t6ZEeQZED4GbMeBMDHi0qJUtnAe7NSUwYEKXl2GS7SCzv1cDeMCR1cipXFyB2gVOGX 23Hs0YQnh5Ma+DNKmjzibh10jNbuzHY= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tomi.ollila@iki.fi MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=iki.fi header.s=meesny header.b=pHmm8QjU; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 2.99 X-TUID: Wo1yGPNQl+Xr Checking existence of pyconfig.h to determine whether CFFI-based notmuch bindings are buildable is not enough; for example Fedora 32 ships pyconfig.h in python3-libs package, but python3-devel is required to be installed for the bindings to build. Executing cffi.FFI().verify() is pretty close to what is done in bindings/python-cffi/notmuch2/_build.py to get the c code part of the bindings built. --- diff to v1: > + rm -rf __pycache__ # cffi.FFI().verify() uses this space fits pretty well w/ pytest $conf removal few lines below configure | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/configure b/configure index f4b3c61a..05ade05b 100755 --- a/configure +++ b/configure @@ -711,14 +711,12 @@ if [ $have_python -eq 0 ]; then errors=$((errors + 1)) fi -have_python3_dev=0 +have_python3=0 if [ $have_python -eq 1 ]; then - printf "Checking for python3 dev (>= 3.5)..." - if "$python" -c 'import os, sys, sysconfig; -assert sys.version_info >= (3,5) -assert os.path.isfile(sysconfig.get_config_h_filename())' >/dev/null 2>&1; then + printf "Checking for python3 (>= 3.5)..." + if "$python" -c 'import sys, sysconfig; assert sys.version_info >= (3,5)'; >/dev/null 2>&1; then printf "Yes.\n" - have_python3_dev=1 + have_python3=1 else printf "No (will not install CFFI-based python bindings).\n" fi @@ -726,14 +724,15 @@ fi have_python3_cffi=0 have_python3_pytest=0 -if [ $have_python3_dev -eq 1 ]; then +if [ $have_python3 -eq 1 ]; then printf "Checking for python3 cffi and setuptools... " - if "$python" -c 'import cffi; import setuptools' >/dev/null 2>&1; then + if "$python" -c 'import cffi,setuptools; cffi.FFI().verify()' >/dev/null 2>&1; then printf "Yes.\n" have_python3_cffi=1 else printf "No (will not install CFFI-based python bindings).\n" fi + rm -rf __pycache__ # cffi.FFI().verify() uses this space printf "Checking for python3 pytest (>= 3.0)... " conf=$(mktemp) -- 2.25.1