Commit graph

7029 commits

Author SHA1 Message Date
David Bremner
25e0f5e592 lib/open: do not consider .notmuch alone as an existing database.
It makes perfect sense for users to want to pre-create .notmuch,
e.g. to install hooks, so we should handle the case of a .notmuch
directory without an actual xapian database more gracefully.
2021-12-29 14:11:21 -04:00
David Bremner
e43bad4883 test/new: add known broken test for missing xapian directory.
`notmuch new' should go ahead and create the xapian database if it is
missing, even in the case where the parent .notmuch (or equivalent)
directory exists.
2021-12-29 14:11:10 -04:00
David Bremner
2394ee6289 debian: build only against default python version
This problem will will be solved in the next release of dh-python, but
the crude solution is needed for backports anyway.
2021-12-10 09:36:10 -04:00
David Bremner
a254a15861 NEWS: mention fix for unprintable python exception 2021-12-09 08:54:15 -04:00
David Bremner
b5eaa8ee83 debian: changelog for 0.34.2-1 2021-12-09 08:49:52 -04:00
David Bremner
05ee23ba42 version: bump to 0.34.2 2021-12-09 08:47:15 -04:00
David Bremner
49f8d051d1 NEWS: add NEWS for 0.34.2 2021-12-09 08:44:22 -04:00
Floris Bruynooghe
ca4e1d885b Fix error message when using notmuch_status_to_string
The python exception class was incorrectly loading the error message
which resulted in unprintable exception objects.
2021-12-05 08:53:39 -04:00
David Bremner
d7f9572413 python-cffi: switch to notmuch_database_{open,create}_with_config
Since release 0.32, libnotmuch provides searching for database and
configuration paths. This commit changes the python module notmuch2 to
use those facilities.

This fixes the bug reported in [1], along with a couple of the
deprecation warnings in the python bindings.

Database.default_path is deprecated, since it no longer faithfully
reflects what libnotmuch is doing, and it is also no longer used in
the bindings themselves.

This commit choose the default of config=CONFIG.EMPTY (equivalent to
passing "" to notmuch_database_open_with_config).  This makes the
change upward compatible API-wise (at least as far as the test suite
verifies), but changing the default to CONFIG.SEARCH would probably be
more convenient for bindings users.

[1]: id:87h7d4wp6b.fsf@tethera.net
2021-12-04 08:42:31 -04:00
David Bremner
caafab01a4 test: add known broken tests for python bindings in split configs
This reproduces the bug(s) reported in id:87h7d4wp6b.fsf@tethera.net
2021-12-04 08:36:41 -04:00
David Bremner
5f077bef37 test: add python-cffi bindings to path for test_python
This will allow testing the new python bindings using test_python, in
addition to the current invocation of pytest.
2021-12-04 08:36:23 -04:00
David Bremner
4b361f4d35 python-cffi: fix typos in docstring for Database.default_path
These generate warnings from sphinx doc, which makes it harder to
debug documentation changes. They also corrupt the output.
2021-12-04 08:36:07 -04:00
David Bremner
59aac9cef3 lib/config: don't overwrite database.path if the caller passed it
If the user passed a path, and we opened it, then we consider that
definitive definition of "database.path". This makes libnotmuch
respond more gracefully to certain erroneous combinations of
NOTMUCH_CONFIG settings and config file contents.
2021-12-03 20:52:11 -04:00
David Bremner
d467444085 lib/open: track which parameters are passed
This will be used to fine tune the loading of configuration for
certain special configuration items (initially just "database.path").
2021-12-03 20:50:03 -04:00
David Bremner
378415a557 test: add known broken test for conflict with database parameter
This is arguably user error: having configuration file with bad
settings in it (and/or having a bad NOTMUCH_CONFIG environment
variable).  On the other hand returning a different path than was
actually opened is definitely a bug.
2021-12-03 20:49:36 -04:00
David Bremner
59a778ae4b test/libconfig: use 'export' for remaining sets of NOTMUCH_CONFIG
It makes the tests easier to understand if we always use export for
environment variables.
2021-12-03 20:47:05 -04:00
David Bremner
48b5263646 doc/python-cffi: import from built bindings, not installed module
Previously the python-cffi bindings either failed to build, or built
for the wrong module by using the installed module.

The fix requires correction the module path, building the bindings
before docs, and helping python find the built libnotmuch.

Based on patch / discussion from Micheal Gruber [1]

[1]: id:cover.1634808719.git.git@grubix.eu
2021-12-03 20:25:59 -04:00
David Bremner
6858c36595 debian: refinalize changelog 2021-11-03 10:20:49 -03:00
David Bremner
ba7f26e2a5 NEWS: finalize release date 2021-11-03 10:20:08 -03:00
David Bremner
edd5e15360 debian: changelog for 0.34.1-1 2021-10-31 08:25:25 -03:00
David Bremner
b4894de877 NEWS: start news for 0.34.1 2021-10-31 08:18:38 -03:00
David Bremner
0c2edc522b version: bump to 0.34.1 2021-10-31 08:11:25 -03:00
David Bremner
fe51c275fc lib/load_config: deallocate / NULL database on fatal error
This fixes a potential memory leak, and makes the behaviour of
notmuch_database_load_config (somewhat) consistent with
n_d_{open,create} with config.
2021-10-30 13:51:50 -03:00
David Bremner
8f0b84789d lib/load_config: document expectations for db on error, add tests
This is a bit different than n_d_{open,create}_with_config, since
there are several non-zero status codes where we do want to return a
non-NULL database structure.
2021-10-30 13:49:37 -03:00
David Bremner
2ba50b5230 lib/create: fix memory leak, ensure *database=NULL on error
This code previously relied on _finish_open to free the notmuch struct
on errors (except for the case of database == NULL, which was a
potential double free). When we removed those frees from _finish_open,
we introduced a (small) memory leak.

In this commit, fix the memory leak, and harmonize the on-error
behaviour with n_d_open_with_config.
2021-10-30 13:47:47 -03:00
David Bremner
f3fcdd2dda lib/create: document expectations for db on error, add tests
It seems sensible to harmonize the behaviour with
n_d_open_with_config. In this commit we just assert the desired
behaviour.
2021-10-30 13:45:40 -03:00
David Bremner
74c4ce6d88 lib/open: fix potential double-free, ensure *database=NULL on error
During refactoring for 0.32, the code that set notmuch=NULL on various
errors was moved into _finish_open. This meant that the the code which
relied on that to set *database to NULL on error was no longer
correct. It also introduced a potential double free, since the notmuch
struct was deallocated inside _finish_open (via n_d_destroy).

In this commit we revert to "allocator frees", and leave any cleanup
to the caller of _finish_open. This allows us to get back the
behaviour of setting *database to NULL with a small change. Other
callers of _finish_open will need free notmuch on errors.
2021-10-30 13:43:58 -03:00
David Bremner
a942cb8ee3 test: add two known broken tests for missing config files
The documentation claims that the database will be set to NULL in this
case, but it is currently not happening. Based on a reproducer [1]
from Austin Ray.

[1]: id:20211021190401.imirxau2ewke6e2m@athena
2021-10-30 13:42:16 -03:00
David Bremner
fb02817943 lib: document n_o_w_config can return NOTMUCH_STATUS_NO_CONFIG
This should be treated as fatal by callers, since we didn't succeed in
opening a Xapian database.
2021-10-30 13:41:57 -03:00
David Bremner
d6e4ca6a7a NEWS: fix typo in 0.34 news.
Thanks to jrm on IRC for finding the typo.
2021-10-27 22:06:36 -03:00
David Bremner
e2b842afb1 test/libconfig: use 'export' when restoring NOTMUCH_CONFIG
This is required when NOTMUCH_CONFIG has been unset, and is harmless
otherwise.
2021-10-27 22:05:45 -03:00
David Bremner
f25e48e023 NEWS: set date 2021-10-20 11:25:35 -03:00
David Bremner
95fc947f94 debian: changelog for 0.34 2021-10-20 11:16:03 -03:00
David Bremner
35c625cb97 add NEWS for remaining changes 2021-10-20 10:51:06 -03:00
David Bremner
7b490b4b80 version: bump to 0.34 2021-10-20 10:42:18 -03:00
David Bremner
0cab538778 NEWS: update sexp-query news 2021-10-20 10:42:18 -03:00
Doug Woos
175476d1d1 emacs: fix call to nonexistent notmuch--call-process-shell-command
Looks like a find/replace error in e722b4f4
2021-10-19 08:43:14 -03:00
David Bremner
0f196b5659 debian: add dependency on libsexp-dev
Enable the s-expression query parser in Debian.
2021-10-15 08:52:32 -03:00
David Bremner
603a9992e0 debian: add changelog for 0.34~rc0 2021-10-15 08:51:55 -03:00
David Bremner
40897af1fc INSTALL: document optional dependency on libsfsexp
For now putting it in the apt-get line will cause complaints about
missing packages for too many people.
2021-10-15 08:49:01 -03:00
David Bremner
d3d4c2804a NEWS: stub news for 0.34~rc0
This is mostly to pacify the release checks. NEWS will be filled in
during the release process.
2021-10-15 08:43:29 -03:00
David Bremner
8383b6cb3a lib: bump lib minor version to 5
One new function (and an enum) was added to the API/ABI.
2021-10-15 08:34:39 -03:00
David Bremner
1c932cd5e0 debian: add new function to symbols file 2021-10-15 08:34:09 -03:00
David Bremner
5ad946310d version: bump to 0.34~0
Start release process for 0.34.
2021-10-15 08:28:59 -03:00
David Bremner
bc91954ee0 debian: install notmuch-sexp-queries man page
This was missed in the series that added the sexp-query parser and
docs.
2021-10-12 08:20:09 -03:00
David Bremner
174ec2a28f configure: whitespace cleanup
In order to make it easier to keep the whitespace consistent in the
configure script, use the same style defined in devel/STYLE for
C/C++.

  Specifically, a line should begin with zero or more tabs followed
  by fewer than eight spaces.

Presumably this will be no more difficult for people editing configure
than for people editing the C and C++ code.
2021-10-10 20:58:29 -03:00
David Bremner
a4b1c39331 devel: script for checking a commit (series)
'check-notmuch-commit' is an updated version of a script I have been
using (although not always as consistently as I should) before sending
patches to the list.

Although it requires a bit more tooling, encouraging people to use
check-notmuch-commit might reduce the number of round trips to the
list for style nitpicks.
2021-10-10 20:55:09 -03:00
David Bremner
6e050de4c0 configure: check explicitely for python dev (include) files
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
2021-10-09 16:39:06 -03:00
David Bremner
3e2e724d53 notmuch 0.33.2 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEkiyHYXwaY0SiY6fqA0U5G1WqFSEFAmFVoPUACgkQA0U5G1Wq
 FSGSzg//WY202qUibO6pgFMPvgpYCB5g9Bq2lSzEcJzc2ZqZIH/3WvFSUeHMrInb
 GmHzJ4Q1w00K/wyB8MLYILKJ5/Tikg+O63/YkZMjXx6CDwu9zyNdk3L7TuZjkiOB
 rRiCPlEO7vvzUKedyecpY07DpgCYku1R9eOk032aSZEdOVheXIUUwDcR/cSFhxjO
 9amPls9vjZXKOQjOH8dgbxyZX8JbcTECgwYoFCT1k88NrVXdcGc3ds/ZuJowf2S7
 rIOLCZVuJD0yPGtMUBMHr5bRJ4O6e4NsHLNOgELFid3WXmQ3TzrRBDuJX5rDaaOs
 +0aqFWS57lujZLF+dZbZAYqK9CnQxZct+Au8GJlvvHZUBnS2skTTK8zu4NuGmgh0
 wckeesSXImC/NxHP/HaRNvcmrOUPTWYr3SaNKAbAl6zSjkhgzYxMnTnAFev+7HAc
 TNa50iLfMYaM0lyzD5gzhZZKvk68wwi1bxxhNMmfOF94HTjKOvL1AWxPoQkYUNN8
 07yvxURcZHwng+ufIfr/XsTDleiqSkYRJFtkpyP6+ZoYrIj815qtqQ03lzJTcYRn
 wMv3ipMrLuYMeP8T3Pr0y8DEl2WVPRyybYbN+07SkQLULzmjBhivxn3abSRqOFKm
 zDn6XiY3BMhTOPaslVIxZdP/8k7fA7Ak5qTVkXLZCPMZiV36k0w=
 =mwj4
 -----END PGP SIGNATURE-----

Merge tag '0.33.2'

notmuch 0.33.2 release
2021-09-30 08:58:48 -03:00
David Bremner
3c60a25c6d version: bump to 0.33.2 2021-09-30 08:28:49 -03:00