From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sKzYMxrkEmHiKgEAgWs5BA (envelope-from ) for ; Tue, 10 Aug 2021 22:39:54 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id iGOjLxrkEmEvBAAA1q6Kng (envelope-from ) for ; Tue, 10 Aug 2021 20:39:54 +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 615A3A6FE for ; Tue, 10 Aug 2021 22:39:54 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 884CA291A2; Tue, 10 Aug 2021 16:39:48 -0400 (EDT) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by mail.notmuchmail.org (Postfix) with ESMTPS id 45207291A1 for ; Tue, 10 Aug 2021 16:39:46 -0400 (EDT) Received: by mail-ed1-x535.google.com with SMTP id by4so68796edb.0 for ; Tue, 10 Aug 2021 13:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version; bh=MUJ9Jwhdw3Gbt5+ZiivWg0I44ceAVCOofq9r6Y8GKKo=; b=dQdLJO7eU09ZBJBWgIaxOHLY3T1KXVXG3P8rWOLDL1RNYruJ4CseCBGd85ibSzkQeu 60ExsrCmhxn8Nra+LOXh+WadrG3afmFZwsCG9cXgCiwP/A0fKQXpXvQqiNqL7QWbKNuF mmR35kt44uCORz57JErKk90jaRjTY6xkIBuZc34nQ8ACWQMxZKSIi9AOuDobwhj+0Cvs eyST0+GrxtT/7qPDuMtDqysvdF30o02OsfkrpyDcExeTJ9cBnR/KFxKSJ67S+m28fSjP 75iFvYr3ZoVB6QR1TAnOB0swyjnGau/Gcx1asI+zGFuGVxNvZAtCKGIrxgDccqHUTPdb yMWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:in-reply-to:references :date:message-id:mime-version; bh=MUJ9Jwhdw3Gbt5+ZiivWg0I44ceAVCOofq9r6Y8GKKo=; b=oubIl6uRthpgQMsj1x3i6g0k1kw0chXeAD3lV5vNHAdtg7OoYB8spYr4mq+YQaPanb gb+lx6CCfDtibSNhER0F+Ca778jmFtr0jFNY4ieOvokai4ZSjTwKPUqcIz4HhmzPw6wG 5nlCXKwbmPWakNxSFszM1zi9joVlpMNJpJvRbBPZhEU7+UURy7WZjNkonT/zkaSbQrXB XLO1a8kmumV9Q/aHCJBooEqhGb2Q9y9GGbh6PTtb0Ysi73CAqvRsD/ZuB+acX6K0Kuqk uq4AoxJZR0eCkSeSMMc3JtyA9ywjqKlMmmIuimg0Ik2BIp86kKKcicRsGuQz3awoC3v2 Yi9g== X-Gm-Message-State: AOAM530qS6rImNfpU6yzDbuEVrnvG+Zi/0AQ1MjJ2CO3jKowsaDo+nfL ARK3ZiokZoXK61b3RMOhuNM= X-Google-Smtp-Source: ABdhPJyybwyEvofkWE9IUmdkkOUMHmEsXBzYwZIEbqKrSNQn8QatJKSWahX6Szul1scp1/PMtwzdGw== X-Received: by 2002:a05:6402:2789:: with SMTP id b9mr7081634ede.44.1628627984429; Tue, 10 Aug 2021 13:39:44 -0700 (PDT) Received: from powell.devork.be (94-225-149-239.access.telenet.be. [94.225.149.239]) by smtp.gmail.com with ESMTPSA id df14sm10073932edb.90.2021.08.10.13.39.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 13:39:43 -0700 (PDT) Sender: Floris Bruynooghe Received: (nullmailer pid 78291 invoked by uid 1000); Tue, 10 Aug 2021 20:39:40 -0000 From: Floris Bruynooghe To: David Bremner , notmuch@notmuchmail.org Subject: Re: [Tomi Ollila] [RFC PATCH] python-cffi out-of-tree build In-Reply-To: <87a6m015ys.fsf@tethera.net> References: <20210217213600.10268-1-tomi.ollila@iki.fi> <87a6m015ys.fsf@tethera.net> Date: Tue, 10 Aug 2021 22:39:40 +0200 Message-ID: <87wnotvxtf.fsf@powell.devork.be> MIME-Version: 1.0 Message-ID-Hash: 24VUR66D3PQS43MLU4TOTMR2UFNRBSP7 X-Message-ID-Hash: 24VUR66D3PQS43MLU4TOTMR2UFNRBSP7 X-MailFrom: floris.bruynooghe@gmail.com 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=1628627994; h=from:from:sender:sender: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=jAH7Bcf7Zsda3kzY467/Iqy2AE8T4jrxKkxIhXIBv2o=; b=R2rfCxVpxqec4y/YR5VqageXf9v6Nzy/dh5MQsxPyQ3XDWlaPvGk1FakCKc5Iw9NQ/CTqN mpm+SbH/deLU3NFYvtPQsJfPz7XLz632OS8dNeKr+eVNPXjOUh2UoKJc+YF5MytREcNBMV g3aJ91fHIH7EBf9NCKBcFgTtImXiidcmDe/EHMrWtbtokSdIGP82VE+yrjwTOhVtZGktg7 fXv7MM5uwW1icqpr5R22DYBQurl5GvvrKJQHhgVT2ZpOpUVUsY8ZkPNxbikx3dm8zQK2Q2 SlwqgIbTdz7mH4UTJ1uB0pldjNBjf+/qVqpeVGm3oBjqMhuI/4xheCm6/CfaEg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628627994; a=rsa-sha256; cv=none; b=jMmILlnKMks/2ZPzH2goyB81tXfDDfpzBuN0IgdNI4jObMws1Tprj4RzS4bdGuwBz2oY+W 5/nlVdE3cnBORXP2AXZiq1ojkZW+TULAwlolkO1R3URyjfCGFPZcf16QSdX+7ityaBr9JD kdWV5Y9FVGZp+nG2oXSgzi+2ykaNAygxtRXF3eIZUQ190+FH1yzHP4CtjLml33i2fEymUi IcOKRBt1Hrt4YtPRTgX5wE6xy1gmhb25/igqmYY/45OAsiT4/egpFUCDCSKSSikAdsDPKr zccZVSWXz3PlF3AsImaCrHSxLBSoflHi2OQ9kT6GkjmLAisiTBmI426CGXgVLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=dQdLJO7e; 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: -0.95 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=dQdLJO7e; 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: 615A3A6FE X-Spam-Score: -0.95 X-Migadu-Scanner: scn1.migadu.com X-TUID: hKsTb7/jHErM Hi David, everyone, I had a vague recollection of reading from a single version file before and indeed, looking through annotations it seems commit 3a42abb456893b71b530f099a1467400f2b0ea71 changed this. Seems the concern was that "pip install ." didn't work. So perhaps that's something else to check? And err... thanks for your patience. I know this is really slow! Cheers, Floris On Mon 02 Aug 2021 at 07:44 -0300, David Bremner wrote: > Any thoughts on this one? > From: Tomi Ollila > Subject: [RFC PATCH] python-cffi out-of-tree build > To: notmuch@notmuchmail.org > Cc: tomi.ollila@iki.fi > Date: Wed, 17 Feb 2021 23:36:00 +0200 > > setup.py and _build.py to refer some other files based on directory > where setup.py is located (os.path.dirname(sys.argv[0]). > > Dropped bindings/python-cffi/version.txt and refer ../../version.txt > instead -- _build.py already refers ../../lib so why have version.txt > twice (with identical content). > > Dropped copying of bindings/python-cffi source files to the build > directory bindings/python-cffi in configure. > > --- > > an RFC alternative to id:20210215215410.28668-1-tomi.ollila@iki.fi > > I really don't know how this should be done... do they even in e.g. > https://github.com/pypa/pip/issues/7555 ? > > Tested to work in in-tree build, and out-of-tree builds referencing > .../notmuch/configure with absolute and relative paths, and all > 3 builds worked. > > When doing out-of-tree build, only _capi.abi3.so appeared in > bindings/python-cffi/build/stage/notmuch2/ -- in case of in-tree > build all the notmuch2/*.py source files also got copied there... > > ... I tried this changei in setup.py: > . - packages=setuptools.find_packages(exclude=['tests']) > . + packages=setuptools.find_packages(dn0, exclude=['tests']) > but then build broke. > > bindings/Makefile.local | 5 +++-- > bindings/python-cffi/notmuch2/_build.py | 6 +++++- > bindings/python-cffi/setup.py | 9 +++++++-- > bindings/python-cffi/version.txt | 1 - > configure | 4 ---- > 5 files changed, 15 insertions(+), 10 deletions(-) > delete mode 100644 bindings/python-cffi/version.txt > > diff --git a/bindings/Makefile.local b/bindings/Makefile.local > index bc960bbc..d5c70bff 100644 > --- a/bindings/Makefile.local > +++ b/bindings/Makefile.local > @@ -15,9 +15,10 @@ endif > > python-cffi-bindings: lib/$(LINKER_NAME) > ifeq ($(HAVE_PYTHON3_CFFI),1) > + test '$(srcdir)' = . && bdir=. || bdir='$(NOTMUCH_SRCDIR)/$(dir)/python-cffi'; \ > cd $(dir)/python-cffi && \ > - ${PYTHON} setup.py build --build-lib build/stage && \ > - mkdir -p build/stage/tests && cp tests/*.py build/stage/tests > + ${PYTHON} "$$bdir"/setup.py build --build-lib build/stage && \ > + mkdir -p build/stage/tests && cp "$$bdir"/tests/*.py build/stage/tests > endif > > CLEAN += $(patsubst %,$(dir)/ruby/%, \ > diff --git a/bindings/python-cffi/notmuch2/_build.py b/bindings/python-cffi/notmuch2/_build.py > index f67b4de6..ad585d21 100644 > --- a/bindings/python-cffi/notmuch2/_build.py > +++ b/bindings/python-cffi/notmuch2/_build.py > @@ -1,5 +1,9 @@ > import cffi > > +import os > +import sys > + > +dn0 = os.path.dirname(sys.argv[0]) > > ffibuilder = cffi.FFI() > ffibuilder.set_source( > @@ -16,7 +20,7 @@ ffibuilder.set_source( > #ERROR libnotmuch version < 5.1 not supported > #endif > """, > - include_dirs=['../../lib'], > + include_dirs=[dn0 + '/../../lib'], > library_dirs=['../../lib'], > libraries=['notmuch'], > ) > diff --git a/bindings/python-cffi/setup.py b/bindings/python-cffi/setup.py > index cda52338..5884944b 100644 > --- a/bindings/python-cffi/setup.py > +++ b/bindings/python-cffi/setup.py > @@ -1,6 +1,11 @@ > import setuptools > > -with open('version.txt') as fp: > +import os > +import sys > + > +dn0 = os.path.dirname(sys.argv[0]) > + > +with open(dn0 + '/../../version.txt') as fp: > VERSION = fp.read().strip() > > setuptools.setup( > @@ -12,7 +17,7 @@ setuptools.setup( > setup_requires=['cffi>=1.0.0'], > install_requires=['cffi>=1.0.0'], > packages=setuptools.find_packages(exclude=['tests']), > - cffi_modules=['notmuch2/_build.py:ffibuilder'], > + cffi_modules=[dn0 + '/notmuch2/_build.py:ffibuilder'], > classifiers=[ > 'Development Status :: 3 - Alpha', > 'Intended Audience :: Developers', > diff --git a/bindings/python-cffi/version.txt b/bindings/python-cffi/version.txt > deleted file mode 100644 > index 8239f42d..00000000 > --- a/bindings/python-cffi/version.txt > +++ /dev/null > @@ -1 +0,0 @@ > -0.31.3 > diff --git a/configure b/configure > index cfa9c09b..7bdd7a13 100755 > --- a/configure > +++ b/configure > @@ -74,10 +74,6 @@ if [ "$srcdir" != "." ]; then > # Use the same hack to replicate python-cffi source for > # out-of-tree builds (again, not ideal). > mkdir bindings/python-cffi > - cp -a "$srcdir"/bindings/python-cffi/tests \ > - "$srcdir"/bindings/python-cffi/notmuch2 \ > - "$srcdir"/bindings/python-cffi/setup.py \ > - bindings/python-cffi/ > fi > > # Set several defaults (optionally specified by the user in