unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] configure: detect version by compiler for build
@ 2020-07-27 15:41 Đoàn Trần Công Danh
  2020-07-27 15:41 ` [PATCH] configure: account for various name of pytest-3 Đoàn Trần Công Danh
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-27 15:41 UTC (permalink / raw)
  To: notmuch; +Cc: Đoàn Trần Công Danh

We'll need to run the compiled binary to report our current version.

With the same code base, we should have the same version information
regardless of compiler and architecture.

Let's use the compiler for building architecture to build the reporting
binary. Which is usually reported under variable CC_FOR_BUILD,
a convention established by GNU Autotools, and fall back to CC if it's
not defined.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 configure | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 98f5f1ea..db3538b3 100755
--- a/configure
+++ b/configure
@@ -85,8 +85,10 @@ fi
 BASHCMD=${BASHCMD:-bash}
 PERL=${PERL:-perl}
 CC=${CC:-cc}
+CC_FOR_BUILD=${CC_FOR_BUILD:-$CC}
 CXX=${CXX:-c++}
 CFLAGS=${CFLAGS:--g -O2}
+CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-$CFLAGS}
 CPPFLAGS=${CPPFLAGS:-}
 CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
 CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
@@ -410,7 +412,7 @@ int main(void) {
     return 0;
 }
 EOF
-if ${CC} ${CFLAGS} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
+if ${CC_FOR_BUILD} ${CFLAGS_FOR_BUILD} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
        && ./_libversion > _libversion.sh && . ./_libversion.sh
 then
     printf "OK.\n"
-- 
2.28.0.rc2.21.g5c06d60fc5\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH] configure: account for various name of pytest-3
  2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
@ 2020-07-27 15:41 ` Đoàn Trần Công Danh
  2020-07-27 17:37   ` Tomi Ollila
  2020-07-27 15:41 ` [PATCH] configure: drop check for default xapian backend Đoàn Trần Công Danh
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-27 15:41 UTC (permalink / raw)
  To: notmuch; +Cc: Đoàn Trần Công Danh

On different distro, pytest is suffixed with different patterns.
Try to account for them, now.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 configure | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index db3538b3..90bc9182 100755
--- a/configure
+++ b/configure
@@ -814,10 +814,15 @@ if [ $have_python3 -eq 1 ]; then
     printf "Checking for python3 pytest (>= 3.0)... "
     conf=$(mktemp)
     printf "[pytest]\nminversion=3.0\n" > $conf
-    if pytest-3 -c $conf --version >/dev/null 2>&1; then
-        printf "Yes.\n"
-        have_python3_pytest=1
-    else
+    for _pytest_cmd in pytest-3 pytest3; do
+        if command -v $_pytest_cmd >/dev/null 2>&1 &&
+                $_pytest_cmd -c $conf --version >/dev/null 2>&1; then
+            printf "Yes.\n"
+            have_python3_pytest=1
+            break
+        fi
+    done
+    if [ "have_python3_pytest" = "0" ]; then
         printf "No (will not test CFFI-based python bindings).\n"
     fi
     rm -f $conf
-- 
2.28.0.rc2.21.g5c06d60fc5\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH] configure: drop check for default xapian backend
  2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
  2020-07-27 15:41 ` [PATCH] configure: account for various name of pytest-3 Đoàn Trần Công Danh
@ 2020-07-27 15:41 ` Đoàn Trần Công Danh
  2020-07-28 11:17   ` David Bremner
  2020-07-27 15:41 ` [PATCH] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-27 15:41 UTC (permalink / raw)
  To: notmuch; +Cc: Đoàn Trần Công Danh

Starting from xapian 1.3.5, xapian switched default backend to glass.

From 00cdfe10 (build: drop support for xapian versions less than 1.4,
2020-04-22), we only support xapian 1.4.0+. Effectively, we don't need
to check for default xapian backend anymore.

Let's drop it.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 configure                  | 23 -----------------------
 test/T360-symbol-hiding.sh |  4 ++--
 test/test-lib.sh           | 11 +----------
 3 files changed, 3 insertions(+), 35 deletions(-)

diff --git a/configure b/configure
index 90bc9182..bb17054a 100755
--- a/configure
+++ b/configure
@@ -457,26 +457,6 @@ if [ ${have_xapian} = "0" ]; then
     errors=$((errors + 1))
 fi
 
-if [ ${have_xapian} = "1" ]; then
-    default_xapian_backend=""
-    printf "Testing default Xapian backend... "
-    cat >_default_backend.cc <<EOF
-#include <xapian.h>
-int main(int argc, char** argv) {
-   Xapian::WritableDatabase db("test.db",Xapian::DB_CREATE_OR_OPEN);
-}
-EOF
-    ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} _default_backend.cc -o _default_backend ${xapian_ldflags}
-    ./_default_backend
-    if [ -f test.db/iamglass ]; then
-	default_xapian_backend=glass
-    else
-	default_xapian_backend=chert
-    fi
-    printf "%s\n" "${default_xapian_backend}";
-    rm -rf test.db _default_backend _default_backend.cc
-fi
-
 GMIME_MINVER=3.0.3
 
 printf "Checking for GMime development files (>= $GMIME_MINVER)... "
@@ -1515,9 +1495,6 @@ NOTMUCH_SRCDIR='${NOTMUCH_SRCDIR}'
 # Whether to have Xapian retry lock
 NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK=${WITH_RETRY_LOCK}
 
-# Which backend will Xapian use by default?
-NOTMUCH_DEFAULT_XAPIAN_BACKEND=${default_xapian_backend}
-
 # Whether GMime can verify X.509 certificate validity
 NOTMUCH_GMIME_X509_CERT_VALIDITY=${gmime_x509_cert_validity}
 
diff --git a/test/T360-symbol-hiding.sh b/test/T360-symbol-hiding.sh
index 43921cb4..eb438a7a 100755
--- a/test/T360-symbol-hiding.sh
+++ b/test/T360-symbol-hiding.sh
@@ -14,11 +14,11 @@ test_description='exception symbol hiding'
 test_begin_subtest 'running test' run_test
 mkdir -p ${PWD}/fakedb/.notmuch
 $TEST_DIRECTORY/symbol-test ${PWD}/fakedb ${PWD}/nonexistent 2>&1 \
-	| notmuch_dir_sanitize | sed -e "s,\`,\',g" -e "s,${NOTMUCH_DEFAULT_XAPIAN_BACKEND},backend,g" > OUTPUT
+	| notmuch_dir_sanitize | sed -e "s,\`,\',g" > OUTPUT
 
 cat <<EOF > EXPECTED
 A Xapian exception occurred opening database: Couldn't stat 'CWD/fakedb/.notmuch/xapian'
-caught No backend database found at path 'CWD/nonexistent'
+caught No glass database found at path 'CWD/nonexistent'
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 8c331b88..9142f6b2 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1260,16 +1260,7 @@ ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 rm -f y
 
 # convert variable from configure to more convenient form
-case "$NOTMUCH_DEFAULT_XAPIAN_BACKEND" in
-    glass)
-	db_ending=glass
-    ;;
-    chert)
-	db_ending=DB
-    ;;
-    *)
-	error "Unknown Xapian backend $NOTMUCH_DEFAULT_XAPIAN_BACKEND"
-esac
+db_ending=glass
 # declare prerequisites for external binaries used in tests
 test_declare_external_prereq dtach
 test_declare_external_prereq emacs
-- 
2.28.0.rc2.21.g5c06d60fc5\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH] T355: specify hash algorithm explicitly
  2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
  2020-07-27 15:41 ` [PATCH] configure: account for various name of pytest-3 Đoàn Trần Công Danh
  2020-07-27 15:41 ` [PATCH] configure: drop check for default xapian backend Đoàn Trần Công Danh
@ 2020-07-27 15:41 ` Đoàn Trần Công Danh
  2020-07-27 17:00   ` Đoàn Trần Công Danh
  2020-07-27 17:40   ` Tomi Ollila
  2020-07-27 17:31 ` [PATCH] configure: detect version by compiler for build Tomi Ollila
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-27 15:41 UTC (permalink / raw)
  To: notmuch; +Cc: Đoàn Trần Công Danh

On some systems (notably, the one shipped with LibreSSL),
default fingerprint digest algorithm is SHA256.

On other systems, users can change default digest algorithm by changing
default_md in /etc/ssl/default_md.

Let's ask openssl to provide us specific algorithm to make the test
more deterministic.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 test/T355-smime.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/T355-smime.sh b/test/T355-smime.sh
index f8cec62c..8b2b52be 100755
--- a/test/T355-smime.sh
+++ b/test/T355-smime.sh
@@ -6,7 +6,7 @@ test_description='S/MIME signature verification and decryption'
 test_require_external_prereq openssl
 test_require_external_prereq gpgsm
 
-FINGERPRINT=$(openssl x509 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
+FINGERPRINT=$(openssl x509 -sha1 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
 
 add_gpgsm_home
 
-- 
2.28.0.rc2.21.g5c06d60fc5\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] T355: specify hash algorithm explicitly
  2020-07-27 15:41 ` [PATCH] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
@ 2020-07-27 17:00   ` Đoàn Trần Công Danh
  2020-07-27 17:40   ` Tomi Ollila
  1 sibling, 0 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-27 17:00 UTC (permalink / raw)
  To: notmuch

On 2020-07-27 22:41:08+0700, Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:
> On some systems (notably, the one shipped with LibreSSL),
> default fingerprint digest algorithm is SHA256.
> 
> On other systems, users can change default digest algorithm by changing
> default_md in /etc/ssl/default_md.

s/default_md[.]/openssl.cnf/

Sorry for the noise, but I failed to proof read my commit message.

> 
> Let's ask openssl to provide us specific algorithm to make the test
> more deterministic.
> 
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> ---
>  test/T355-smime.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/T355-smime.sh b/test/T355-smime.sh
> index f8cec62c..8b2b52be 100755
> --- a/test/T355-smime.sh
> +++ b/test/T355-smime.sh
> @@ -6,7 +6,7 @@ test_description='S/MIME signature verification and decryption'
>  test_require_external_prereq openssl
>  test_require_external_prereq gpgsm
>  
> -FINGERPRINT=$(openssl x509 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
> +FINGERPRINT=$(openssl x509 -sha1 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
>  
>  add_gpgsm_home
>  
> -- 
> 2.28.0.rc2.21.g5c06d60fc5
> 

-- 
Danh

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: detect version by compiler for build
  2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
                   ` (2 preceding siblings ...)
  2020-07-27 15:41 ` [PATCH] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
@ 2020-07-27 17:31 ` Tomi Ollila
  2020-07-28  0:18   ` Đoàn Trần Công Danh
  2020-08-03 15:40 ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: Tomi Ollila @ 2020-07-27 17:31 UTC (permalink / raw)
  To: Đoàn Trần Công Danh, notmuch
  Cc: Đoàn Trần Công Danh

On Mon, Jul 27 2020, Đoàn Trần Công Danh wrote:

> We'll need to run the compiled binary to report our current version.
>
> With the same code base, we should have the same version information
> regardless of compiler and architecture.
>
> Let's use the compiler for building architecture to build the reporting
> binary. Which is usually reported under variable CC_FOR_BUILD,
> a convention established by GNU Autotools, and fall back to CC if it's
> not defined.

We'd probably need to change quite a few other compiled and run binaries
in configure... otherwise this would be incomplete change (and thus just
adds confusion ?)

>
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> ---
>  configure | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 98f5f1ea..db3538b3 100755
> --- a/configure
> +++ b/configure
> @@ -85,8 +85,10 @@ fi
>  BASHCMD=${BASHCMD:-bash}
>  PERL=${PERL:-perl}
>  CC=${CC:-cc}
> +CC_FOR_BUILD=${CC_FOR_BUILD:-$CC}
>  CXX=${CXX:-c++}
>  CFLAGS=${CFLAGS:--g -O2}
> +CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-$CFLAGS}
>  CPPFLAGS=${CPPFLAGS:-}
>  CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
>  CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
> @@ -410,7 +412,7 @@ int main(void) {
>      return 0;
>  }
>  EOF
> -if ${CC} ${CFLAGS} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
> +if ${CC_FOR_BUILD} ${CFLAGS_FOR_BUILD} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
>         && ./_libversion > _libversion.sh && . ./_libversion.sh
>  then
>      printf "OK.\n"
> -- 
> 2.28.0.rc2.21.g5c06d60fc5
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: account for various name of pytest-3
  2020-07-27 15:41 ` [PATCH] configure: account for various name of pytest-3 Đoàn Trần Công Danh
@ 2020-07-27 17:37   ` Tomi Ollila
  2020-07-28  0:28     ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
  0 siblings, 1 reply; 23+ messages in thread
From: Tomi Ollila @ 2020-07-27 17:37 UTC (permalink / raw)
  To: Đoàn Trần Công Danh, notmuch
  Cc: Đoàn Trần Công Danh

On Mon, Jul 27 2020, Đoàn Trần Công Danh wrote:

> On different distro, pytest is suffixed with different patterns.
> Try to account for them, now.
>
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> ---
>  configure | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/configure b/configure
> index db3538b3..90bc9182 100755
> --- a/configure
> +++ b/configure
> @@ -814,10 +814,15 @@ if [ $have_python3 -eq 1 ]; then
>      printf "Checking for python3 pytest (>= 3.0)... "
>      conf=$(mktemp)
>      printf "[pytest]\nminversion=3.0\n" > $conf
> -    if pytest-3 -c $conf --version >/dev/null 2>&1; then
> -        printf "Yes.\n"
> -        have_python3_pytest=1
> -    else
> +    for _pytest_cmd in pytest-3 pytest3; do

We use `${NOTMUCH_PYTHON} -m pytest` in tests to run the python
tests. IMO it would be better to change this check to do the
same with already resolved python3 command.

Tomi

> +        if command -v $_pytest_cmd >/dev/null 2>&1 &&
> +                $_pytest_cmd -c $conf --version >/dev/null 2>&1; then
> +            printf "Yes.\n"
> +            have_python3_pytest=1
> +            break
> +        fi
> +    done
> +    if [ "have_python3_pytest" = "0" ]; then
>          printf "No (will not test CFFI-based python bindings).\n"
>      fi
>      rm -f $conf
> -- 
> 2.28.0.rc2.21.g5c06d60fc5

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] T355: specify hash algorithm explicitly
  2020-07-27 15:41 ` [PATCH] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
  2020-07-27 17:00   ` Đoàn Trần Công Danh
@ 2020-07-27 17:40   ` Tomi Ollila
  2020-07-27 23:42     ` Đoàn Trần Công Danh
  1 sibling, 1 reply; 23+ messages in thread
From: Tomi Ollila @ 2020-07-27 17:40 UTC (permalink / raw)
  To: Đoàn Trần Công Danh, notmuch
  Cc: Đoàn Trần Công Danh

On Mon, Jul 27 2020, Đoàn Trần Công Danh wrote:

> On some systems (notably, the one shipped with LibreSSL),
> default fingerprint digest algorithm is SHA256.
>
> On other systems, users can change default digest algorithm by changing
> default_md in /etc/ssl/default_md.
>
> Let's ask openssl to provide us specific algorithm to make the test
> more deterministic.
>
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> ---
>  test/T355-smime.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/T355-smime.sh b/test/T355-smime.sh
> index f8cec62c..8b2b52be 100755
> --- a/test/T355-smime.sh
> +++ b/test/T355-smime.sh
> @@ -6,7 +6,7 @@ test_description='S/MIME signature verification and decryption'
>  test_require_external_prereq openssl
>  test_require_external_prereq gpgsm
>  
> -FINGERPRINT=$(openssl x509 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
> +FINGERPRINT=$(openssl x509 -sha1 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)

Looks good to me -- provided that this `-sha1` option is known by all
openssl(1) commmands we expect to be supported...

Tomi


>  
>  add_gpgsm_home
>  
> -- 
> 2.28.0.rc2.21.g5c06d60fc5

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] T355: specify hash algorithm explicitly
  2020-07-27 17:40   ` Tomi Ollila
@ 2020-07-27 23:42     ` Đoàn Trần Công Danh
  0 siblings, 0 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-27 23:42 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: notmuch

On 2020-07-27 20:40:39+0300, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Mon, Jul 27 2020, Đoàn Trần Công Danh wrote:
> 
> > On some systems (notably, the one shipped with LibreSSL),
> > default fingerprint digest algorithm is SHA256.
> >
> > On other systems, users can change default digest algorithm by changing
> > default_md in /etc/ssl/default_md.
> >
> > Let's ask openssl to provide us specific algorithm to make the test
> > more deterministic.
> >
> > Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> > ---
> >  test/T355-smime.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/test/T355-smime.sh b/test/T355-smime.sh
> > index f8cec62c..8b2b52be 100755
> > --- a/test/T355-smime.sh
> > +++ b/test/T355-smime.sh
> > @@ -6,7 +6,7 @@ test_description='S/MIME signature verification and decryption'
> >  test_require_external_prereq openssl
> >  test_require_external_prereq gpgsm
> >  
> > -FINGERPRINT=$(openssl x509 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
> > +FINGERPRINT=$(openssl x509 -sha1 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
> 
> Looks good to me -- provided that this `-sha1` option is known by all
> openssl(1) commmands we expect to be supported...

If you meant commands as is version and clone, it should be good.
Since -sha1 has been known to openssl as far as 
9868232ae1 (Initial trust code: allow setting of trust checking
functions in a table. Doesn't do too much yet., 1999-11-27), [1]

And it's still available in OpenSSL 3.0.0 alpha 5.

LibreSSL is forked from OpenSSL 1.0.1g and the current version also
supported that option.

So, I think we should be fine.

[1]: https://github.com/openssl/openssl/commit/9868232ae1#diff-f48b02166abaa1faa6c10358046a8fb2R125

-- 
Danh

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: detect version by compiler for build
  2020-07-27 17:31 ` [PATCH] configure: detect version by compiler for build Tomi Ollila
@ 2020-07-28  0:18   ` Đoàn Trần Công Danh
  2020-07-28 11:25     ` David Bremner
  0 siblings, 1 reply; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-28  0:18 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: notmuch

On 2020-07-27 20:31:59+0300, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Mon, Jul 27 2020, Đoàn Trần Công Danh wrote:
> 
> > We'll need to run the compiled binary to report our current version.
> >
> > With the same code base, we should have the same version information
> > regardless of compiler and architecture.
> >
> > Let's use the compiler for building architecture to build the reporting
> > binary. Which is usually reported under variable CC_FOR_BUILD,
> > a convention established by GNU Autotools, and fall back to CC if it's
> > not defined.
> 
> We'd probably need to change quite a few other compiled and run binaries
> in configure... otherwise this would be incomplete change (and thus just
> adds confusion ?)

Other compile and try run linked with libraries in (autotools') host
architecture.

Linking with build's libraries doesn't make sense, hence I ignored it.
And patched downstream.

I don't mind dropping this change and carry it downstream.

> 
> >
> > Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> > ---
> >  configure | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/configure b/configure
> > index 98f5f1ea..db3538b3 100755
> > --- a/configure
> > +++ b/configure
> > @@ -85,8 +85,10 @@ fi
> >  BASHCMD=${BASHCMD:-bash}
> >  PERL=${PERL:-perl}
> >  CC=${CC:-cc}
> > +CC_FOR_BUILD=${CC_FOR_BUILD:-$CC}
> >  CXX=${CXX:-c++}
> >  CFLAGS=${CFLAGS:--g -O2}
> > +CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD:-$CFLAGS}
> >  CPPFLAGS=${CPPFLAGS:-}
> >  CXXFLAGS_for_sh=${CXXFLAGS:-${CFLAGS}}
> >  CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
> > @@ -410,7 +412,7 @@ int main(void) {
> >      return 0;
> >  }
> >  EOF
> > -if ${CC} ${CFLAGS} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
> > +if ${CC_FOR_BUILD} ${CFLAGS_FOR_BUILD} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
> >         && ./_libversion > _libversion.sh && . ./_libversion.sh
> >  then
> >      printf "OK.\n"
> > -- 
> > 2.28.0.rc2.21.g5c06d60fc5
> > _______________________________________________
> > notmuch mailing list -- notmuch@notmuchmail.org
> > To unsubscribe send an email to notmuch-leave@notmuchmail.org

-- 
Danh

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2] configure: check for pytest with python -m pytest
  2020-07-27 17:37   ` Tomi Ollila
@ 2020-07-28  0:28     ` Đoàn Trần Công Danh
  0 siblings, 0 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-28  0:28 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: notmuch

On 2020-07-27 20:37:10+0300, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Mon, Jul 27 2020, Đoàn Trần Công Danh wrote:
> 
> > On different distro, pytest is suffixed with different patterns.
> > Try to account for them, now.
> >
> > Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> > ---
> >  configure | 13 +++++++++----
> >  1 file changed, 9 insertions(+), 4 deletions(-)
> >
> > diff --git a/configure b/configure
> > index db3538b3..90bc9182 100755
> > --- a/configure
> > +++ b/configure
> > @@ -814,10 +814,15 @@ if [ $have_python3 -eq 1 ]; then
> >      printf "Checking for python3 pytest (>= 3.0)... "
> >      conf=$(mktemp)
> >      printf "[pytest]\nminversion=3.0\n" > $conf
> > -    if pytest-3 -c $conf --version >/dev/null 2>&1; then
> > -        printf "Yes.\n"
> > -        have_python3_pytest=1
> > -    else
> > +    for _pytest_cmd in pytest-3 pytest3; do
> 
> We use `${NOTMUCH_PYTHON} -m pytest` in tests to run the python
> tests. IMO it would be better to change this check to do the
> same with already resolved python3 command.

Yes, that's definitely better option, I also use that command in other
code base, but forgot to take it here.

This is the updated patch:
-----------------------8<----------------------
From c6d8681d467bef9fe43c039ed1e2e467b99b6c56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 27 Jul 2020 16:42:02 +0700
Subject: [PATCH v2] configure: check for pytest with python -m pytest
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On different distro, pytest is suffixed with different patterns.

On the other hand, `python3-pytest' could be invoked correctly,
via `python3 -m pytest', the latter is used by our tests, now.

Switch to `$python -m pytest` to fix address all incompatible naming.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index db3538b3..f7c1c095 100755
--- a/configure
+++ b/configure
@@ -814,7 +814,7 @@ if [ $have_python3 -eq 1 ]; then
     printf "Checking for python3 pytest (>= 3.0)... "
     conf=$(mktemp)
     printf "[pytest]\nminversion=3.0\n" > $conf
-    if pytest-3 -c $conf --version >/dev/null 2>&1; then
+    if "$python" -m pytest -c $conf --version >/dev/null 2>&1; then
         printf "Yes.\n"
         have_python3_pytest=1
     else
-- 
2.28.0.rc2.21.g5c06d60fc5\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: drop check for default xapian backend
  2020-07-27 15:41 ` [PATCH] configure: drop check for default xapian backend Đoàn Trần Công Danh
@ 2020-07-28 11:17   ` David Bremner
  2020-07-28 13:36     ` Đoàn Trần Công Danh
  0 siblings, 1 reply; 23+ messages in thread
From: David Bremner @ 2020-07-28 11:17 UTC (permalink / raw)
  To: Đoàn Trần Công Danh, notmuch

Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:

> Starting from xapian 1.3.5, xapian switched default backend to glass.
>
> From 00cdfe10 (build: drop support for xapian versions less than 1.4,
> 2020-04-22), we only support xapian 1.4.0+. Effectively, we don't need
> to check for default xapian backend anymore.
>
> Let's drop it.

This is not wrong, but I wonder if we will need to put it all back in a
slightly modified form when Xapian 1.6 releases with a new default
backend.  I guess we can start by reverting this patch if that happens?

d

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: detect version by compiler for build
  2020-07-28  0:18   ` Đoàn Trần Công Danh
@ 2020-07-28 11:25     ` David Bremner
  2020-07-28 13:43       ` Đoàn Trần Công Danh
  0 siblings, 1 reply; 23+ messages in thread
From: David Bremner @ 2020-07-28 11:25 UTC (permalink / raw)
  To: Đoàn Trần Công Danh, Tomi Ollila; +Cc: notmuch

Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:

>
> Other compile and try run linked with libraries in (autotools') host
> architecture.
>
> Linking with build's libraries doesn't make sense, hence I ignored it.
> And patched downstream.
>
> I don't mind dropping this change and carry it downstream.
>

I'm afraid I don't understand the reference to autotools here. Are you
embedding the build of notmuch in some packaging system that thinks
everything is autotools?  I agree with Tomi that changing this one
relatively minor use of CC in isolation does not make sense.  I'm not
opposed to upstreaming packaging inspired changes, but generally I would
like to see how they help more than just one packager.

\r

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: drop check for default xapian backend
  2020-07-28 11:17   ` David Bremner
@ 2020-07-28 13:36     ` Đoàn Trần Công Danh
  2020-07-30  0:05       ` David Bremner
  0 siblings, 1 reply; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-28 13:36 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch

On 2020-07-28 08:17:49-0300, David Bremner <david@tethera.net> wrote:
> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
> 
> > Starting from xapian 1.3.5, xapian switched default backend to glass.
> >
> > From 00cdfe10 (build: drop support for xapian versions less than 1.4,
> > 2020-04-22), we only support xapian 1.4.0+. Effectively, we don't need
> > to check for default xapian backend anymore.
> >
> > Let's drop it.
> 
> This is not wrong, but I wonder if we will need to put it all back in a
> slightly modified form when Xapian 1.6 releases with a new default
> backend.  I guess we can start by reverting this patch if that happens?

I have a quick skim over current codebase,
if I have not missed anything,
this check is only applicable for testing.

I think a future-proof move would be moving
this check to a runtime check in "make test".

What do you think?

-- 
Danh

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: detect version by compiler for build
  2020-07-28 11:25     ` David Bremner
@ 2020-07-28 13:43       ` Đoàn Trần Công Danh
  0 siblings, 0 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-28 13:43 UTC (permalink / raw)
  To: David Bremner; +Cc: Tomi Ollila, notmuch

On 2020-07-28 08:25:00-0300, David Bremner <david@tethera.net> wrote:
> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
> 
> >
> > Other compile and try run linked with libraries in (autotools') host
> > architecture.
> >
> > Linking with build's libraries doesn't make sense, hence I ignored it.
> > And patched downstream.
> >
> > I don't mind dropping this change and carry it downstream.
> >
> 
> I'm afraid I don't understand the reference to autotools here. Are you
> embedding the build of notmuch in some packaging system that thinks
> everything is autotools?

Yes, this patch was inspired by patching for a packaging system that
have all autotools' required variable exported.

> I agree with Tomi that changing this one
> relatively minor use of CC in isolation does not make sense.  I'm not
> opposed to upstreaming packaging inspired changes, but generally I would
> like to see how they help more than just one packager.

Nowaday, most distro only cross-compiles some base system then build
other packages native-like with qemu-user-static. Except very limited
set of distro and some distro for embedded system, but notmuch is
unlikely shipped notmuch, so this could help only single packager.

So, I think this patch should be dropped.


-- 
Danh

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: drop check for default xapian backend
  2020-07-28 13:36     ` Đoàn Trần Công Danh
@ 2020-07-30  0:05       ` David Bremner
  2020-07-31 13:49         ` Đoàn Trần Công Danh
  0 siblings, 1 reply; 23+ messages in thread
From: David Bremner @ 2020-07-30  0:05 UTC (permalink / raw)
  To: Đoàn Trần Công Danh; +Cc: notmuch

Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:

> On 2020-07-28 08:17:49-0300, David Bremner <david@tethera.net> wrote:
>> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
>> 
>> > Starting from xapian 1.3.5, xapian switched default backend to glass.
>> >
>> > From 00cdfe10 (build: drop support for xapian versions less than 1.4,
>> > 2020-04-22), we only support xapian 1.4.0+. Effectively, we don't need
>> > to check for default xapian backend anymore.
>> >
>> > Let's drop it.
>> 
>> This is not wrong, but I wonder if we will need to put it all back in a
>> slightly modified form when Xapian 1.6 releases with a new default
>> backend.  I guess we can start by reverting this patch if that happens?
>
> I have a quick skim over current codebase,
> if I have not missed anything,
> this check is only applicable for testing.
>
> I think a future-proof move would be moving
> this check to a runtime check in "make test".
>
> What do you think?

I sent a couple of patches removing all use from the test suite, so you
could respin your series with just the configure modifications. Or feel
free to incorporate my patches into your series, whatever is most
convenient. It's quite possible there are shell script related
improvements for my patches, so you might want to wait a couple of days.

d

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: drop check for default xapian backend
  2020-07-30  0:05       ` David Bremner
@ 2020-07-31 13:49         ` Đoàn Trần Công Danh
  2020-07-31 14:41           ` David Bremner
  0 siblings, 1 reply; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-07-31 13:49 UTC (permalink / raw)
  To: David Bremner; +Cc: notmuch

On 2020-07-29 21:05:37-0300, David Bremner <david@tethera.net> wrote:
> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
> 
> > On 2020-07-28 08:17:49-0300, David Bremner <david@tethera.net> wrote:
> >> Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
> >> 
> >> > Starting from xapian 1.3.5, xapian switched default backend to glass.
> >> >
> >> > From 00cdfe10 (build: drop support for xapian versions less than 1.4,
> >> > 2020-04-22), we only support xapian 1.4.0+. Effectively, we don't need
> >> > to check for default xapian backend anymore.
> >> >
> >> > Let's drop it.
> >> 
> >> This is not wrong, but I wonder if we will need to put it all back in a
> >> slightly modified form when Xapian 1.6 releases with a new default
> >> backend.  I guess we can start by reverting this patch if that happens?
> >
> > I have a quick skim over current codebase,
> > if I have not missed anything,
> > this check is only applicable for testing.
> >
> > I think a future-proof move would be moving
> > this check to a runtime check in "make test".
> >
> > What do you think?
> 
> I sent a couple of patches removing all use from the test suite, so you
> could respin your series with just the configure modifications. Or feel
> free to incorporate my patches into your series, whatever is most
> convenient. It's quite possible there are shell script related
> improvements for my patches, so you might want to wait a couple of days.

I'll wait until they got merged down to master before reroll my changes
to avoid further conflicts.

-- 
Danh

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] configure: drop check for default xapian backend
  2020-07-31 13:49         ` Đoàn Trần Công Danh
@ 2020-07-31 14:41           ` David Bremner
  0 siblings, 0 replies; 23+ messages in thread
From: David Bremner @ 2020-07-31 14:41 UTC (permalink / raw)
  To: Đoàn Trần Công Danh; +Cc: notmuch

Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:

>> I sent a couple of patches removing all use from the test suite, so you
>> could respin your series with just the configure modifications. Or feel
>> free to incorporate my patches into your series, whatever is most
>> convenient. It's quite possible there are shell script related
>> improvements for my patches, so you might want to wait a couple of days.
>
> I'll wait until they got merged down to master before reroll my changes
> to avoid further conflicts.

Makes sense

David\r

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2] configure: check for pytest with python -m pytest
  2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
                   ` (3 preceding siblings ...)
  2020-07-27 17:31 ` [PATCH] configure: detect version by compiler for build Tomi Ollila
@ 2020-08-03 15:40 ` Đoàn Trần Công Danh
  2020-08-07 17:12   ` Tomi Ollila
  2020-08-03 15:40 ` [PATCH v2] configure: drop check for default xapian backend Đoàn Trần Công Danh
  2020-08-03 15:40 ` [PATCH v2] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
  6 siblings, 1 reply; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-08-03 15:40 UTC (permalink / raw)
  To: notmuch; +Cc: Đoàn Trần Công Danh

On different distro, pytest is suffixed with different patterns.

On the other hand, `python3-pytest' could be invoked correctly,
via `python3 -m pytest', the latter is used by our tests, now.

Switch to `$python -m pytest` to fix address all incompatible naming.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index db3538b3..f7c1c095 100755
--- a/configure
+++ b/configure
@@ -814,7 +814,7 @@ if [ $have_python3 -eq 1 ]; then
     printf "Checking for python3 pytest (>= 3.0)... "
     conf=$(mktemp)
     printf "[pytest]\nminversion=3.0\n" > $conf
-    if pytest-3 -c $conf --version >/dev/null 2>&1; then
+    if "$python" -m pytest -c $conf --version >/dev/null 2>&1; then
         printf "Yes.\n"
         have_python3_pytest=1
     else
-- 
2.28.0.163.g6104cc2f0b\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2] configure: drop check for default xapian backend
  2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
                   ` (4 preceding siblings ...)
  2020-08-03 15:40 ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
@ 2020-08-03 15:40 ` Đoàn Trần Công Danh
  2020-08-03 15:40 ` [PATCH v2] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
  6 siblings, 0 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-08-03 15:40 UTC (permalink / raw)
  To: notmuch; +Cc: Đoàn Trần Công Danh

Starting from xapian 1.3.5, xapian switched default backend to glass.

From 00cdfe10 (build: drop support for xapian versions less than 1.4,
2020-04-22), we only support xapian 1.4.0+. Effectively, we don't need
to check for default xapian backend anymore.

Further more, from 99a7aac8 (test: drop use of db_ending, 2020-07-29),
our test framework has become independence from default xapian.

Let's drop it.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 configure | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/configure b/configure
index f7c1c095..65d88667 100755
--- a/configure
+++ b/configure
@@ -457,26 +457,6 @@ if [ ${have_xapian} = "0" ]; then
     errors=$((errors + 1))
 fi
 
-if [ ${have_xapian} = "1" ]; then
-    default_xapian_backend=""
-    printf "Testing default Xapian backend... "
-    cat >_default_backend.cc <<EOF
-#include <xapian.h>
-int main(int argc, char** argv) {
-   Xapian::WritableDatabase db("test.db",Xapian::DB_CREATE_OR_OPEN);
-}
-EOF
-    ${CXX} ${CXXFLAGS_for_sh} ${xapian_cxxflags} _default_backend.cc -o _default_backend ${xapian_ldflags}
-    ./_default_backend
-    if [ -f test.db/iamglass ]; then
-	default_xapian_backend=glass
-    else
-	default_xapian_backend=chert
-    fi
-    printf "%s\n" "${default_xapian_backend}";
-    rm -rf test.db _default_backend _default_backend.cc
-fi
-
 GMIME_MINVER=3.0.3
 
 printf "Checking for GMime development files (>= $GMIME_MINVER)... "
@@ -1510,9 +1490,6 @@ NOTMUCH_SRCDIR='${NOTMUCH_SRCDIR}'
 # Whether to have Xapian retry lock
 NOTMUCH_HAVE_XAPIAN_DB_RETRY_LOCK=${WITH_RETRY_LOCK}
 
-# Which backend will Xapian use by default?
-NOTMUCH_DEFAULT_XAPIAN_BACKEND=${default_xapian_backend}
-
 # Whether GMime can verify X.509 certificate validity
 NOTMUCH_GMIME_X509_CERT_VALIDITY=${gmime_x509_cert_validity}
 
-- 
2.28.0.163.g6104cc2f0b\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH v2] T355: specify hash algorithm explicitly
  2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
                   ` (5 preceding siblings ...)
  2020-08-03 15:40 ` [PATCH v2] configure: drop check for default xapian backend Đoàn Trần Công Danh
@ 2020-08-03 15:40 ` Đoàn Trần Công Danh
  6 siblings, 0 replies; 23+ messages in thread
From: Đoàn Trần Công Danh @ 2020-08-03 15:40 UTC (permalink / raw)
  To: notmuch; +Cc: Đoàn Trần Công Danh

On some systems (notably, the one shipped with LibreSSL),
default fingerprint digest algorithm is SHA256.

On other systems, users can change default digest algorithm by changing
default_md in /etc/ssl/default_md.

Let's ask openssl to provide us specific algorithm to make the test
more deterministic.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 test/T355-smime.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/T355-smime.sh b/test/T355-smime.sh
index f8cec62c..8b2b52be 100755
--- a/test/T355-smime.sh
+++ b/test/T355-smime.sh
@@ -6,7 +6,7 @@ test_description='S/MIME signature verification and decryption'
 test_require_external_prereq openssl
 test_require_external_prereq gpgsm
 
-FINGERPRINT=$(openssl x509 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
+FINGERPRINT=$(openssl x509 -sha1 -fingerprint -in "$NOTMUCH_SRCDIR/test/smime/key+cert.pem" -noout | sed -e 's/^.*=//' -e s/://g)
 
 add_gpgsm_home
 
-- 
2.28.0.163.g6104cc2f0b\r

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] configure: check for pytest with python -m pytest
  2020-08-03 15:40 ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
@ 2020-08-07 17:12   ` Tomi Ollila
  2020-08-08 19:14     ` David Bremner
  0 siblings, 1 reply; 23+ messages in thread
From: Tomi Ollila @ 2020-08-07 17:12 UTC (permalink / raw)
  To: Đoàn Trần Công Danh, notmuch

On Mon, Aug 03 2020, Đoàn Trần Công Danh wrote:

> On different distro, pytest is suffixed with different patterns.
>
> On the other hand, `python3-pytest' could be invoked correctly,
> via `python3 -m pytest', the latter is used by our tests, now.
>
> Switch to `$python -m pytest` to fix address all incompatible naming.
>
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>

THis series looks good to me on my terminal, but does not apply 
to my tree (HEAD commit: 0e4695ab (origin/master) test: regression tests for n_indexopts_{get,set}_decrypt_policy)

Tomi

> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index db3538b3..f7c1c095 100755
> --- a/configure
> +++ b/configure
> @@ -814,7 +814,7 @@ if [ $have_python3 -eq 1 ]; then
>      printf "Checking for python3 pytest (>= 3.0)... "
>      conf=$(mktemp)
>      printf "[pytest]\nminversion=3.0\n" > $conf
> -    if pytest-3 -c $conf --version >/dev/null 2>&1; then
> +    if "$python" -m pytest -c $conf --version >/dev/null 2>&1; then
>          printf "Yes.\n"
>          have_python3_pytest=1
>      else
> -- 
> 2.28.0.163.g6104cc2f0b

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2] configure: check for pytest with python -m pytest
  2020-08-07 17:12   ` Tomi Ollila
@ 2020-08-08 19:14     ` David Bremner
  0 siblings, 0 replies; 23+ messages in thread
From: David Bremner @ 2020-08-08 19:14 UTC (permalink / raw)
  To: Tomi Ollila, Đoàn Trần Công Danh, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Mon, Aug 03 2020, Đoàn Trần Công Danh wrote:
>
>> On different distro, pytest is suffixed with different patterns.
>>
>> On the other hand, `python3-pytest' could be invoked correctly,
>> via `python3 -m pytest', the latter is used by our tests, now.
>>
>> Switch to `$python -m pytest` to fix address all incompatible naming.
>>
>> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
>
> THis series looks good to me on my terminal, but does not apply 
> to my tree (HEAD commit: 0e4695ab (origin/master) test: regression tests for n_indexopts_{get,set}_decrypt_policy)
>
> Tomi

Yes, I had the the same problem, but I managed to get the patches to
apply with some trickery involving "patch". I'm still not sure what the
issue was, I guess the patches were based on an old tree because the
changes to configure were offset by two lines.

Series is applied to master now.
d

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2020-08-08 19:15 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
2020-07-27 15:41 ` [PATCH] configure: account for various name of pytest-3 Đoàn Trần Công Danh
2020-07-27 17:37   ` Tomi Ollila
2020-07-28  0:28     ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
2020-07-27 15:41 ` [PATCH] configure: drop check for default xapian backend Đoàn Trần Công Danh
2020-07-28 11:17   ` David Bremner
2020-07-28 13:36     ` Đoàn Trần Công Danh
2020-07-30  0:05       ` David Bremner
2020-07-31 13:49         ` Đoàn Trần Công Danh
2020-07-31 14:41           ` David Bremner
2020-07-27 15:41 ` [PATCH] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
2020-07-27 17:00   ` Đoàn Trần Công Danh
2020-07-27 17:40   ` Tomi Ollila
2020-07-27 23:42     ` Đoàn Trần Công Danh
2020-07-27 17:31 ` [PATCH] configure: detect version by compiler for build Tomi Ollila
2020-07-28  0:18   ` Đoàn Trần Công Danh
2020-07-28 11:25     ` David Bremner
2020-07-28 13:43       ` Đoàn Trần Công Danh
2020-08-03 15:40 ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
2020-08-07 17:12   ` Tomi Ollila
2020-08-08 19:14     ` David Bremner
2020-08-03 15:40 ` [PATCH v2] configure: drop check for default xapian backend Đoàn Trần Công Danh
2020-08-03 15:40 ` [PATCH v2] T355: specify hash algorithm explicitly Đoàn Trần Công Danh

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).