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 vTZtEosf314REQAA0tVLHw (envelope-from ) for ; Tue, 09 Jun 2020 05:35:07 +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 2F+rDYsf315CYQAAbx9fmQ (envelope-from ) for ; Tue, 09 Jun 2020 05:35:07 +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 B774F9403E9 for ; Tue, 9 Jun 2020 05:35:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id C4FDB6DE0927; Mon, 8 Jun 2020 22:35:01 -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 UmOGXSsj7i_U; Mon, 8 Jun 2020 22:35:01 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 063F66DE0937; Mon, 8 Jun 2020 22:35:00 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 9A9B26DE0937 for ; Mon, 8 Jun 2020 22:34:57 -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 g4j6IDqfiK6h for ; Mon, 8 Jun 2020 22:34:56 -0700 (PDT) Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) by arlo.cworth.org (Postfix) with ESMTPS id 27D476DE0927 for ; Mon, 8 Jun 2020 22:34:53 -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 D38EC202C5; Tue, 9 Jun 2020 08:34:49 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1591680889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=yntamvH+ymZgiaihLB76ujn5hH2sJxNQVYMGpjKNYK0=; b=MuIFa84MaVZBKXiIKkatdszntrxuOkCESE/Ibzzlk5hEx4ip4OORNiq5kssrVjgrY2nt8g n57nvNJKnvGc217o0oIu9G4Yw8jXeM83DjZERR87IIf1srakbSbWAuQnSQxbUsh4eUXWYx 1BC8lvfSqXfrhy5+9XISR+YYDvrQHKg= From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH] configure: use cffi.FFI().verify() to test buildability of CFFI bindings Date: Tue, 9 Jun 2020 08:34:46 +0300 Message-Id: <20200609053446.11478-1-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.13.3 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1591680889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=yntamvH+ymZgiaihLB76ujn5hH2sJxNQVYMGpjKNYK0=; b=s7qXfvIgIWzjZytVGmsL3mSTIpP2jJTlmffKUI+gH5aMXowE0OjE6AfGT0EFy4gY6mBryH UYgZxkkWunJfjibeOP0rxck3FgraEPZWuPIbAOtUaCj+2qzc5iuMRW/nO+OL0YXCoxN5hI CVImaaW36YPjcsxdq8gmSsS89Z78FBs= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1591680889; a=rsa-sha256; cv=none; b=b9wnqSUZ1qYnBFqmtcwW7TRYxDJ/bbQP/DCBslYFLLsa3p8IpmE1aopV+g2r4uSjcvQEyy TjzOYWC7N9jgjgqarEpHCjYLyk2O4uyqbed8PzHAQ0KaCXuu5RlpNKo8nJxRKionW8Fhnd CC8rbjY866I7R7UUL+22MthtjfocVeY= 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=MuIFa84M; 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: 4.49 X-TUID: YF+I/v2yE74w 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. --- I just could not get this right last time. Probably I concentrated on testing in debian 10 container so much, that the small differences in other systems went unnoticed (had that fedora 32 host polluted by installed python3-devel when doing final tests on that system)... configure | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/configure b/configure index f4b3c61a..d85fe5d2 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,9 +724,9 @@ 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 -- 2.26.2