From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sOaaGarjXmExVgEAgWs5BA (envelope-from ) for ; Thu, 07 Oct 2021 14:10:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SD5GFarjXmH0YwAA1q6Kng (envelope-from ) for ; Thu, 07 Oct 2021 12:10:18 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (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 B184C2FFC3 for ; Thu, 7 Oct 2021 14:10:17 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id AA6C226DE5; Thu, 7 Oct 2021 08:10:11 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 9A65126D91 for ; Thu, 7 Oct 2021 08:10:08 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 386245FD5C; Thu, 7 Oct 2021 08:10:08 -0400 (EDT) Received: (nullmailer pid 515431 invoked by uid 1000); Thu, 07 Oct 2021 12:10:06 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH] configure: check explicitely for python dev (include) files Date: Thu, 7 Oct 2021 09:09:24 -0300 Message-Id: <20211007120924.515415-1-david@tethera.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <87im1g35ey.fsf@tethera.net> References: <87im1g35ey.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 6MSPLZG66QSL3KA4S773FSQQHN3R2ZS5 X-Message-ID-Hash: 6MSPLZG66QSL3KA4S773FSQQHN3R2ZS5 X-MailFrom: bremner@tethera.net 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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633608617; 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; bh=tDOCi9e1eX8vqRV/t+dCEW8dr27sdsg78DaVx65Y+ao=; b=DPTxoXqFtQZv624lHz1989d7V64KiaX/YZDulTMuWsCWDTSow0rsFcMOlXcx5SRnGOv0e1 7hnHEMVV7ps0KjWfkrt7n56IToACUOXc94V3Jh/U0iDUmrWzdpcpTG8Wtjw+1Y6SIn3IEg CGhu/poekc1TkSnUdo7WYC0gdLnf4rfXkxou8Tz4VPWT4TqrrpSwPOMc4xsd+b3biqz7hO v0v33Sbg8r0MfiT9vBUXLSCyFaIsPZSf8gNQ3lTQfWmnQnjj58ftznM09wwXMjWqyF3OyT J5r0A6t01UDFiLKbYnWpZS5o338MaC5QU7SMT8RgtBuiHDwA47fVOeDyZB7Bxw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633608617; a=rsa-sha256; cv=none; b=g3qmIFnhk1sjfDRD3ofkY1Ea+ohOppj5iKNzPpJ/XXkxj0RJOXDzOvZXp1TiZ/C8oBFGwq YJ4oerY/4rZwJRzXwPB0YjQiPjCYECHEQYQ5oUA+BQSRUTZEeECBoI4MfThuNCI+5Me+AM 0xR66cV49AasSASZDpMIWT7a5SWanTEgPQk51m8p0qmxn2CL05ScwX7KJHgRg/yTxqYadm DW0DtmjhWuJZeJx7cGFqO3MFHZU2liDIMA+Btg+zNscqHe3LjNEvAtu/qaUklZ0HQkINk1 dx1nypqtAtFKm0reK606/hJRBI1U/lT220FJT4cPBLlz3br3Ed7WAXK2kwfqDg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.19 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: B184C2FFC3 X-Spam-Score: -1.19 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5bKAQw1ed4Q/ 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 +have_python3_dev=0 if [ $have_python3 -eq 1 ]; then + printf "Checking for python3 version ..." + 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" + fi +fi + +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