Commit graph

7283 commits

Author SHA1 Message Date
David Bremner
31098c4ae4 lib/config: canonicalize paths relative to $HOME.
Prior to 0.32, notmuch had the (undocumented) behaviour that it
expanded a relative value of database.path with respect to $HOME. In
0.32 this was special cased for database.path but broken for
database.mail_root, which causes problems for at least notmuch-new
when database.path is set to a relative path.

The change in T030-config.sh reflects a user visible, but hopefully
harmless behaviour change; the expanded form of the paths will now be
printed by notmuch config.
2021-05-10 11:08:18 -03:00
David Bremner
ef0b126619 test: add known broken test for relative database path in new
This test highlights a bug introduced in 0.32. The new split between
path and mail_root does not properly canonicalize relative paths in
the latter.
2021-05-10 11:06:40 -03:00
Felipe Contreras
ac64de450a test: ruby: simplify output comparison
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-05 17:00:37 -03:00
Felipe Contreras
faf5511c3e test: ruby: don't use instance variables
Local variables are perfectly fine.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-05 17:00:16 -03:00
Felipe Contreras
c4b23cf29a test: ruby: use much more standard Ruby idioms
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-05 16:40:15 -03:00
Felipe Contreras
63413a5563 test: ruby: use much more standard puts
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-02 08:12:15 -03:00
Felipe Contreras
2dbc5fdf5a test: ruby: simplify test_ruby()
We always do test_expect_equal_file, so do it in test_ruby() directly.

The only subtest where we don't (get non-existent file) can be easily
modified.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-02 08:12:05 -03:00
Felipe Contreras
9f6bc01824 test: ruby: simplify MAIL_DIR initialization
There's no need to complicate the script passing the MAIL_DIR
environment variable.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-02 08:11:56 -03:00
Felipe Contreras
c1b99d6f94 test: ruby: simplify MAIL_DIR check
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-02 08:11:42 -03:00
Felipe Contreras
a75a9a5aed test: ruby: refactor test_ruby()
There's no point in repeating the same initialization in all the tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-02 08:11:17 -03:00
Felipe Contreras
8cbd8e71d0 test: move test_ruby() inside the only client
Not much point in polluting the main library, and also will be useful to
modify it in tandem with the tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-02 08:11:04 -03:00
David Bremner
595b61ef47 notmuch 0.32 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEkiyHYXwaY0SiY6fqA0U5G1WqFSEFAmCOewwACgkQA0U5G1Wq
 FSEtmhAAic/ii2R6wzw1W3vn79a1U+2mZKjt7BhB2hnfZxP+9pJsu2nfuRF3htBk
 7iD8U65X6+IxR2sywAY2C2dlmaFSpph5/6oxd7NqQ0tV0I6Rk1i5c+c3mkg42T+X
 chdsvpCn+m5IVEyOH9HNSIfTlB4NPz4MnK+mN8K6BRRw9O3+LLTtisSe6gxPOX45
 nosicfEcaSeBxcPlx3rDtqxGB8EHsQB3RNITFAWt31p9jpzQMKPk7lTZeF7kp5SH
 w8rN3k/yeGaEdWGiWzymYwIA6tim9imvJBxu5UnV+SwlD+lGViCjtQOk1fMC0WCD
 29BFdRMG5YrBp33nsFX3pgUOVEyGFrWIZPbO9ReOqfc9gpks/5JqcKd6NZ7hMjx/
 I7+It6Cc0KJ6Pmc+w/xz1jK8NeOPcE1YlKZJ+dMjyoBnWixlHW2vOPCSLXXGclBk
 AxZN6kRJxNtoUgX9OLLK8xupqR3PsEeuvku/quYsCEyFrT/A3pr5XaKDkG+EbC4H
 NX/BdURU9gccUdckfXHqCB1PzcQWiVV7wj4xC7XdaqMe2Pb1MR0AOUrwWiU/CboQ
 yza9ryndX05omhQsmnn11xB018oeBAX0iw6T1tb8Vx1CMBJCTC/kPBj3WqY07G3g
 Z9rhLGtIzpFBgSGy3VNGqjfXrWyePSyBcgZGzyjjSQ/mfVUbbDs=
 =zOsP
 -----END PGP SIGNATURE-----

Merge tag '0.32'

notmuch 0.32 release
2021-05-02 07:41:42 -03:00
David Bremner
5fe92332f2 debian: add changelog for 0.32-1 2021-05-02 07:05:44 -03:00
David Bremner
75acdf32fc NEWS: set date for 0.32 release 2021-05-02 07:01:41 -03:00
David Bremner
ff5311b098 version: bump to 0.32 2021-05-02 07:00:15 -03:00
Felipe Contreras
fe9616aef1 test: add external prereqs to many emacs tests
The tests fail otherwise.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-01 21:15:27 -03:00
Felipe Contreras
049a652da7 test: add prereqs check in test_emacs_expect_t
test_emacs may update the external prereqs, in which case we want to
skip the test rather than fail.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-01 21:15:10 -03:00
Felipe Contreras
7579f3ac6b test: fix wrong SKIP messages
When the external prereqs are updated inside the body of the command
(e.g. test_emacs) the message in test_report_skip_ is wrong: it outputs
the body of the command instead of the subtest name.

We need to pass the same argument we pass to test_skip.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-01 21:14:55 -03:00
Felipe Contreras
0b48e65526 test: use correct fqdn in passwd_sanitize()
My fqdn is 'natae.localdomain', however, socket.getfqdn() returns
'localhost'.

To fetch the true fqdn we need socket.getaddrinfo().

For more information see: https://stackoverflow.com/a/11580042/10474

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-01 21:14:37 -03:00
Felipe Contreras
2add9ce722 test: unset NAME environment variable
Otherwise the output from the tests would be different.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-01 21:13:41 -03:00
Felipe Contreras
ff5f141bf2 test: fix passwd_sanitize()
If any of the variables is empty the output is completely messed up,
because replace("", "FOO") puts "FOO" before every single character.

I don't have my full name configured, and this is what I get:

  USER_FULL_NAME=USER_FULL_NAME=USER_FULL_NAME USER_FULL_NAMEsUSER_FULL_NAMEtUSER_FULL_NAMEdUSER_FULL_NAMEoUSER_FULL_NAMEuUSER_FULL_NAMEtUSER_FULL_NAME USER_FULL_NAME=USER_FULL_NAME=USER_FULL_NAME

Let's check for empty strings before doing any replace.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-01 21:13:23 -03:00
David Bremner
6a20478abb perf-test: add option to run perf
Although the generation of perf data is not as slow as valgrind, it
seems simplest to re-use the machinery already there to save the logs
in a timestamped subdirectory.
2021-04-28 08:49:07 -03:00
David Bremner
9e2e723881 notmuch 0.32~rc2 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEkiyHYXwaY0SiY6fqA0U5G1WqFSEFAmCJNFIACgkQA0U5G1Wq
 FSHvjA/9GyM5/Z6N79BAu2cHJykw055Oj7BzcEfyiDa9qju9R9FzlMq5eYepEkqp
 s6uehZ3yUr2vzMpUlCUjzjDzOrT3rkzWoD8soqA7T0/hWOHsid/NH51hom5n5p1F
 KC4WaUxv1doNVfUCW/zhUmRQKgHMqq+WHkmqi9YD0OFfTZr9c4lgY89nGhQbNEb2
 Bp51TqkgbjCD9eMPFkzyJuM/FSU1JYYT2z69/lSLDjAtTUxDbfFHyW20//fsC4T/
 XjCrWMr/FFucYLp3kPPWT60XbOcygtJmxV+JfezwxGu0i+UD3ZwJ879kKnsYMJ4y
 5mNhSToeOFvBnR5eZMP0YL8PFSdq4tTJmORIBWIsFNeQ8rD4uFOE/Yy84D5AbZ6O
 BztimcCy77TQzmERiEj7H14aNbQekf070yZmICtK8isCbpWiHQRPo3VlOqzAaN94
 1sjMX6SfH480UrhH4+XXYGdpbitm1IRKRoXrj1MIqvxNpMyVl+tMQCyaHGq5wy46
 AFHLPY5YBYzkg1dJRwTyIpUbrfyl/O6zJloyH9z7jN2NJzTGep505GyQCfs/4wA+
 1R5OR3ZKgPXLl9flpp4WysOlbGhGxa5DjG2i59zrWbd2bXVjv80UncF5LGhLcogz
 3Jif42UjrnNPI/kf858QmmW8Gb2CMbR6uBwu50sB8JxwL6BkwUo=
 =FcEw
 -----END PGP SIGNATURE-----

Merge tag '0.32_rc2'

notmuch 0.32~rc2 release
2021-04-28 07:32:44 -03:00
David Bremner
fa1fb288e6 debian: add changelog for 0.32~rc2-1 2021-04-28 07:06:31 -03:00
David Bremner
bc58b5ad0d version: bump to 0.32~rc2 2021-04-28 07:04:57 -03:00
David Bremner
02e3fe4943 NEWS: fix typo
Spellcheckers, is that like spellchess?
2021-04-28 07:01:53 -03:00
David Bremner
aae0d6b9c4 NEWS: summarize changes to emacs interface.
This my attempt at a summary based on git log.

Amended: with suggestions from id:87wnsmkf12.fsf@bernoul.li
2021-04-28 07:00:00 -03:00
David Bremner
b34bc7c789 Revert "Vim: Ensure that every queries respect excluded tags"
This reverts commit 0998fa9a09.

per id:CAMP44s2k+fthVXCS9R9kQRzzwWbnS7RAcKg1Q0m6q5Ybzdm71Q@mail.gmail.com
2021-04-27 20:34:53 -03:00
David Bremner
f35dadfb76 NEWS: mention file deletion speedups
It seems a bit silly to have two NEWS entries for one commit, but
there are two potiential audiences.
2021-04-26 20:53:01 -03:00
Jules Aguillon
0998fa9a09 Vim: Ensure that every queries respect excluded tags
This makes sure that the bug solved by the previous commit won't happen again
and remove some dupplication.
This shouldn't have any side effect.
2021-04-26 20:20:57 -03:00
Jules Aguillon
c3c74621fa Vim: Respect excluded tags when showing a thread
Other queries have exclude_tags taken into account but this one.
This is annoying when using an excluded tag to ignore past messages from a
thread (for example the 'deleted' tag), the entire thread is shown all the
time.
2021-04-26 20:16:12 -03:00
Felipe Contreras
8af4cd160a vim: fix Mail 2.8.0 warning
Passing an unparsed header field to Mail::Field.new is deprecated and will be removed in Mail 2.8.0. Use Mail::Field.parse instead.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-04-26 20:06:13 -03:00
David Bremner
00487fa901 test: hide message from moreutils parallel.
The argument --version confuses moreutils parallel, but this is OK,
because its confusing does not include printing "GNU"
2021-04-26 09:00:11 -03:00
Tobias Backer Dirks
f2b5ad28e2 test: check for GNU parallel with --version options
The lastest versions of GNU parallel no longer make mention of GNU
within their help output. This causes the test script to mistakenly use
the moreutils parallel execution. In order to fix this, while
maintaining compatibility with previous versions of GNU parallel,
--version should be used.

Signed-off-by: Tobias Backer Dirks <omgitsaheadcrab@gmail.com>
2021-04-24 20:06:41 -03:00
David Bremner
f8463d7374 debian: bump changelog version 2021-04-24 12:46:32 -03:00
David Bremner
07a8130483 version: bump to 0.32~rc1 2021-04-24 12:26:09 -03:00
David Bremner
9f8458a998 debian: add xapian-tools for tests
xapian-metadata is used by some of the new tests.
2021-04-24 12:17:59 -03:00
David Bremner
5f80e106d6 lib/config: remove early free in _get_email_from_passwd_file
This (obvious) bug was caused by cut&pasting the code from
notmuch-config.c into the library and adding on a return at the end.
2021-04-24 12:11:45 -03:00
David Bremner
27a2c2c80d test: replace notmuch_passwd_sanitize with python version
Apparently the -f option to hostname is not portable, and in fact it
does not seem to always behave reasonably in e.g. a chroot.

Python code originally due to Tomi [1], modified by yours truly.

[1]: id:m2lf9fbkug.fsf@guru.guru-group.fi
2021-04-24 12:11:22 -03:00
David Bremner
c008176ade debian: update d/libnotmuch5
This corresponds to libnotmuch 5.3. It should be backward compatible
because it only adds symbols.
2021-04-24 08:55:45 -03:00
David Bremner
6caf8c25d4 debian: start changelog for 0.32~rc0-1 2021-04-24 08:49:44 -03:00
David Bremner
2e6a40ea8c update version to 0.32~rc0 2021-04-24 08:45:54 -03:00
Đoàn Trần Công Danh
441a327051 compat: rename {,notmuch_}canonicalize_file_name
When compat canonicalize_file_name was introduced, it was limited to
C code only because it was used by C code only during that time.

>From 5ec6fd4d, (lib/open: check for split configuration when creating
database., 2021-02-16), lib/open.cc, which is C++, relies on the
existent of canonicalize_file_name.

However, we can't blindly enable canonicalize_file_name for C++ code,
because different implementation has different additional signature for
C++ and users can arbitrarily add -DHAVE_CANONICALIZE_FILE_NAME=0 to
{C,CXX}FLAGS.

Let's move our implementation into a util library.

Helped-by: Tomi Ollila <tomi.ollila@iki.fi>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2021-04-24 08:07:00 -03:00
Felipe Contreras
62f03b6ab8 ruby: fix ruby 3.1 warnings
init.c:214:5: warning: ‘rb_cData’ is deprecated: by: rb_cObject.  Will be removed in 3.1. [-Wdeprecated-declarations]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-04-18 21:42:43 -03:00
David Bremner
084e60d54a lib/n_d_index_file: check return value from _n_m_add_filename
Ignoring this return value seems like a bad idea in general, and in
particular it has been hiding one or more bugs related to handling
long directory names.
2021-04-18 10:02:20 -03:00
Đoàn Trần Công Danh
828a004921 test-lib: unset XDG_CONFIG_HOME
lib/open.cc:_load_key_file will only open xdg-config files in
$XDG_CONFIG_HOME if it's defined, $HOME/.config will be considered if
and only if XDG_CONFIG_HOME not defined.

Let's unset said variable before running the test.
2021-04-18 10:00:10 -03:00
David Bremner
9ad19e4454 lib: directly traverse postlists in _n_message_delete
This is intended to fix the slow behaviour of "notmuch new" (and possibly
"notmuch reindex") when large numbers of files are deleted.

The underlying issue [1] seems to be the Xapian glass backend spending
a large amount of time in db.has_positions when running queries with
large-ish amounts of unflushed changes.

This commit removes two uses of Xapian queries [2], and replaces them with
an approximation of what Xapian would do after optimizing the
queries. This avoids the calls to has_positions (which are in any case
un-needed because we are only using boolean terms here).

[1] Thanks to "andres" on IRC for narrowing down the performance
bottleneck.

[2] Thanks to Olly Betts of Xapian fame for talking me a through a fix
that does not require people to update Xapian.
2021-04-18 09:50:36 -03:00
David Bremner
8a64f725df perf-tests: add test for removing files.
Without the proposed fix for deletion performance [1], this test is
probably unreasonably slow compared to others at the same
small/medium/large scale.

[1]: id:20210414021627.1236560-3-david@tethera.net
2021-04-18 09:50:26 -03:00
David Bremner
5248f55d5f test: put shim at end of LD_PRELOAD path
Certain tools like the address-sanitizer fail if they are not the
first LD_PRELOADed library. It does not seem to matter for our shims,
as long as they are loaded before libnotmuch.
2021-04-16 09:06:39 -03:00
David Bremner
3734c76d12 NEWS: user visible config related changes for 0.32 2021-04-10 09:49:37 -03:00